Skip to content

fix(cli): Show group help for sentry <group> help in every group - #2464

Open
sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/cli-group-help-everywhere
Open

sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/cli-group-help-everywhere

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

sentry auth help fails with Too many arguments, expected 0 but encountered "help". The same happens for status, local, local daemon, and local session.

Stricli passes a trailing help to the group's default command. These groups have defaults that take no positionals, so the argument scanner rejects help before either existing help recovery runs. The error also reads as if auth takes no arguments, because it describes the hidden default command and not the group.

runCli now rewrites [global flags] <group...> help to help [global flags] <group...> before dispatch, whenever the path resolves to a route group. Every group then gets the output sentry issue help already gives: the --help tip on stderr and the group help on stdout, followed by the usual update notification. Groups that have no default command also stop printing No command registered for 'help' first.

Behavior change: after a group, help now always shows help. Before this change, a group whose default takes a positional (for example sentry project help) first tried help as a value, such as a project slug. help is never a subcommand name, so after a group it always means help. To look up a resource named help, use the explicit subcommand: sentry project view help still resolves it.

Unchanged: after a leaf command (sentry issue view help), help is still a positional and becomes help only when the command fails. A trailing help after an unknown path still prints the unknown-command error with suggestions.

Not in this PR: a typo in one of these groups (sentry auth nope) still gets the misleading Too many arguments message with no "did you mean". Fixing that belongs in the buildRouteMap wrapper.

via @sergical.

--

View Session [Sentry]

`sentry auth help`, `status help`, `local help`, `local daemon help`, and
`local session help` failed with `Too many arguments, expected 0 but
encountered "help"`. Stricli hands a trailing `help` to the group's default
command, and those defaults take no positionals, so the argument scanner
rejected it before either help recovery ran. Groups with no default
recovered, but printed `No command registered for 'help'` first.

runCli now rewrites `[global flags] <group...> help` to
`help [global flags] <group...>` before dispatch when the path resolves to a
route group. A trailing `help` after a leaf command is unchanged: it stays a
positional and only becomes help when the command fails.

A new test walks every public route group and checks that `<group> help`
exits 0, prints the group's help, and shows neither error.

Co-Authored-By: Sergiy Dybskiy <3760543+sergical@users.noreply.github.com>
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 22, 2026 5:13pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 22, 2026 5:13pm UTC

Request Review

Comment thread packages/cli/src/cli.ts Resolved
The group help branch returned from runCli inside the try, which skipped the update notification that every successful run shows.
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 22, 2026 16:34 Inactive
@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 22, 2026 17:04
@sentry-junior
sentry-junior Bot requested a review from sergical November 22, 2026 17:04
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7c05520. Configure here.

Comment thread packages/cli/src/cli.ts Resolved
The route scanner accepts global flags at any depth, so `sentry auth --json help` must also show group help. groupHelpArgs only skipped flags before the group.

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — d64dea90 Deployed Nov 22, 2026 by vercel[bot]
Preview – sentry-local — d64dea90 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant