bash completion for Docker and kubernetes !

(oh my) zsh update, october 2019

Using oh my zsh ? Well then, things got even simpler, thanks to the integrated plugins!

Just make sure to have this in your ~/.zshrc file:

You can reload it using:

And make sure to not add any comments, coma (« , ») or anything else into this list; just indent each line properly.

Updated on June 20th 2019 with Helm, Kubernetes and Minikube !

When you interact a lot with command line tools, such as : docker , docker-machine and docker-compose, command line completion (using the tab key) is a must.

Let’s have a look at how to enable bash completion for those docker command line tools

Mac user ? install bash-completion

I suppose you already use brew on Mac to install additional packages; it’s time to install bash-completion :

Bash completion for docker, docker-machine and docker-compose

Run those 3 commands :

and add the following to the end of your ~/.bash_profile (or ~/.bash_rc if running Linux) :

Now source (if running Linux, source ~/.bash_rc)

And enjoy tab’ing :

References :