Repository navigation
feat: add shell tab completion for query command options - #25
Merged
Merged
Conversation
added 2 commits
April 17, 2026 21:17
Add autocompletion for pt-snap query options using Typer's built-in shell completion support: - --template-use and --template-info: complete from registered template names - --category: complete with basic/statistical/business - --device: complete device IDs from the resolved database (env > project > global) A new src/pt_snap_cli/completion.py module provides the completion functions, including lazy DB resolution for device ID discovery. Users can enable completion with: pt-snap --install-completion Closes #1
The default was add_completion=False which disables --install-completion and --show-completion flags. Changed to True so users can enable shell tab completion.
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.
📝 Description
Add shell tab completion for
pt-snap querycommand options using Typer's built-in shell completion support:--template-useleak_detection,active_blocks)--template-info--categorybasic,statistical,business--device0,1)How it works:
src/pt_snap_cli/completion.pymodule with completion functionsEnable completion:
pt-snap --install-completion # Then restart your shellSupports bash, zsh, and fish out of the box (via Typer/Click).
🔗 Related Issue
Fixes #1
🧪 Testing
✅ Checklist