Skip to content

Instantly share code, notes, and snippets.

@chadmcrowell
Created October 5, 2023 14:49
Show Gist options
  • Save chadmcrowell/b2043494ca2e9859bfc6f16658c12a20 to your computer and use it in GitHub Desktop.
Save chadmcrowell/b2043494ca2e9859bfc6f16658c12a20 to your computer and use it in GitHub Desktop.
bash autocomplete for kubectl
#!/bin/bash
apt update && apt install -y bash-completion
echo 'source <(kubectl completion bash)' >> ~/.bashrc
echo 'source /usr/share/bash-completion/bash_completion' >> ~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -o default -F __start_kubectl k' >> ~/.bashrc
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment