Blitz supports shell autocompletion for bash, zsh, fish, and PowerShell. This allows you to use tab completion for commands, flags, and arguments, making the CLI easier to use.
When you install Blitz using the Linux packages (.deb or .rpm), bash completion is automatically installed and enabled out of the box. No additional configuration is required.
The completion script is installed at /etc/bash_completion.d/blitz and will be automatically loaded in new shell sessions.
To use completion in your current session after installation:
source /etc/bash_completion.d/blitzIf you installed Blitz manually (downloaded binary, built from source, or using macOS), you can install shell completion using the completion command.
To install bash completion system-wide (requires root):
sudo blitz completion bash > /etc/bash_completion.d/blitzTo install for your user only:
mkdir -p ~/.local/share/bash-completion/completions
blitz completion bash > ~/.local/share/bash-completion/completions/blitzIf you're using Homebrew's bash-completion:
blitz completion bash > $(brew --prefix)/etc/bash_completion.d/blitzFor other installations:
mkdir -p ~/.local/share/bash-completion/completions
blitz completion bash > ~/.local/share/bash-completion/completions/blitzAfter installation, reload your shell configuration:
source ~/.bashrc
# or
source ~/.bash_profileYou can also test completion in the current session:
source <(blitz completion bash)To install zsh completion:
blitz completion zsh > "${fpath[1]}/_blitz"Or install to a custom location:
mkdir -p ~/.zsh/completions
blitz completion zsh > ~/.zsh/completions/_blitzAdd the following to your ~/.zshrc if using a custom location:
fpath=(~/.zsh/completions $fpath)
autoload -U compinit && compinitTo test completion in the current session:
source <(blitz completion zsh)To install fish completion:
mkdir -p ~/.config/fish/completions
blitz completion fish > ~/.config/fish/completions/blitz.fishTo test completion in the current session:
blitz completion fish | sourceTo install PowerShell completion for the current session:
blitz completion powershell | Out-String | Invoke-ExpressionTo install for all sessions, save the completion script:
blitz completion powershell > blitz.ps1Then add the following to your PowerShell profile (usually $PROFILE):
. .\blitz.ps1After installing completion, you can verify it's working by:
- Opening a new terminal session
- Typing
blitz(with a space) and pressingTab - You should see available commands and flags
Example:
$ blitz <TAB>
completion help version --config --generator-type --output-type ...- Ensure completion script is installed: Check that the completion file exists in the expected location
- Reload your shell: Close and reopen your terminal, or run
source ~/.bashrc(or equivalent for your shell) - Check shell compatibility: Ensure you're using a supported shell (bash, zsh, fish, or PowerShell)
- Verify file permissions: The completion script should be readable
If completion isn't working after installing via Linux packages:
-
Verify the completion file exists:
ls -l /etc/bash_completion.d/blitz
-
Ensure bash-completion is installed:
# Debian/Ubuntu sudo apt-get install bash-completion # RHEL/CentOS/Fedora sudo yum install bash-completion # or sudo dnf install bash-completion
-
Source the completion file manually:
source /etc/bash_completion.d/blitz
If using Homebrew's bash-completion on macOS:
-
Ensure bash-completion is installed:
brew install bash-completion
-
Add to your
~/.bash_profileor~/.bashrc:[[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && . "$(brew --prefix)/etc/profile.d/bash_completion.sh"
You can generate completion scripts for any supported shell using the completion command:
# Generate bash completion
blitz completion bash
# Generate zsh completion
blitz completion zsh
# Generate fish completion
blitz completion fish
# Generate PowerShell completion
blitz completion powershellThe output can be redirected to a file or piped directly to your shell's configuration.