sshroute provides dynamic shell completion for all subcommands and flags. Host aliases are completed live from your config — no static list to maintain.
- Subcommand names (
connect,resolve,copy,remove,add, etc.) - Flags and their values
- Host aliases for
connect,remove,resolve, andcopy— pulled directly from the active config at completion time
Add to ~/.bashrc:
eval "$(sshroute completion bash)"Or generate once and source from a file (faster shell startup):
sshroute completion bash > ~/.local/share/bash-completion/completions/sshrouteIf you use the system bash-completion package, the file location may differ:
sshroute completion bash | sudo tee /etc/bash_completion.d/sshroute > /dev/nullReload your shell or run source ~/.bashrc.
Add to ~/.zshrc:
eval "$(sshroute completion zsh)"If you see command not found: compdef, enable completions first:
autoload -Uz compinit
compinit
eval "$(sshroute completion zsh)"Generate to a file for faster startup:
sshroute completion zsh > "${fpath[1]}/_sshroute"sshroute completion fish | sourceTo persist across sessions:
sshroute completion fish > ~/.config/fish/completions/sshroute.fishsshroute completion powershell | Out-String | Invoke-ExpressionAfter setting up completion, pressing Tab after a subcommand that accepts an alias should list your configured hosts:
$ sshroute connect <Tab>
amgul eagle edora ferret fossa genet nas01
$ sshroute resolve <Tab>
amgul eagle edora ferret fossa genet nas01
Completion is dynamic — adding or removing a host with sshroute add / sshroute remove is reflected immediately without regenerating anything.
If you use --config to point at a different config file, completion respects it:
SSHROUTE_CONFIG=~/work/sshroute.yaml sshroute connect <Tab>Aliases from ~/work/sshroute.yaml are listed instead of the default config.