feat: add shell tab completion for bash, zsh, and fish#6
Draft
feat: add shell tab completion for bash, zsh, and fish#6
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Co-authored-by: ruibaby <21301288+ruibaby@users.noreply.github.com>
Copilot stopped work on behalf of
ruibaby due to an error
March 19, 2026 09:14
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Co-authored-by: ruibaby <21301288+ruibaby@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for command suggestions using tab key
feat: add shell tab completion for bash, zsh, and fish
Mar 19, 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.
No tab completion existed for the
haloCLI. This adds ahalo completioncommand that emits shell hook scripts and handles the inline completion callback shells invoke on every Tab press.New:
halo completioncommandhalo completion bash|zsh|fish— prints a shell-specific completion hook script to stdout; users source it in their rc file or drop it into the fish completions directoryhalo completion -- <words…>— the internal callback invoked by the hook on every Tab; returns newline-separated candidates to stdoutCompletion logic (
src/commands/completion/index.ts)TOP_LEVEL_COMMANDS+SUBCOMMANDSmaps covering all 12 command areas and their full subcommand trees, including two-level namespaces (auth profile,comment reply)computeCompletions(words)handles both invocation modes:COMP_LINE+COMP_POINTenv vars for cursor-aware tokenizationSetup
After sourcing,
halo po<TAB>→post;halo post <TAB>→list get create update delete open import-json export-json.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.