Repository navigation
CLI: add per-subcommand --help for all commands - #128
Conversation
Previously, --help/-h was only checked at the top level before command dispatch. Running e.g. `cmux new-workspace --help` would execute the command instead of printing help. Add per-subcommand help text for all commands that take arguments/flags. The help check runs before socket connect so it works even when cmux is not running. Commands without dedicated help (ping, help, list-windows, etc.) fall through to normal behavior.
Preview Videos and ScreenshotsOpen Workspace (1 hr expiry) · Open Dev Browser (1 hr expiry) · Open Diff Heatmap Screenshot status is unknown for this run. Generated by manaflow preview system |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed2956ddc7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if commandArgs.contains("--help") || commandArgs.contains("-h") { | ||
| if dispatchSubcommandHelp(command: command, commandArgs: commandArgs) { |
There was a problem hiding this comment.
Respect
-- terminator when detecting subcommand help
This pre-dispatch check treats any --help/-h token in commandArgs as a help request, even when it appears after the argument terminator. Commands like send/send-key explicitly support [--] to pass literal values, so cmux send -- --help or cmux send-key -- -h should forward those literals, but now they print help and return early instead. That is a behavior regression for scripts/automation that need to send these exact strings.
Useful? React with 👍 / 👎.
…manaflow-ai#128) Previously, --help/-h was only checked at the top level before command dispatch. Running e.g. `cmux new-workspace --help` would execute the command instead of printing help. Add per-subcommand help text for all commands that take arguments/flags. The help check runs before socket connect so it works even when cmux is not running. Commands without dedicated help (ping, help, list-windows, etc.) fall through to normal behavior.
Summary
--help/-hsupport to 22 subcommands that accept arguments/flagsping,help,list-windows, etc.) fall through to the top-level usageSubcommands with help
focus-window,close-window,move-workspace-to-window,move-surface,reorder-surface,reorder-workspace,new-workspace,new-split,new-pane,new-surface,close-surface,drag-surface-to-split,close-workspace,select-workspace,send,send-key,send-panel,send-key-panel,notify,claude-hook,browser,focus-paneBefore
After
Test plan
cmux new-workspace --helpprints help instead of creating a workspacecmux send --helpprints helpcmux browser --helpprints helpcmux --helpstill prints top-level usageCloses #119