fix(completion): keep hidden and experimental-auth commands out of help and completion - #991
Merged
Merged
Conversation
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
force-pushed
the
bencherry/fish-skip-hidden
branch
from
September 24, 2026 06:16
4423fcd to
af33bbe
Compare
davidzhao
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
generate-fish-completionnow removesHiddencommands, and everything under them, from the command tree before callingToFishCompletion().autocomplete/fish_autocompleteis 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 …, thedaemon/dbgalias, 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
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/deleteThese only work under the hidden
--experimental-authflag, but they weren't markedHidden. As a result they showed inlk project --helpand 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, andlk project get --helpstill works.Testing
go vet ./cmd/lk,go test ./cmd/lklk project --helpandlk project --generate-shell-completionnow list onlyadd list remove set-defaultlk generate-fish-completion -o autocomplete/fish_autocomplete)