Zsh
For zsh make sure these lines are present in your zsh config file (e.g ~/.zshrc or ~/.zprofile):
alias kubectl=kubecolorCompletions
Section titled “Completions”Completion can be easily borrowed from the kubectl command by adding this to your ~/.zshrc file:
# Make "kubecolor" borrow the same completion logic as "kubectl"compdef kubecolor=kubectlAs a prerequisite, you need kubectl completions installed.
This can be achieved by either of these steps:
-
If your
kubectlinstallation already came shipped with zsh completions (when you didapt install kubectl,dnf install kubectl, etc). Try outkubectlto see if the completions are already installed before you install it twice. -
or you add this to
~/.zshrc:~/.zshrc # This needs to be added before "compdef kubecolor=kubectl"source <(kubectl completion zsh) -
or you can executed this:
Terminal window kubectl completion zsh > "${fpath[1]}/_kubectl"