How do I get the aws cli completion to work with zsh on ubuntu?

I think there might be a misprint in the docs.

The CLI section has the following:

zshsource bin/aws_zsh_completer.sh.

% source /usr/local/bin/aws_zsh_completer.sh

The file aws_zsh_completer.sh doesn't live in /usr/local/bin, but I found it in /usr/local/aws/bin I tried this instead:

% source /usr/local/aws/bin/aws_zsh_completer.sh

I didn't try tcsh but I was able to reproduce the same condition with the bash instructions.

I am using MacOS at the moment, and I haven't had a chance to check this out on my Linux box.


It seems that the actual location of the file varies from installation to installation, so it's better to find the exact location of the file in your system:

cd /                                                                                              
find -name "aws_zsh*" 
./usr/local/bin/aws_zsh_completer.sh

I found out its located here ~/.local/bin/aws_zsh_completer.sh

# add this to your ~/.zshrc 
# aws completion
source  ~/.local/bin/aws_zsh_completer.sh

Reload your terminal. --> Ubuntu 17.10