Shell Completion
vigocli supports tab completion for commands, subcommands, flags, and dynamic arguments (hostnames, run IDs, configcrate names). Completions are generated by Cobra and work with bash, zsh, fish, and PowerShell.
Setup
Bash
Add to ~/.bashrc:
eval "$(vigocli completion bash)"
Zsh
Add to ~/.zshrc:
eval "$(vigocli completion zsh)"
Restart your shell or source the file for changes to take effect.
What Completes
Static completions (no server required)
- All commands and subcommands:
vigocli env<TAB>completes tovigocli envoys - All flags:
vigocli envoys list --<TAB>shows--all,--server vigocli config edit <TAB>lists configcrate names from/srv/vigo/stacks/configcrates/
Dynamic completions (queries the server)
These completions make an API call to the Vigo server to fetch live data:
| Command | Completes |
|---|---|
vigocli envoys show <TAB> |
Enrolled hostnames and UUIDs |
vigocli envoys traits <TAB> |
Enrolled hostnames |
vigocli envoys push <TAB> |
Enrolled hostnames and UUIDs |
vigocli envoys revoke <TAB> |
Enrolled hostnames and UUIDs |
vigocli envoys delete <TAB> |
Enrolled hostnames and UUIDs |
vigocli envoys tag <TAB> |
Enrolled hostnames and UUIDs |
vigocli envoys untag <TAB> |
Enrolled hostnames and UUIDs |
vigocli envoys maintenance <TAB> |
Enrolled hostnames and UUIDs |
vigocli envoys revert <TAB> |
Enrolled hostnames and UUIDs |
vigocli config trace <TAB> |
Enrolled hostnames |
vigocli runs show <TAB> |
Recent run IDs |
Dynamic completions require the Vigo server to be reachable. If the server is down, tab completion falls back to the default shell behavior (filename completion).
Generating the Script
To inspect the generated completion script without installing it:
vigocli completion bash # bash script
vigocli completion zsh # zsh script