feat: add dynamic shell completions for all commands#40
Merged
Conversation
merge: dev into main — dedup refactor, type cleanup, Dockerfile
Add comprehensive tab-completion support using Cobra's RegisterFlagCompletionFunc and ValidArgsFunction APIs. Includes: - Shared completion helper module (internal/cmdutil/completion.go) - Static enum completions for --state, --kind, --priority flags - Dynamic API-backed completions for --workspace, --repo, --base/--head, --reviewer/--assignee flags - Positional arg completions for PR numbers, issue IDs, branch names - All completions fail silently on auth/network errors (no crashes) - Tests for static completion helpers
- Add --base branch completion to pr edit command - Add --assignee completion to issue list command - Add tests for filterPrefix with tab-separated values
This was referenced Feb 13, 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.
Summary
RegisterFlagCompletionFuncandValidArgsFunctionAPIsinternal/cmdutil/completion.go) with reusable functions for both static and API-backed completionsWhat Changed
New Files
internal/cmdutil/completion.go— Shared completion helper module with static and dynamic completion functionsinternal/cmdutil/completion_test.go— Tests for static completion helpers and filterPrefixdocs/plans/2026-02-13-dynamic-shell-completions.md— Implementation planCompletion Types Added
--state,--kind,--priority--workspace--repo--base,--head,--target,--branch--reviewer,--assignee<number><issue-id><branch-name>Safety
Testing
Related Issues
Follow-up improvements tracked in: #35, #36, #37, #38, #39