Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLIPublic
Assigneeszack

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:

  1. Aliases. A command's .alias(…) names do not appear anywhere. swamp model list, swamp extension ls, swamp issue comment, swamp summarize and the rest cannot be mapped to the command they stand for.
  2. Hidden commands. Commands marked .hidden() are left out entirely: audit and its subcommands, first-rule, help, invite link, worker exec-dispatch.
  3. Whether an option takes a value. Each option carries flags, description, required, collect (and sometimes default), but nothing says whether it consumes the next word. --log-level and --json look the same, so swamp extension --log-level info push cannot be told from swamp extension info by 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 groups
  • HIDDEN_COMMANDS: audit (7 subcommands), first-rule, help, invite link, worker exec-dispatch
  • VALUE_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 in subcommands. If listing hidden commands by default is unwanted, put them behind a flag such as swamp 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.
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

10/8/2026, 3:20:27 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
zack assigned zack10/8/2026, 2:43:50 PM

Sign in to post a ripple.