feat(completion): add dynamic shell completions for issue IDs (#935)

Add intelligent shell completions that query the database to provide
issue ID suggestions with titles for commands that take IDs as arguments.

Changes:
- Add issueIDCompletion function that queries storage for all issues
- Register completion for show, update, close, edit, defer, undefer, reopen
- Add comprehensive test suite with 3 test cases
- Completions display ID with title as description (ID\tTitle format)

The completion function opens the database (read-only) and filters issues
based on the partially typed prefix, providing a better UX for commands
that require issue IDs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Bob Cotton
2026-01-06 19:59:25 -07:00
committed by GitHub
parent bf378650f4
commit 025cdac962
9 changed files with 324 additions and 0 deletions

View File

@@ -162,5 +162,6 @@ Examples:
func init() {
// Time-based scheduling flag (GH#820)
deferCmd.Flags().String("until", "", "Defer until specific time (e.g., +1h, tomorrow, next monday)")
deferCmd.ValidArgsFunction = issueIDCompletion
rootCmd.AddCommand(deferCmd)
}