Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneesstack72

CLI dumps 300-line Cliffy Command object on unknown flags / subcommands

Opened by swamp_lord Ā· 4/27/2026Ā· Shipped 4/27/2026

When the CLI rejects an invalid flag or unknown subcommand, the user-friendly message ("Unknown option --inputs. Did you mean option --input?") is buried under ~300 lines / 9 KB of dumped Cliffy Command internals — circular refs, option/setting/builder maps, the whole framework state. The useful "did you mean" hint is on line 1 and visually lost.

This is specifically the ValidationError path; other input failures (missing required input, malformed JSON, bad YAML, non-existent file) print clean one-line errors as expected.

Steps to reproduce

# Wrong flag name
swamp workflow run namespace-debug --inputs podModel=foo
# → ValidationError + 309 more lines of Command{} dump

# Wrong short flag
swamp workflow run namespace-debug -i podModel=foo
# → same

# Unknown flag on method run
swamp model method run challenge-pods get --bogus
# → same

# Unknown subcommand
swamp workflow describe namespace-debug
# → same

For comparison, these stay clean and short:

  • swamp workflow run namespace-debug (missing required input)
  • swamp workflow run namespace-debug --input 'not-valid-syntax' (bad input format)
  • swamp workflow run namespace-debug --input-file /tmp/missing.yaml (missing file)

Expected

Just the first line — Unknown option "--inputs". Did you mean option "--input"? — and exit non-zero. Suppress the cmd: Command {…} payload on ValidationError (or at minimum hide it unless --log debug).

Sample output (truncated)

11:36:06.889 FTL error ValidationError: Unknown option "--inputs". Did you mean option "--input"?
    at Command.handleError (https://jsr.io/@cliffy/command/1.0.0/command.ts:2570:11)
    at Command.parseCommand (https://jsr.io/@cliffy/command/1.0.0/command.ts:2128:12)
    at async file:///var/folders/.../src/cli/mod.ts:1012:7
    at async runCli (file:///var/folders/.../src/cli/mod.ts:1004:5)
    at async file:///var/folders/.../main.ts:33:5 {
  exitCode: 2,
  cmd: <ref *1> Command {
    cmd: [Circular *1],
    parent: <ref *2> Command {
      cmd: [Circular *2],
      parent: <ref *3> Command { ... },
      ... another ~280 lines of nested Command objects, settings, options arrays ...
    }
  }
}

Environment

  • swamp 20260424.234336.0-sha.0022d1ca
  • macOS Darwin 22.6.0, zsh
  • Output size: 310 lines / 9039 bytes for a single bad flag
02Bog Flow
āœ“OPENāœ“TRIAGEDāœ“IN PROGRESSāœ“SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 3 MOREPR_MERGEDSHIPPED

Shipped

4/27/2026, 12:29:19 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack724/27/2026, 11:54:26 AM

Sign in to post a ripple.