Merged
Conversation
Add `resend completion <shell>` command that generates static completion scripts by introspecting the Commander.js command tree. Completes commands, subcommands, aliases, options, and option choice values. Help text includes per-shell setup instructions following the gh/kubectl convention.
Auto-detect shell from $SHELL/$PSModulePath, fall back to interactive select prompt. Add --install to write completions to the correct location per shell (fpath for zsh, completions dir for fish, profile eval for bash/powershell). Fix PowerShell profile path for Windows. Show help instead of raw script when run interactively with no args.
…vior - Show descriptions alongside commands/options in zsh completions - Insert fpath before compinit in .zshrc so completions work immediately - Stop suggesting root commands when deep in a command path - Use explicit "" match for root level instead of catch-all *
18e664b to
c2cec88
Compare
Contributor
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/lib/completion.ts">
<violation number="1" location="src/lib/completion.ts:117">
P2: Choice completion is keyed only by flag name, so identical flags on different subcommands can overwrite each other and produce wrong suggestions.</violation>
<violation number="2" location="src/lib/completion.ts:176">
P2: Completion output omits short flags, so `-p`/`-q`-style options are not suggested in Bash/Zsh/PowerShell.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Use _describe for zsh completions to show descriptions like gh does
- Remove dead getProfilePath('fish') case
- Replace catch-all * with explicit "" for root-level completions
- Add escapeZsh helper for colon-safe descriptions
Restructure bash, zsh, and PowerShell generators so each cmd_path case handles its own choices, options, and subcommands. Previously choice options were collected into a global map keyed by flag name, which could produce wrong suggestions if different subcommands reused the same flag with different choices.
vcapretz
approved these changes
Mar 21, 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 description provided.