Skip to content

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

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

fix(cli): add --no-descriptions flag to completion subcommands#5771
Coly010 wants to merge 2 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.
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