Skip to content

Instantly share code, notes, and snippets.

@shihxuancheng
Created May 17, 2025 14:30
Show Gist options
  • Save shihxuancheng/da685eff160312b6670ae26d4cb21770 to your computer and use it in GitHub Desktop.
Save shihxuancheng/da685eff160312b6670ae26d4cb21770 to your computer and use it in GitHub Desktop.
kubectl-auto-completion
source <(kubectl completion bash) # set up autocomplete in bash into the current shell, bash-completion package should be installed first.
echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
alias k=kubectl
complete -o default -F __start_kubectl k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment