feat: add per-command help - #148
Merged
Merged
Conversation
Every command now answers -h / --help with usage, flags, subcommands, and examples scoped to that command, and seamless help <command> prints the same thing. The text lives in one registry (src/commands/helpTopics.ts) that both the full seamless --help output and the per-command output render from, so a flag is documented once. The dispatcher's known-command list comes from there too. The help check runs before a command parses its own arguments, so seamless init -h prints help instead of scaffolding ./-h. A -- separator ends the check, leaving room for a literal -h operand (seamless config set key -- -h).
This was referenced Aug 1, 2026
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.
seamless <command> -h/--help(andseamless help <command>) now print help for that command instead of the full manual.What changed
src/commands/helpTopics.tsholds an entry per command (usage lines, description sections, examples). Both the fullseamless --helpoutput and the per-command output render from it, so a flag is documented once.COMMANDSis derived from the same registry, replacing the hardcoded list the dispatcher used for its unknown-command message.src/commands/help.tsnow formats instead of hardcoding:printHelp()composes the USAGE and COMMANDS sections,printCommandHelp(name)prints the scoped view and returnsfalsefor an unknown topic so the caller falls back to the unknown-command error.src/index.ts). That also fixes a bug:seamless init -hpreviously fell through init's positional parsing and was treated as a project name, so it would have scaffolded./-h.hasHelpFlag(src/core/args.ts) stops at a literal--, leaving room for a command that legitimately takes-has a value:seamless config set key -- -h.Top-level
seamless --helpoutput is unchanged apart from a newseamless <command> --helpusage line, and--no-reactonverify, which was a real flag that had never been documented.Checks
npm run buildclean.npm test: 718 passed, 4 skipped.npm run coveragepasses; 100% onindex.ts,help.ts,helpTopics.ts, andargs.ts.New tests cover the flag parsing (including the
--escape), every command's scoped output, and the dispatcher paths (init -hnot scaffolding,help <command>, unknown topic).README gained a "Getting help" section, AGENTS.md points future changes at the registry, and there is a changeset (minor).