Reference
Shell Completions
Enable tab completion for whisp commands.
Shell Completions
Whisp provides tab completion for all commands and options in bash, zsh, fish, elvish, and PowerShell.
Generating Completions
whisp completions <shell>Available shells:
bashzshfishelvishpowershell
Bash
One-time Setup
whisp completions bash >> ~/.bashrc
source ~/.bashrcSystem-wide (Linux)
sudo whisp completions bash > /etc/bash_completion.d/whispHomebrew (macOS)
whisp completions bash > $(brew --prefix)/etc/bash_completion.d/whispZsh
One-time Setup
# Create completions directory if needed
mkdir -p ~/.zsh/completions
# Generate completion file
whisp completions zsh > ~/.zsh/completions/_whisp
# Add to fpath in ~/.zshrc (before compinit)
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinitOh My Zsh
whisp completions zsh > ~/.oh-my-zsh/completions/_whisp
source ~/.zshrcSystem-wide (Linux)
sudo whisp completions zsh > /usr/local/share/zsh/site-functions/_whispFish
One-time Setup
whisp completions fish > ~/.config/fish/completions/whisp.fishCompletions are loaded automatically on next shell start.
System-wide
sudo whisp completions fish > /usr/share/fish/vendor_completions.d/whisp.fishElvish
# Add to ~/.elvish/rc.elv
eval (whisp completions elvish | slurp)Or save to a file:
whisp completions elvish > ~/.elvish/lib/whisp.elv
# Then in rc.elv:
use whispPowerShell
# Add to $PROFILE
whisp completions powershell >> $PROFILEOr for current session only:
whisp completions powershell | Out-String | Invoke-ExpressionWhat Gets Completed
After installation, tab completion works for:
Commands
whisp st<TAB>
# Completes to: whisp start, whisp status, whisp stopSubcommands
whisp config <TAB>
# Shows: get, set, validate
whisp history <TAB>
# Shows: search, clearOptions
whisp start --<TAB>
# Shows: --foreground
whisp metrics --<TAB>
# Shows: --period, --jsonOption Values
whisp metrics --period <TAB>
# Shows: day, week, month, all
whisp completions <TAB>
# Shows: bash, zsh, fish, elvish, powershellVerifying Installation
Test that completions work:
# Type this and press TAB
whisp con<TAB>
# Should complete to: whisp config
whisp config <TAB>
# Should show: get set validateIf completions don't work:
-
Bash: Ensure bash-completion is installed
# Ubuntu/Debian sudo apt install bash-completion # macOS brew install bash-completion@2 -
Zsh: Verify compinit is loaded
# In ~/.zshrc, ensure this line exists: autoload -Uz compinit && compinit -
Fish: Completions should work automatically; try restarting fish
Updating Completions
After updating whisp, regenerate completions to get new commands:
# Bash
whisp completions bash > /path/to/completion/file
# Zsh
whisp completions zsh > ~/.zsh/completions/_whisp
rm -f ~/.zcompdump && compinit
# Fish
whisp completions fish > ~/.config/fish/completions/whisp.fishTroubleshooting
"command not found: compinit" (Zsh)
Add to your ~/.zshrc:
autoload -Uz compinit
compinitCompletions show old commands
Clear completion cache and regenerate:
# Zsh
rm -f ~/.zcompdump*
exec zsh
# Bash
source ~/.bashrcNo completions in tmux/screen
Ensure your shell rc file is sourced in new panes:
# tmux.conf
set-option -g default-shell /bin/zsh