Skip to content

fix(cli): add --no-descriptions flag to completion subcommands#5771

Open
Coly010 wants to merge 3 commits into
developfrom
columferry/cli-1858-completion-bashzshfishpowershell-add-no-descriptions-flag
Open

fix(cli): add --no-descriptions flag to completion subcommands#5771
Coly010 wants to merge 3 commits into
developfrom
columferry/cli-1858-completion-bashzshfishpowershell-add-no-descriptions-flag

Conversation

@Coly010

@Coly010 Coly010 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Current Behavior

cobra auto-registers a --no-descriptions flag on the bash/zsh/fish/powershell completion subcommands whenever descriptions are enabled, which is the Go CLI's default. The TS proxy commands declared no flags at all, so supabase completion zsh --no-descriptions (and the other three shells) failed with an UnrecognizedOption error in TS before ever reaching the Go binary.

Expected Behavior

Each of the four completion leaves now declares --no-descriptions (name, default, and description matching cobra's compCmdNoDescFlagName/compCmdNoDescFlagDefault/compCmdNoDescFlagDesc constants exactly) and forwards it to the Go binary proxy. Since the flag is identical across all four leaves in the same command family, it's hoisted into completion.flags.ts rather than redeclared four times, following the same pattern already used for --linked/--local in storage.flags.ts.

Fixes CLI-1858

cobra auto-registers --no-descriptions on all four completion
subcommands whenever descriptions are enabled (the Go CLI default).
The TS proxies declared no flags at all, so the Effect CLI parser
rejected the flag with UnrecognizedOption before it ever reached the
Go binary. Hoisted the flag definition into completion.flags.ts since
it's shared by all four leaves in the same family.

Fixes CLI-1858
@Coly010 Coly010 self-assigned this Jul 2, 2026
The original fix only had handler-level tests, which call the handler
function directly and never exercise the Effect CLI parser — so a
dropped flag declaration in a command.ts config would silently
regress without failing any test.

- Add Command.runWith parser-level tests for bash/zsh/fish/powershell
  that parse real argv through the actual command definitions.
- Add a real-subprocess e2e test proving --no-descriptions survives
  Effect's parser and is forwarded to the Go binary (asserted via the
  __completeNoDesc marker Cobra embeds in the generated script).
- Note the --no-no-descriptions double-negation quirk from Effect's
  auto-derived --no-<flag> negation.
- Fix a stale __complete/ directory reference in SIDE_EFFECTS.md and
  note the flag addition in the porting status doc.
@Coly010 Coly010 marked this pull request as ready for review July 3, 2026 06:20
@Coly010 Coly010 requested a review from a team as a code owner July 3, 2026 06:20
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

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

Preview package for commit e0a75d0.

@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: dabd87b7a5

ℹ️ 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/legacy/commands/completion/bash/bash.handler.ts
)

Cobra bakes the completion callback name into the generated script at
generation time: scripts built with --no-descriptions call back into
`__completeNoDesc` (spf13/cobra's alias for the hidden __complete
command) on every tab press, not `__complete`. complete-passthrough.ts
only bypassed Effect's parser for `__complete`, so installed
--no-descriptions scripts would fail on every completion attempt
instead of reaching the Go binary.
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