Skip to Content

kubectl auto-completion for MacOS (Bash v4+)

brew install [email protected]

Paste this into your ~/.bash_profile file:
if [ -f $(brew --prefix)/share/bash-completion/bash_completion ]; then
. $(brew --prefix)/share/bash-completion/bash_completion
fi

kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl

@vojtechvitek

Join in on the conversation with Vojtech Vitek when you subscribe to Vojtech's IT Blog.