Created
October 5, 2023 14:49
-
-
Save chadmcrowell/b2043494ca2e9859bfc6f16658c12a20 to your computer and use it in GitHub Desktop.
bash autocomplete for kubectl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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