v2 is not shipping aws_zsh_completer.sh
like v1 did.
Doc is not up-to-date https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html
zsh completion is important because zsh is the default shell on Mac OS 15 (Catalina)
FWIW: I had the same issue and used the same completion instructions as for bash, i.e. I added the following lines to my ~/.zshrc
file:
complete -C '/usr/local/aws/bin/aws_completer' aws
I have not done any exhaustive tests yet, but it looks promising so far...
% complete -C '/usr/local/aws/bin/aws_completer' aws
zsh: command not found: complete
hi @sebsto ,
What are the outputs you get on these?
which aws_completer
-or-
find / -name aws_completer
--this one might take a bit longer.
@sebsto I don't recall installing complete
specifically. I guess that it was installed as part of oh-my-zsh that I use.
duplicate of https://github.com/aws/aws-cli/issues/4656, see for more information
@matsev that is correct the function
complete is part of oh-my-zsh
which complete
complete () {
emulate -L zsh
local args void cmd print remove
args=("$@")
zparseopts -D -a void o: A: G: W: C: F: P: S: X: a b c d e f g j k u v p=print r=remove
if [[ -n $print ]]
then
printf 'complete %2$s %1$s\n' "${(@kv)_comps[(R)_bash*]#* }"
elif [[ -n $remove ]]
then
for cmd
do
unset "_comps[$cmd]"
done
else
compdef _bash_complete\ ${(j. .)${(q)args[1,-1-$#]}} "$@"
fi
}
@KaibaLopez
~ % which aws_completer
/usr/local/bin/aws_completer
Problem does not lie in aws_completer
. Looking at the above comments, it looks like that stock zsh has no "complete()" function. It is added by oh-my-zsh.
AWS doc should add installation instruction for Oh My ZSH or provide an alternative install path for "raw" zsh.
hmm...
Yea regardless of the solution the fact remains that the documentation is outdated if the aws_zsh_completer.sh file is not there.
Thanks for pointing it out!