Add shell completion support for bash and zsh#143
Merged
Conversation
Enable Cocona's shell completion feature and package pre-generated scripts so completions work out of the box for .deb and Homebrew users. Tarball users can use the --completion flag manually. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds shell completion support for bash and zsh to keystone-cli, enabling tab completion for commands and options. Completions are automatically installed by package managers (Homebrew, apt), while manual installation users can enable completions using eval "$(keystone-cli --completion bash)".
Changes:
- Enabled Cocona's shell completion feature in the CLI application
- Added automation to generate and distribute completion scripts in releases
- Updated documentation to explain completion setup for different installation methods
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Keystone.Cli/Program.cs | Enabled shell completion support in Cocona configuration |
| scripts/generate-completions.sh | New script to generate bash and zsh completion files from the binary |
| scripts/package-release.sh | Updated to include completion scripts in release tarballs |
| scripts/verify-deb-install.sh | Added verification checks for installed completion files |
| nfpm.yaml | Configured .deb package to install completions to system paths |
| .github/workflows/release.yml | Added workflow steps to generate and distribute completion scripts |
| docs/man/man1/keystone-cli.1 | Documented the --completion flag and usage examples |
| README.md | Added shell completion installation instructions |
| CLAUDE.md | Documented completion implementation details and local testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The nfpm.yaml references completion files, so the build-deb action must ensure they exist before packaging. Skips generation if scripts already exist (e.g., pre-generated in release workflow). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Enable tab completion for keystone-cli commands and options in bash and zsh shells. Package managers (Homebrew, apt) install completions automatically, while tarball users can use
eval "$(keystone-cli --completion bash)"in their shell config.Related Issues
Fixes #115
Changes
generate-completions.shscript for CI to produce completion scripts