Tillered Arctic

completion

Generate shell completion scripts

completion

Generate shell completion scripts for Arctic CLI.

Synopsis

arctic completion <shell>

Arguments

ArgumentDescription
shellShell 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/arctic

Zsh

# Add to ~/.zshrc
source <(arctic completion zsh)

# Or for Oh My Zsh, save to completions directory
arctic completion zsh > ~/.oh-my-zsh/completions/_arctic

Fish

# Save to Fish completions directory
arctic completion fish > ~/.config/fish/completions/arctic.fish

Features

Shell completion provides:

  • Command completion: Type arctic pe<TAB> to complete to peers
  • Subcommand completion: Type arctic peers l<TAB> to complete to list
  • 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 refresh

The 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              -y

Errors

ErrorDescription
shell type requiredMissing shell argument
unsupported shellShell not bash, zsh, or fish

See Also