Skip to main content

expanso-cli completion

expanso-cli completion​

Generate shell completion scripts

Synopsis​

Generate shell completion scripts for expanso-cli commands.

After setup, press TAB to autocomplete resource IDs, names, and commands. Tab completion works for job names/IDs, node names/IDs, and other resources.

Bash:​

Create directory if it doesn't exist​

mkdir -p ~/.local/share/bash-completion/completions

Generate and save completion script​

expanso-cli completion bash > ~/.local/share/bash-completion/completions/expanso-cli

Reload your shell​

source ~/.bashrc

Zsh:​

Option 1 - System-wide (recommended, requires sudo):

Create directory if it doesn't exist​

sudo mkdir -p /usr/local/share/zsh/site-functions

Install completion​

expanso-cli completion zsh | sudo tee /usr/local/share/zsh/site-functions/_expanso-cli

Restart shell​

exec zsh

Option 2 - User-level (no sudo):

Create user completion directory​

mkdir -p ~/.zsh/completions

Generate completion file​

expanso-cli completion zsh > ~/.zsh/completions/_expanso-cli

Add to ~/.zshrc (only needed once):​

echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc echo 'autoload -Uz compinit && compinit' >> ~/.zshrc

Restart shell​

exec zsh

Fish:​

Create directory if it doesn't exist​

mkdir -p ~/.config/fish/completions

Generate completion file​

expanso-cli completion fish > ~/.config/fish/completions/expanso-cli.fish

Reload fish completions​

fish -c "source ~/.config/fish/completions/expanso-cli.fish"

Powershell:​

Add to your PowerShell profile:​

expanso-cli completion powershell | Out-String | Invoke-Expression

To make permanent, add to profile:​

expanso-cli completion powershell >> $PROFILE

Troubleshooting:​

If completions don't work:

  • Ensure you restarted your shell after installation
  • Verify you have an active profile connection (expanso-cli profile list)
  • Check that the completion file was created in the correct location
  • For zsh, verify the directory is in your $fpath: echo $fpath

Options​

-h, --help help for completion

Options inherited from parent commands​

--api-key string API key for authentication (e.g., exp_ak_...). Env: EXPANSO_CLI_AUTH_API_KEY (preferred; flag values show in ps output)
-e, --endpoint string API endpoint URL
-k, --insecure Skip TLS certificate verification
-p, --profile string Profile to use for configuration
--timeout string Request timeout duration
-v, --verbose Enable verbose logging

SEE ALSO​