fix(cli): give every site command a description and structured help - #422
Open
ankitranjan7 wants to merge 1 commit into
Open
fix(cli): give every site command a description and structured help#422ankitranjan7 wants to merge 1 commit into
ankitranjan7 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. Limitations
This review is advisory and does not block merging. |
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.
The problem
Every leaf under
webcmd siteshipped with no description and no option help —site field-map --helpprinted literallyadd [options] <site> <key>and nothing else — and--help -f yamlwas ignored across the whole namespace, so an agent had no way to learn the grammar. In a real eval that produced a cascade:site field-map quotes set(unknown command),note add quotes -m '...'(unknown option),endpoint set q landing --strategy PUBLIC(unknown option). The agent hit its step cap onsite field-map --helpstill not knowing the shape.What changed
sitegroup and leaf now has a.description(), and every.argument()/.option()has a help string — 11 leaves, 6 groups.site <thing> <site-name> <verb>instead ofsite <thing> <verb> <site-name>) is now stated onsite --helpas a Grammar block with a right/wrong pair, and each group's description repeats its own shape.Example:line and theAgent tip: use '--help -f yaml'footer, matching adapter command help.installCommanderNamespaceStructuredHelp(siteCmd, ...)insrc/cli.ts—sitewas the only built-in namespace missing from that list. It installsinstallStructuredHelpon the namespace, groups and leaves, sosite <anything> --help -f yamlnow returns structured YAML.helpInformationrather than commander'saddHelpText, becauseaddHelpTextalso wraps structured output and would corrupt the YAML.Not included:
-f/--formatflags for commands that lack them, owned by a separate change.Before / After
Tests
Three new cases in
src/site-memory/commands.test.ts: no command in thesitetree has an empty description; every site option and positional carries a help string;site note add --helpnames--textand the<site>-first usage. The existing site-help case now asserts the grammar block instead of the removedAuthoring:list, andsrc/hosted/runner.test.tsfollows the same rename.npm run typecheckclean.npx vitest run --project unit: 154 files, 2706 passed, 1 skipped, 0 failed.npm run buildclean; every terminal block above is copied from the builtdist/src/main.js.🤖 Generated with Claude Code