This is not the latest version of Linkerd!
This documentation is for an older version of Linkerd. You may want the Linkerd 2.12 (current) documentation instead.

completion

Output shell completion code for the specified shell (bash, zsh or fish).

Examples

# bash <= 3.2:
source /dev/stdin <<< "$(linkerd completion bash)"

# bash >= 4.0:
source <(linkerd completion bash)

# bash <= 3.2 on osx:
brew install bash-completion # ensure you have bash-completion 1.3+
linkerd completion bash > $(brew --prefix)/etc/bash_completion.d/linkerd

# bash >= 4.0 on osx:
brew install bash-completion@2
linkerd completion bash > $(brew --prefix)/etc/bash_completion.d/linkerd

# zsh:
# If shell completion is not already enabled in your environment you will need
# to enable it.  You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

# To load completions for each session, execute once:
linkerd completion zsh > "${fpath[1]}/_linkerd"

# You will need to start a new shell for this setup to take effect.

# fish:
linkerd completion fish | source

# To load fish shell completions for each session, execute once:
linkerd completion fish > ~/.config/fish/completions/linkerd.fish