Skip to content

fix(cli): suggest subcommand placement for misplaced flags#5751

Merged
jgoux merged 5 commits into
developfrom
fix/subcommand-flag-suggestions
Jul 1, 2026
Merged

fix(cli): suggest subcommand placement for misplaced flags#5751
jgoux merged 5 commits into
developfrom
fix/subcommand-flag-suggestions

Conversation

@jgoux

@jgoux jgoux commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Improve CLI parser errors when a flag is passed before a subcommand even though it belongs to descendant subcommands. The formatter now inspects the command tree and appends a hint with the corrected placement, while suppressing secondary unknown-subcommand noise caused by the misplaced flag value.

This fixes the confusing network-restrictions --project-ref <ref> get --experimental output by suggesting network-restrictions get --project-ref <value>.

No linked issue found.

@jgoux jgoux marked this pull request as ready for review July 1, 2026 10:22
@jgoux jgoux requested a review from a team as a code owner July 1, 2026 10:22
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@a287f2b26eb4057f9f186dc9f0cb2cba79d14f70

Preview package for commit a287f2b.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 260b3ad71a

ℹ️ 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".

Comment thread apps/cli/src/shared/cli/run.ts Outdated
Comment thread apps/cli/src/shared/output/text-formatter.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4809db93c

ℹ️ 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".

Comment thread apps/cli/src/shared/cli/subcommand-flag-suggestions.ts
@jgoux

jgoux commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c071759825

ℹ️ 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".

Comment thread apps/cli/src/shared/output/text-formatter.ts Outdated
Comment thread apps/cli/src/shared/cli/subcommand-flag-suggestions.ts Outdated
@jgoux jgoux added this pull request to the merge queue Jul 1, 2026
Merged via the queue into develop with commit 39b3b8c Jul 1, 2026
27 checks passed
@jgoux jgoux deleted the fix/subcommand-flag-suggestions branch July 1, 2026 21:25
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.

2 participants