Skip to content

fix(cli): space-form subcommands error instead of fake-succeeding; did-you-mean for flags#8332

Open
DavidWells wants to merge 1 commit into
split/exit-codesfrom
split/subcommand-suggestions
Open

fix(cli): space-form subcommands error instead of fake-succeeding; did-you-mean for flags#8332
DavidWells wants to merge 1 commit into
split/exit-codesfrom
split/subcommand-suggestions

Conversation

@DavidWells

Copy link
Copy Markdown
Contributor

Split from #8300 (4 of 9). Stacked on #8329 — merge that first; GitHub will retarget this to main.

What

netlify sites delete my-precious-site used to print the sites help text and exit 0. Now:

 ›   Error: 'netlify sites delete' is not a command.
 ›   Did you mean 'netlify sites:delete my-precious-site'?
 ›   Run 'netlify sites --help' to see available subcommands.

(exit 2, stderr — flags/args are preserved in the suggestion, so netlify env list --json suggests netlify env:list --json)

Also: typo'd flags get did-you-mean suggestions, and unknown root-level flags name the commands that own them (netlify --jsno'--json' is a flag of: env:list, status, ...).

Why it helps agents

This was the most dangerous false-success in the CLI: a script or agent doing cleanup reads exit 0 as "site deleted" when nothing happened. Exit 0 now always means the command actually ran, and the error names the exact corrected command so an agent self-corrects in one step.

Testing

  • New unit tests covering both suggestion paths and the space-form guard
  • typecheck ✓ lint ✓ 417 unit tests ✓ didyoumean/help snapshots unchanged

…exit 0

'netlify sites delete my-site' used to print the sites help text and
exit 0 - a false success for any script. Namespace commands now exit 2
with a colon-form did-you-mean that preserves the remaining args.
Typo'd flags also get did-you-mean suggestions, and root-level unknown
flags name the subcommands that own them.
@DavidWells DavidWells requested a review from a team as a code owner July 6, 2026 17:55
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8c6a8e6-2e3f-4f9f-b820-275ef194eff6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch split/subcommand-suggestions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant