Relationships
#3175 swamp help --json: emit aliases, hidden commands, and whether an option takes a value
Opened by zack · 10/8/2026· Shipped 10/8/2026
Problem
swamp help --json is described as the canonical CLI schema, but three things an argv parser needs are missing from it:
- Aliases. A command's
.alias(…)names do not appear anywhere.swamp model list,swamp extension ls,swamp issue comment,swamp summarizeand the rest cannot be mapped to the command they stand for. - Hidden commands. Commands marked
.hidden()are left out entirely:auditand its subcommands,first-rule,help,invite link,worker exec-dispatch. - Whether an option takes a value. Each option carries
flags,description,required,collect(and sometimesdefault), but nothing says whether it consumes the next word.--log-leveland--jsonlook the same, soswamp extension --log-level info pushcannot be told fromswamp extension infoby the schema alone.
Who this affects
swamp-uat records which swamp command each test file runs (to map a swamp change to the tests worth running). It resolves argv against the swamp help --json tree, and to do so it now carries three hand-copied tables in src/cli/helpers/command_log.ts:
ALIASES: 19 aliases across 16 command groupsHIDDEN_COMMANDS:audit(7 subcommands),first-rule,help,invite link,worker exec-dispatchVALUE_GLOBAL_FLAGS:--log-level
They match swamp today, but any alias, hidden command or value-taking global option swamp adds later is silently recorded as unresolved, and nothing fails to say the tables are stale. Any other consumer of the schema (completions, agents verifying flags) has the same gap.
Proposed solution
Have swamp help --json emit, per command:
aliases: string[]: the command's alias names (empty when none).hidden: boolean, with hidden commands included insubcommands. If listing hidden commands by default is unwanted, put them behind a flag such asswamp help --json --include-hidden.
And per option (both options and globalOptions):
- whether it takes a value, for example
takesValue: boolean, or the value's name and type as declared (<level:string>).
These are additive fields, so existing readers of the schema keep working.
Alternatives considered
- Keep the hand-copied tables in swamp-uat (current state). Works until swamp changes, then drifts silently.
- Have swamp-uat parse swamp's source for
.alias()/.hidden()calls. Brittle, and couples the UAT repo to swamp's source layout.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.