Repository navigation
Add /help <command> usage cards for every slash command - #6
Merged
Merged
Conversation
Each command already has a one-line description in the CMDS table; what a one-liner can't carry is the argument syntax and a concrete example. This adds that as structured data and surfaces it on demand. - lib/cli/command-help.js: per-command usage, argument notes, examples and "see also", for all 142 slash commands. Descriptions still come from CMDS (one source of truth); this only adds the extra detail. usageLine() gives a handler one consistent usage string so the help a user reads and the error they hit can't drift. - /help <command> now renders a card (usage, arguments, examples, see also); /help <word> still falls back to the full-text search for non-commands. The main /help footer points at it. - An unknown slash command's "did you mean" hint now also offers /help <nearest> for that command's usage. - test/command-help.test.js checks the table against the real command list: no stale entries, every "see also" and example is a real command, every command renders a card. Wired into npm test.
After checking each card against the handler it documents: - fixed cards that listed the wrong arguments: /fallback (<model>|off, not on|off), /snippet (save/<name>/del, not "name = text"), /api (adds key/off), /alias (adds rm), /branch (adds delete), /plan (add/done/clear/run); - added cards that were missing for arg-taking commands: /mcp, /marketplace, /cowork, /bench, /btw, /whatbroke, /ai-prompt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/help <command>now shows a usage card — argument syntax, per-argument notes, examples and "see also" — for every slash command. Descriptions still come only from theCMDStable (one source of truth); the newlib/cli/command-help.jsadds just the extra detail a one-liner can't carry./help <word>: an exact command → its card; anything else → the existing full-text search./helpfooter and the "did you mean" hint on an unknown command both point at/help <command>.usageLine()gives handlers one consistent usage string so help and errors can't drift.Tests
test/command-help.test.js(wired intonpm test) checks the table against the real command list: no stale entries, every "see also"/example is a real command, every command renders a card. Full suite passes. Cards verified in a live--tuisession.