feat: Add shell completion support for Bash and Zsh#1
Open
parweb wants to merge 2 commits intowedow:masterfrom
Open
feat: Add shell completion support for Bash and Zsh#1parweb wants to merge 2 commits intowedow:masterfrom
parweb wants to merge 2 commits intowedow:masterfrom
Conversation
- Add ticket-completion.bash for Bash shell - Add ticket-completion.zsh for Zsh shell - Support both 'ticket' and 'tk' commands - Complete commands, ticket IDs, statuses, types, priorities - Support subcommands (dep tree, --full, etc.) - Handle multi-argument commands (link, dep, etc.)
- Add comprehensive PR description - Add GitHub PR template - Document all features and testing scenarios
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.
Add Shell Completion Support (Bash & Zsh)
🎯 Overview
This PR adds comprehensive shell completion support for the
ticketCLI tool, supporting both Bash and Zsh shells. The completion works with both theticketcommand and thetkalias.📦 What's New
Completion Scripts
ticket-completion.bash- Full Bash completion supportticket-completion.zsh- Native Zsh completion with descriptionsInstallation Tools
install-completion.sh- Smart installer that detects shell and OSdiagnose-completion.sh- Diagnostic tool for troubleshootingfix-completion.sh- Automatic fix for common configuration issuesDocumentation
README.md- Updated with installation and usage instructions✨ Features
Complete Coverage
All commands and options are supported:
Smart Completion
.tickets/*.mdtk show abc<TAB>completes IDs starting with "abc"linkthat accept multiple IDsCross-Platform
🚀 Installation
Quick Start
Manual Installation
Bash:
Zsh:
cp ticket-completion.zsh $(brew --prefix)/share/zsh/site-functions/_ticket🧪 Testing
Test Scenarios Covered
dep tree)--type,--parent)link)ticketandtkaliasesTested On
🔧 Troubleshooting
If completion doesn't work after installation:
Common issues handled:
fpathconfigurationcompinitin.zshrc📝 Implementation Details
Bash Completion
complete -Ffor function-based completioncompgenfor efficient word matching_init_completiondependency for portabilityZsh Completion
#compdefdirective_argumentsfor structured completionDesign Decisions
.tickets/doesn't exist, still completes commands🔄 Backward Compatibility
📚 Documentation
Updated
README.mdwith:🎓 Usage Examples
Basic Workflow
Advanced Features
🙏 Credits
Implemented following shell completion best practices:
📋 Checklist
ticketandtk🔗 Related
This PR addresses the need for improved developer experience when using the
ticketCLI tool daily.Ready for review! 🚀