The command and resource completion is built into oc client. You can generate it for bash and zsh.
Generate completion file
Invoke the following command to generate completion file:
source <(oc completion bash)
source <(oc completion zsh)
Or permanently store it in a file and source it from .bashrc
oc completion bash > oc_completion.sh
# In .bashrc
The commands were executed using minishift and the following client/server versions of OpenShift.
Thanks for reading the OpenShift morsels. To get updates about new articles, you can sign up to the newsletter below.
As a thank you message, you will also get access to OpenShift CLI CheatSheet listing most commonly used commands together with a short explanation.