hapi has auto-complete support. This makes it easier to use the CLI and improves user experience by completing command
names by clicking TAB key. For example if you type hapi vps dat<TAB> with auto-completion enabled, shell will automatically append
rest of the command: hapi vps data-centers.
Auto-completion can be generated for multiple shells. The currently supported shells are:
- Bash
- Zsh
- fish
- PowerShell
After adding shell auto-completion, remember to refresh your shell profile by logging out from the shell and log back in.
hapi completion bash > /etc/bash_completion.d/hapimyapp completion bash > /usr/local/etc/bash_completion.d/hapiIf shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrcTo load completions for each session, execute once:
hapi completion zsh > "${fpath[1]}/_hapi"You will need to start a new shell for this setup to take effect.
hapi completion fish | sourceTo load completions for each session, execute once:
hapi completion fish > ~/.config/fish/completions/hapi.fishhapi completion powershell | Out-String | Invoke-ExpressionTo load completions for every new session, run:
hapi completion powershell > hapi.ps1and source this file from your PowerShell profile.