6

I installed aws console cli following the instructions here:

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html#install-bundle-other-os

I want to get completion working with zsh. The instructions say to source bin/aws_zsh_completer.sh, which I don't see in the downloaded uncompressed zip installer.

I went ahead and cloned the git repo locally.

Still, sourcing the file doesn't work out of the box. When I attempt to autocomplete, I get python errors complaining about missing modules etc. (e.g., ImportError: No module named awscli.completer)

What am I missing here?

  • 1
    I think I managed to get it working but things may have changed in 6 months. I was able to find the .sh file included in the package and sourcing it seemed to work. Maybe time to give it another look. :) – Ian Oct 14 '14 at 15:13
5

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.

| improve this answer | |
  • On newer versions of ubuntu aws can be installed via snap. snap isolates your environment from its packages in /snap, so the completion extension is to be found here /snap/aws-cli/current/bin/aws_zsh_completer.sh. – Att Righ Jan 21 at 15:23
3

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
| improve this answer | |
2

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

| improve this answer | |
1

On Ubuntu 17.10 with the awscli package installed:

source /usr/share/zsh/vendor-completions/_awscli
| improve this answer | |
0

Does including aws in plugins section of ~/.zshrc helps?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.