Once you have installed the AWS CLI, it has the feature to auto complete the commands for you at the press of a TaB key. I am using a MAC & the commands here are pertaining to the Mac OS & the zsh shell is used.
To enable this, execute the foll. commands
Check the location of aws_completer
which aws_completerCheck the shell using command echo $SHELL
/bin/zshFind the profile script of shell
ls -a ~/
In my case its the zsh & this shell does not have a profile script .zshrc created by default even if you are using the shell
Create the file using command:
Touch ~/.zshrcAdd the path of the aws_completer to this:
PATH="/usr/local/bin/aws_completer:${PATH}"
export PATH
Add the below command to the .zshrc file so that the command completion works every time you open the shell
autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
To enable command completion run the below command
complete -C '/usr/local/bin/aws_completer' awsExecute the command below to reproduce the above changes in current shell
source ~/.zshrc
Verify the command completion using the
aws i(TAB key press)
For other OS's , please refer to the below documentation by AWS
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html
Top comments (0)