Shell Completions#

InfraGuard provides tab completion for all commands, subcommands, and options.

Generate Completion Script#

infraguard completions bash   # Bash
infraguard completions zsh    # Zsh
infraguard completions fish   # Fish

If you omit the shell argument, the CLI auto-detects from the SHELL environment variable (defaults to bash).

Installation#

Bash#

# Current session
eval "$(infraguard completions bash)"

# Permanent
infraguard completions bash > ~/.local/share/bash-completion/completions/infraguard

Zsh#

# Current session
eval "$(infraguard completions zsh)"

# Permanent (add ~/.zfunc to fpath in .zshrc first)
infraguard completions zsh > ~/.zfunc/_infraguard

Make sure your .zshrc includes:

fpath=(~/.zfunc $fpath)
autoload -Uz compinit && compinit

Fish#

infraguard completions fish > ~/.config/fish/completions/infraguard.fish

Fish picks up completion files from ~/.config/fish/completions/ automatically.

What Gets Completed#

  • Top-level commands: run, dashboard, config, token, api, profile, deploy, rotate, completions
  • Subcommands: config show, config set, config domain add, deploy run, deploy destroy, etc.
  • Options and flags: --config, --provider, --engine, --domain, --ssh-key, etc.
  • Choice values: --provider completes to do, aws, azure, hetzner, cloudflare; --engine completes to terraform, pulumi