Shell completions
hwt can generate completion scripts for Bash, Zsh, Fish, and PowerShell.
Install and initialize bash-completion first. Cobra’s generated Bash script depends on it.
Load completions in the current shell:
source <(hwt completion bash)Install them for future sessions:
mkdir -p ~/.local/share/bash-completion/completionshwt completion bash > ~/.local/share/bash-completion/completions/hwtAdd a completion directory to fpath in ~/.zshrc:
fpath=(~/.zfunc $fpath)autoload -Uz compinitcompinitThen generate the completion file:
mkdir -p ~/.zfunchwt completion zsh > ~/.zfunc/_hwtStart a new shell or run exec zsh after installing it.
mkdir -p ~/.config/fish/completionshwt completion fish > ~/.config/fish/completions/hwt.fishFish discovers the file automatically in new and existing sessions.
PowerShell
Section titled “PowerShell”Load completions in the current session:
hwt completion powershell | Out-String | Invoke-ExpressionAdd the same command to $PROFILE to load completions in future sessions.