Enabling wbsp shell autocomplete (macOS + zsh)
wbsp generates its own completion script (it's a Cobra CLI). It also supports
bash, fish, and powershell via wbsp completion <shell>, but these instructions
target macOS + zsh.
Try it for the current shell first (instant, no setup)
source <(wbsp completion zsh)Type wbsp <Tab> — if you get subcommand completions, it works. Now make it
permanent.
Make it permanent
The zsh shell uses a Function Search Path variable named fpath to specify locations where function definitions can be found. We use this to store the command completions for wbsp (i.e. as per standard zsh).
1. Write the completion file to a directory on zsh's fpath
mkdir -p ~/.zsh/completions
wbsp completion zsh > ~/.zsh/completions/_wbsp2. Ensure zsh completion is initialized
(Only once — skip if your ~/.zshrc already has compinit)
cat >> ~/.zshrc << END
# >>> WBSP installer
# Command completion for WBSP (and others)
fpath=(~/.zsh/completions \$fpath)
autoload -Uz compinit
compinit
# <<< WBSP installer
END3. Restart the shell
exec zshNotes / gotchas
-
wbspmust be on yourPATH(the installer put it in/usr/local/binor~/.local/bin). Check:which wbsp. -
If completions don't appear after restart, the completion cache is stale — rebuild it:
rm -f ~/.zcompdump*; compinit -
Other shells are supported too (
wbsp completion bash|fish|powershell) if you use them elsewhere.