Repository navigation
Description
Problem
Running squad <command> --help or squad <command> -h (for almost every subcommand) does not print help. Instead, the --help/-h flag is silently dropped and the command executes for real — sometimes with destructive side effects (init creates files, triage/watch starts a long-running poll loop, etc.).
Top-level help works fine:
squad --help✅ prints helpsquad -h✅ prints helpsquad help✅ prints help
But subcommand-level help is broken across almost the entire CLI surface:
squad init --help❌ actually runsinit(writes files into the cwd)squad triage --help❌ actually starts the triage loopsquad watch --help❌ same — starts the watch loop (known: Add in-product help (--help) for squad watch command #757)squad status --help❌ runs statussquad roles --help❌ lists rolessquad doctor --help❌ runs the doctorsquad version --help❌ prints version (becauseversionis matched first)- …and the same is true for
upgrade,migrate,hire,copilot,plugin,export,import,scrub-emails,start,nap,memory,consult,extract,subsquads,link,build,aspire,schedule,personal,preset,cast,rc,copilot-bridge,init-remote,rc-tunnel,discover,delegate,upstream,economy,scrub-emails…
Today only two commands actually intercept --help / -h:
squad loop --help✅ (handled inline inpackages/squad-cli/src/cli-entry.tsaround line 625)squad state-mcp --help✅ (handled inline around line 427)
Every other command falls through to its real implementation with --help simply present in args.
Reproduction
Tested with @bradygaster/squad-cli v0.9.6-insider.3 on Windows (PowerShell 7) and Node 24.14.0 — but the bug is purely in the JS routing layer in packages/squad-cli/src/cli-entry.ts and is platform-independent.
In an empty directory:
mkdir /tmp/squad-help-bug && cd /tmp/squad-help-bug
squad init --help
# Expected: help text for the init command
# Actual: init runs for real and creates .squad/, .github/, .gitignore, .gitattributes, .copilot/squad triage --help
# Expected: help text for the triage command
# Actual: starts the triage polling loop (Ctrl+C needed)squad doctor --help
# Expected: help text for the doctor command
# Actual: runs the doctor health checksquad status --help
# Expected: help text for the status command
# Actual: prints the current squad status reportRoot cause
In packages/squad-cli/src/cli-entry.ts:
- Lines 144–147 handle
--version/-v/version. - Lines 150–283 handle the top-level
--help/-h/help(only when it is the first arg). - The routes that follow each switch on
cmd(init,status,doctor, etc.) but do not check for--helpfirst before executing.
Result: --help lands in args as a no-op flag and the command runs.
Desired behavior
For every subcommand, squad <cmd> --help (and -h) should:
- Print help text and exit
0. - Never trigger the command's real side effects.
- Be intercepted in one place at the top of the router so we don't have to remember per command.
Per-command help text should at minimum describe: what the command does, usage, flags. For commands with rich inline help today (loop, state-mcp), behavior should be preserved.
Proposed fix (rough)
In main() in cli-entry.ts, after the top-level --help block and before the per-command routing, add:
if (cmd && cmd !== 'help' && cmd !== '--help' && cmd !== '-h'
&& cmd !== 'version' && cmd !== '--version' && cmd !== '-v'
&& (args.includes('--help') || args.includes('-h'))) {
printCommandHelp(cmd);
return;
}…where printCommandHelp is a small switch that returns command-specific help (extracted from the existing top-level help blob), falling back to a friendly "no detailed help for X — see squad help" message for commands without a dedicated block. Existing inline handlers in loop and state-mcp can call into the same helper to remove duplication.
Related
- Add in-product help (--help) for squad watch command #757 — Add in-product help for
squad watch(CLOSED, never fixed; this issue is broader and supersedes it). - Bug:
squad externalizeandsquad internalizemissing fromsquad --helpoutput #1050 —externalize/internalizemissing from top-level help (different but adjacent UX bug).
Severity
User-facing UX bug with destructive potential: squad init --help writes files into the cwd; squad triage --help / watch --help starts a long-running daemon. The current behavior actively trains users out of using --help on this CLI.
Environment
@bradygaster/squad-cliv0.9.6-insider.3- Node.js v24.14.0
- Windows / PowerShell 7
- Behavior reproduces on
devbranch HEAD (verified by readingpackages/squad-cli/src/cli-entry.ts).
Willing to fix
Yes — I'd like to open a PR for this. Will follow the branch / changeset / draft-PR workflow from CONTRIBUTING.md.
Activity
fix(cli): intercept --help on every subcommand (#1201)