Shell Completion Guide¶
Enable tab completion for Devo CLI commands in your shell.
Overview¶
Shell completion allows you to:
- Press TAB to autocomplete commands
- See available options and subcommands
- Speed up command entry
- Discover commands interactively
Quick Setup¶
Zsh¶
Add to ~/.zshrc:
Then reload:
Bash¶
Add to ~/.bashrc:
Then reload:
Fish¶
Add to ~/.config/fish/config.fish:
Then reload:
Verification¶
Test completion works:
# Type and press TAB
devo <TAB>
# Should show:
# code-reviewer codeartifact-login commit config upgrade
# Try with options
devo commit --<TAB>
# Should show:
# --add --all --help --pull-request --push
Usage Examples¶
Command Completion¶
devo c<TAB>
# Completes to: devo code-reviewer, commit, config, codeartifact-login
devo co<TAB>
# Shows: code-reviewer codeartifact-login commit config
Option Completion¶
devo commit --<TAB>
# Shows all available options:
# --add --all --help --pull-request --push
devo config <TAB>
# Shows subcommands:
# export import migrate path reset sections set show
Profile Completion¶
If you have AWS profiles configured:
Advanced Configuration¶
Zsh with Oh My Zsh¶
If using Oh My Zsh, add to ~/.zshrc:
# Enable completion
autoload -Uz compinit && compinit
# Add Devo completion
eval "$(_DEVO_COMPLETE=zsh_source devo)"
Bash with Bash Completion¶
If using bash-completion package:
# Install bash-completion if needed
# macOS: brew install bash-completion
# Ubuntu: sudo apt install bash-completion
# Add to ~/.bashrc
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
eval "$(_DEVO_COMPLETE=bash_source devo)"
Fish with Fisher¶
If using Fisher plugin manager:
Troubleshooting¶
Completion Not Working¶
- Verify Devo is in PATH:
- Reload shell configuration:
- Check completion is loaded:
Slow Completion¶
If completion is slow, you can generate a static completion file:
Zsh¶
# Generate completion file
_DEVO_COMPLETE=zsh_source devo > ~/.zsh/completions/_devo
# Add to ~/.zshrc
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit
Bash¶
# Generate completion file
_DEVO_COMPLETE=bash_source devo > ~/.bash_completions/devo
# Add to ~/.bashrc
source ~/.bash_completions/devo
Completion Shows Wrong Commands¶
Clear completion cache:
Permission Denied¶
Ensure completion directory exists and is writable:
# Zsh
mkdir -p ~/.zsh/completions
chmod 755 ~/.zsh/completions
# Bash
mkdir -p ~/.bash_completions
chmod 755 ~/.bash_completions
Uninstalling Completion¶
Zsh¶
Remove from ~/.zshrc:
Then reload:
Bash¶
Remove from ~/.bashrc:
Then reload:
Fish¶
Remove from ~/.config/fish/config.fish:
Then reload:
Completion Features¶
Command Completion¶
- Main commands:
commit,code-reviewer,config, etc. - Subcommands:
config show,config set, etc.
Option Completion¶
- Short options:
-a,-p,-pr - Long options:
--add,--push,--pull-request - Global options:
--profile,--help,--version
Argument Completion¶
- AWS profiles (from
~/.aws/config) - Configuration keys (for
config get/set) - File paths (where applicable)
Tips¶
- Double TAB: Press TAB twice to see all options
- Partial Match: Type partial command and TAB to complete
- Help Text: Use
--helpto see all options - Explore: Use TAB to discover available commands