Skip to content

fix(completion): keep hidden and experimental-auth commands out of help and completion - #991

Merged
bcherry merged 2 commits into
mainfrom
bencherry/fish-skip-hidden
Sep 24, 2026
Merged

bcherry merged 2 commits into
mainfrom
bencherry/fish-skip-hidden

Conversation

@bcherry

@bcherry bcherry commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed

generate-fish-completion now removes Hidden commands, and everything under them, from the command tree before calling ToFishCompletion(). autocomplete/fish_autocomplete is regenerated.

Why

urfave/cli's fish generator (prepareFishCommands) skips a hidden command's own line, but it still recurses into that command's flags and subcommands. It also lists hidden names in the top-level and sibling lists. As a result, hidden and experimental commands showed up in fish tab-completion: lk simulation …, lk user …, lk workspace …, lk analytics …, lk replay …, lk project member/invite …, the daemon/dbg alias, and the legacy flat commands (create-room, join-room, load-test, and so on). Several of these described themselves as "(requires --experimental-auth)".

Hidden flags were already excluded, because the generator uses VisibleFlags().

Reviewer notes

  • I checked the diff: every removed completion entry lives under a hidden command. The only added line is the shorter top-level command list.
  • Side effect: hidden command names are no longer in the "no subcommand yet" check, so lk create-room <tab> now offers top-level commands. This seems fine for commands we don't advertise.

Also: hide lk project get/create/update/delete

These only work under the hidden --experimental-auth flag, but they weren't marked Hidden. As a result they showed in lk project --help and in completion for every shell (zsh/bash completion asks the binary directly). Now they're hidden like the other experimental-auth commands. They still run when called directly, and lk project get --help still works.

Testing

  • go vet ./cmd/lk, go test ./cmd/lk
  • lk project --help and lk project --generate-shell-completion now list only add list remove set-default
  • Regenerated with the CI command (lk generate-fish-completion -o autocomplete/fish_autocomplete)

@bcherry bcherry changed the title fix(completion): omit hidden commands from fish completion fix(completion): keep hidden and experimental-auth commands out of help and completion Sep 23, 2026
@bcherry
bcherry requested review from rektdeckard and u9g September 23, 2026 05:38
urfave/cli's fish generator skips a hidden command's own line but still
emits its subcommands and flags, so hidden groups (lk simulation, user,
workspace, analytics, replay, project member/invite, legacy commands)
showed up in fish tab-completion. Prune hidden commands from the tree
before generating, and regenerate autocomplete/fish_autocomplete.
lk project get/create/update/delete only work under the hidden
--experimental-auth flag, but were listed in `lk project --help` and
shell completion. Hide them like the other experimental-auth commands.
@bcherry
bcherry force-pushed the bencherry/fish-skip-hidden branch from 4423fcd to af33bbe Compare September 24, 2026 06:16
@bcherry
bcherry merged commit c19eef2 into main Sep 24, 2026
25 checks passed
@bcherry
bcherry deleted the bencherry/fish-skip-hidden branch September 24, 2026 16:37
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