Steven Danna has written the best
knife bash completion script that I’ve seen for use with managing chef servers and the chef software by opscode.
Update: Steven has now made an update so this is working!
There was always one little thing wrong with it though:
knife environment edit (etc) would not autocomplete – it would give an error
The error was:
-bash: _chef_environments: command not found
The solution is pretty simple – you just need to edit the script and transpose two letters that were a typo from the knife_completion.sh file:
should actually be:
The difference is hard to spot but it’s key.
If you use
zsh instead of
bash there is also a zsh knife plugin which is part of
oh-my-zsh that seems pretty good.