Shell Completion
Haloy supports shell completion for bash, zsh, fish, and PowerShell to make command usage faster and more convenient.
Bash
Temporary (current session only)
source <(haloy completion bash)
source <(haloy completion bash)
Permanent
Linux:
haloy completion bash | sudo tee /etc/bash_completion.d/haloy > /dev/null
haloy completion bash | sudo tee /etc/bash_completion.d/haloy > /dev/null
macOS:
haloy completion bash | sudo tee /usr/local/etc/bash_completion.d/haloy > /dev/null
haloy completion bash | sudo tee /usr/local/etc/bash_completion.d/haloy > /dev/null
Zsh
Create completions directory and generate completion file:
mkdir -p ~/.local/share/zsh/site-functions
haloy completion zsh > ~/.local/share/zsh/site-functions/_haloy
mkdir -p ~/.local/share/zsh/site-functions
haloy completion zsh > ~/.local/share/zsh/site-functions/_haloy
Add to ~/.zshrc (only needed once):
echo 'fpath=(~/.local/share/zsh/site-functions $fpath)' >> ~/.zshrc
echo 'autoload -U compinit && compinit' >> ~/.zshrc
echo 'fpath=(~/.local/share/zsh/site-functions $fpath)' >> ~/.zshrc
echo 'autoload -U compinit && compinit' >> ~/.zshrc
Reload your shell or restart terminal:
source ~/.zshrc
source ~/.zshrc
Fish
mkdir -p ~/.config/fish/completions
haloy completion fish > ~/.config/fish/completions/haloy.fish
mkdir -p ~/.config/fish/completions
haloy completion fish > ~/.config/fish/completions/haloy.fish
PowerShell
haloy completion powershell > haloy.ps1
# Then source the file from your PowerShell profile
haloy completion powershell > haloy.ps1
# Then source the file from your PowerShell profile
What You Get
Shell completion provides:
- Command completion:
haloy dep<tab>→haloy deploy - Subcommand completion:
haloy server <tab>showsadd,list,delete - Flag completion:
haloy deploy --t<tab>→haloy deploy --target - File path completion: Auto-complete configuration file paths
- Target name completion: Auto-complete target names for multi-target deployments
Testing Completion
After setup, test that completion works:
haloy <tab><tab> # Shows all available commands
haloy deploy --<tab> # Shows all deploy flags
haloy <tab><tab> # Shows all available commands
haloy deploy --<tab> # Shows all deploy flags
Troubleshooting
If completion doesn’t work:
- Ensure haloy is in your PATH: Run
which haloy - Reload your shell: Source your profile or restart terminal
- Check permissions: Ensure completion files are readable
- Verify completion is enabled: For bash, ensure bash-completion is installed