completion
Generate shell completion scripts
completion
Generate shell completion scripts for Arctic CLI.
Synopsis
arctic completion <shell>Arguments
| Argument | Description |
|---|---|
shell | Shell type: bash, zsh, or fish |
Supported Shells
Bash
# Add to ~/.bashrc
source <(arctic completion bash)
# Or save to completions directory
arctic completion bash > /etc/bash_completion.d/arcticZsh
# Add to ~/.zshrc
source <(arctic completion zsh)
# Or for Oh My Zsh, save to completions directory
arctic completion zsh > ~/.oh-my-zsh/completions/_arcticFish
# Save to Fish completions directory
arctic completion fish > ~/.config/fish/completions/arctic.fishFeatures
Shell completion provides:
- Command completion: Type
arctic pe<TAB>to complete topeers - Subcommand completion: Type
arctic peers l<TAB>to complete tolist - Flag completion: Type
arctic peers list --<TAB>to see available flags - Value completion: Peer IDs, service IDs, and other values are completed from cache
Completion Cache
For faster completions, Arctic uses a local cache for peer and service IDs. Without the cache, completions fall back to config file data only.
To populate the cache:
arctic cache refreshThe cache is stored at ~/.cache/arctic/completion.json (or $XDG_CACHE_HOME/arctic/completion.json) and expires after 1 hour by default. See Completion Cache for details.
Example Session
$ arctic <TAB>
bootstrap cache cluster completion config
credentials health license peers routes
services
$ arctic peers <TAB>
add delete get list remove-self update
$ arctic peers list --<TAB>
--local --remote --client-id --client-secret
--config --context --debug --insecure
--json --no-headers --output --quiet
--timeout --token --url --yes
-c -j -o -q -yErrors
| Error | Description |
|---|---|
shell type required | Missing shell argument |
unsupported shell | Shell not bash, zsh, or fish |
See Also
- CLI Overview - CLI introduction
- Global Flags - Available flags
- cache - Manage completion cache
- Completion Cache - How the cache works