Repository navigation
feat(cluster): add shell completion for cluster names - #139
Open
Marius MJ (M99) wants to merge 2 commits into
Open
Marius MJ (M99) wants to merge 2 commits into
Marius MJ (M99) wants to merge 2 commits into
Conversation
Suggest cluster names on tab for the positional name argument and the --name/--cluster flags of cluster get, status, login, open, delete, access list/grant/revoke and pullsecret set. Completion stays silent when not signed in, on API errors, or after a 3s timeout. Completion requests skip telemetry, and file completion is disabled globally since no command takes a file path. Closes #122 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep shared helpers (timeout, signed-in check) in completion.go so completions for other resources can be added as separate files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Marius MJ (M99)
requested a review
from Benedicte Brandsnes Nyheim (benedictebn)
October 5, 2026 14:05
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.
Summary
Closes #122. Instead of accepting partial names, this adds tab completion for cluster names.
pkg/completionpackage withClusterNames,ClusterNameArgandRegisterClusterNameFlag--name/--clusterflags ofcluster get,status,login,open,delete,access list/grant/revokeandpullsecret setListClustersfails, or after 3 seconds.__complete,__completeNoDesc) use a no-op tracer and don't start a telemetry upload, so a Tab press doesn't record a traceSetDefaultShellCompDirective(NoFileComp)), since no command takes a file pathExisting completion scripts pick this up without changes, because they ask the binary for suggestions at Tab time.
Testing
pkg/completion/completion_test.goindev __complete cluster get ""against a local API🤖 Generated with Claude Code