Bartosz Bierkowski - Low dose cloud

OpenShift CLI morsels: enable oc shell completion

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:

Or permanently store it in a file and source it from .bashrc


The commands were executed using minishift and the following client/server versions of OpenShift.

oc v1.4.1+3f9807a
client kubernetes v1.4.0+776c994
openshift v1.4.1
server kubernetes v1.4.0+776c994


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.

Did you like the article?
Join the newsletter to receive notifications about new articles.
I respect your privacy.