Skip to content

Instantly share code, notes, and snippets.

@max-arnold
Last active January 11, 2022 22:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max-arnold/cf4e80347d24fdb3b38aa993d0f09172 to your computer and use it in GitHub Desktop.
Save max-arnold/cf4e80347d24fdb3b38aa993d0f09172 to your computer and use it in GitHub Desktop.
SaltStack Zsh and Bash completion

Zsh

mkdir -p ~/.zsh/completions
wget -q https://raw.githubusercontent.com/saltstack/salt/master/pkg/salt.zsh -O ~/.zsh/completions/_salt
sed -i'' -e 's/python2/python/' ~/.zsh/completions/_salt
# ~/.zshrc
fpath=(~/.zsh/completions $fpath)
plugins=(zsh-completions)
autoload -U compinit && compinit
zstyle ':completion:*:salt(|-cp|-call|-run|-key):*' use-cache true

Bash

apt install bash-completion
ln -s /usr/share/bash-completion/completions/salt-common /etc/bash_completion.d/salt
source /etc/bash_completion

See https://twitter.com/SaltTips/status/1480793784900370432 for more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment