Skip to content

feat: add help flag to display usage information and available tools - #40

Merged
HoussemEddineChaouch merged 4 commits into
HoussemEddineChaouch:mainfrom
abusnitsky:feat/add-help-flag
Jul 20, 2026
Merged

feat: add help flag to display usage information and available tools#40
HoussemEddineChaouch merged 4 commits into
HoussemEddineChaouch:mainfrom
abusnitsky:feat/add-help-flag

Conversation

@abusnitsky

@abusnitsky abusnitsky commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds support for --help and -h in the CLI startup flow.
When either flag is provided, the app now prints:

  • short usage instructions and CLI description
  • the list of available tools with their descriptions

Then it exits cleanly without starting the interactive chat loop.

Type of change

  • Bug fix
  • New feature / tool
  • Documentation update
  • Refactor

How to test it

  1. Run node src/index.js --help.
  2. Confirm help text is printed (usage + available tools).
  3. Confirm the process exits immediately.
  4. Run node src/index.js -h and verify the same behavior.

Related issues

Closes #15

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

@abusnitsky is attempting to deploy a commit to the houssemeddinechaouch's projects Team on Vercel.

A member of the Team first needs to authorize it.

@HoussemEddineChaouch

Copy link
Copy Markdown
Owner

Hi @abusnitsky,

Please verify that node index.js -h is working. During testing, I got a "Cannot find module 'index.js'" error. Please fix the issue and push the changes again for review.

Also, I think there are a few useful enhancements we could add, such as:

  • Displaying the ASCII codes for the returned text.
  • Improving the overall output structure and formatting to make it clearer and easier to read.

Thanks!

@abusnitsky

abusnitsky commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@HoussemEddineChaouch sorry, node index.js -h is a typo in the PR, you need to run node src/index.js -h from the root.

@HoussemEddineChaouch

Copy link
Copy Markdown
Owner

@HoussemEddineChaouch sorry, node index.js -h is a typo in the PR, you need to run node src/index.js -h from the root.

Fix the PR template in the How to test it section. Also, before merging it, please improve the user experience by making the *help * return more noticeable. Add morestyling, such as ASCII colored output, background colors, following the style already used in the current CLI.

@abusnitsky

Copy link
Copy Markdown
Contributor Author

@HoussemEddineChaouch I improved the structure and formatting, and added a bit of color.

@HoussemEddineChaouch

HoussemEddineChaouch commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Hey @abusnitsky, clean and well-structured implementation!

One small request before merging, could you extract
the printHelp() function into its own file e.g.
src/help.js and import it in index.js?

This keeps index.js thin and makes help easy to extend
or reuse in the future. please also update the readme with this new feature .

@abusnitsky

Copy link
Copy Markdown
Contributor Author

could you extract the printHelp() function into its own file e.g. src/help.js and import it in index.js?

Done. I think we should also introduce a settings file where we can store constants like colors.

@HoussemEddineChaouch

Copy link
Copy Markdown
Owner

could you extract the printHelp() function into its own file e.g. src/help.js and import it in index.js?

Done. I think we should also introduce a settings file where we can store constants like colors.

Great, thanks!

On the settings/constants file , good idea but let's
keep it out of this PR. This PR is focused on the
--help flag, let's merge it clean and open a separate
issue for the constants refactor so it can be
discussed and done properly.

@HoussemEddineChaouch
HoussemEddineChaouch merged commit 009789d into HoussemEddineChaouch:main Jul 20, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add --help flag to show available tools and usage on startup

2 participants