EasyEngine auto-completion with zsh

Like many users, I discovered the joy of using the zsh shell when I began playing with a Live USB recovery distribution called GRML. GRML implemented zsh with some excellent customisation’s including syntax highlighting and lightning fast path completion, but the thing that really got me was its great command completion. I’m sure bash can do the same thing but having never experienced it, I was pretty blown away. GRML make their zsh configuration available to download, and it has become a standard for my server builds.

Recently, a colleague introduced me to EasyEngine, which I have been using to build out a few minimal web environments. One of the neat things EasyEngine provides is a completion script for bash to allow tab completion of the ‘ee’ command. The instructions are simple – to enable the completion run:

% source /etc/bash_completion.d/ee_auto.rc

However, running this on zsh caused a bit of an issue – specifically I was getting an error:

% /etc/bash_completion.d/ee_auto.rc:384: command not found: complete

Thankfully the Holy Google came through for me and I stumbled across this post discussing the same issue with a different program which suggested that zsh already has compatibility with bash completion built in – it just needs activated.

% autoload bashcompinit
% bashcompinit
% source /etc/bash_completion.d/ee_auto.rc

And Voila! Completion for the ee command in zsh!