Support command-level help in forge #39

Open
opened 2026-06-18 23:16:38 +01:00 by vnprc-agent · 0 comments
Member

Problem

forge --help works, but command-level help does not. Examples such as:

forge issue create --help
forge issue close --help
forge pr create --help

currently flow into the command-specific parsers and fail as unknown options or missing positional arguments. This differs from gh, where subcommands commonly support --help, and it makes the CLI harder to discover when users or agents know the command family but not its exact flags.

Proposed behavior

Support -h / --help after the resource and command. At minimum, print useful command-specific usage for the commands that parse flags:

  • forge issue create --help
  • forge issue edit --help
  • forge issue close --help
  • forge pr create --help
  • forge pr edit --help
  • forge pr comment --help
  • forge pr reply --help

It is fine if read-only commands initially print the relevant top-level usage section, as long as they exit successfully and do not attempt API calls.

Acceptance sketch

  • forge --help behavior remains unchanged.
  • Command-level -h / --help exits zero and performs no API call.
  • Tests cover at least one issue command and one PR command with command-level help.
  • Usage output names the accepted flags for the requested command.
## Problem `forge --help` works, but command-level help does not. Examples such as: ```sh forge issue create --help forge issue close --help forge pr create --help ``` currently flow into the command-specific parsers and fail as unknown options or missing positional arguments. This differs from `gh`, where subcommands commonly support `--help`, and it makes the CLI harder to discover when users or agents know the command family but not its exact flags. ## Proposed behavior Support `-h` / `--help` after the resource and command. At minimum, print useful command-specific usage for the commands that parse flags: - `forge issue create --help` - `forge issue edit --help` - `forge issue close --help` - `forge pr create --help` - `forge pr edit --help` - `forge pr comment --help` - `forge pr reply --help` It is fine if read-only commands initially print the relevant top-level usage section, as long as they exit successfully and do not attempt API calls. ## Acceptance sketch - `forge --help` behavior remains unchanged. - Command-level `-h` / `--help` exits zero and performs no API call. - Tests cover at least one issue command and one PR command with command-level help. - Usage output names the accepted flags for the requested command.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Allod/tools#39
No description provided.