KUBERNETES(1) kubernetes KUBERNETES(1) (NAME) kubectl-completion - (bash zsh fish powershell) (SYNOPSIS) kubectl completion [OPTIONS] (DESCRIPTION) (bash zsh fish powershell). (evaluate) kubectl . source .bash_profile . : macOS: https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#enable-shell-autocompletion linux: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#enable-shell-autocompletion windows: https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/#enable-shell-autocompletion zsh: [1] zsh zsh >= 5.2 . (OPTIONS INHERITED FROM PARENT COMMANDS) --as="" (impersonate) . (service account) namespace . --as-group=[] . --as-uid="" UID . --as-user-extra=[] . --cache-dir="/home/username/.kube/cache" --certificate-authority="" (certificate authority) --client-certificate="" TLS --client-key="" TLS --cluster="" kubeconfig --context="" kubeconfig --disable-compression=false true --insecure-skip-tls-verify=false true . HTTPS --kubeconfig="" kubeconfig CLI. --kuberc="" kuberc (preferences). export feature gate KUBECTL_KUBERC=false KUBERC=off . --match-server-version=false -n, --namespace="" namespace CLI --password="" (basic authentication) API --profile="none" . (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) --profile-output="profile.pprof" --request-timeout="0" . ( 1s 2m 3h). ( timeout). -s, --server="" Kubernetes API --tls-server-name="" . hostname --token="" Bearer API --user="" kubeconfig --username="" API --version=false --version --version=raw --version=vX.Y.Z... --warnings-as-errors=false (EXAMPLES) # bash macOS homebrew ## Bash 3.2 macOS brew install bash-completion ## 4.1 Bash brew install bash-completion@2 ## kubectl homebrew ## kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl # bash ## bash-completion 'bash-completion' ## . ## kubectl bash source <(kubectl completion bash) ## bash source .bash_profile kubectl completion bash > ~/.kube/completion.bash.inc printf " # kubectl shell completion source '$HOME/.kube/completion.bash.inc' " >> $HOME/.bash_profile source $HOME/.bash_profile # kubectl zsh[1] source <(kubectl completion zsh) # kubectl zsh[1] kubectl completion zsh > "${fpath[1]}/_kubectl" # kubectl fish[2] kubectl completion fish | source # : kubectl completion fish > ~/.config/fish/completions/kubectl.fish # kubectl powershell kubectl completion powershell | Out-String | Invoke-Expression # kubectl powershell ## profile kubectl completion powershell > "$HOME\.kube\completion.ps1" Add-Content $PROFILE ". '$HOME\.kube\completion.ps1'" ## profile Add-Content $PROFILE "if (Get-Command kubectl -ErrorAction SilentlyContinue) { kubectl completion powershell | Out-String | Invoke-Expression }" ## PROFILE$ kubectl completion powershell >> $PROFILE (SEE ALSO) kubectl(1) (HISTORY) Eric Paris (eparis at redhat dot com) kubernetes ! Eric Paris Jan 2015 KUBERNETES(1)