On Unix-like systems, the AWS CLI includes a command-completion feature that enables you to use the TAB key to complete a partially typed command. This feature is not automatically installed so you need to configure it manually.
Configuring command completion requires two pieces of information: the name of the shell you are using and the location of the aws_completer script.
Completion on Amazon Linux
Command completion is configured by default on instances running Amazon Linux.
Identify Your Shell
If you are not sure which shell you are using, identify it with one of the following commands:
echo $SHELL – show the shell's installation directory. This will usually match the in-use shell, unless you launched a different shell after logging in.
ps – show the processes running for the current user. The shell will be one of them.
psPID TTY TIME CMD 2148 pts/1 00:00:00 bash 8756 pts/1 00:00:00 ps
Locate the AWS Completer
The location can vary depending on the installation method used.
Package Manager – programs such as pip, yum, brew and
apt-get typically install the AWS completer (or a symlink to it) to a standard path location.
In this case,
which will locate the completer for you.
Bundled Installer – if you used the bundled installer per the instructions in the previous section, the AWS completer will be located in the bin subfolder of the installation directory.
ls /usr/local/aws/binactivate activate.csh activate.fish activate_this.py aws aws.cmd aws_completer ...
If all else fails, you can use
find to search your entire file system for
the AWS completer.
find / -name aws_completer/usr/local/aws/bin/aws_completer
Enable Command Completion
The command that you use to enable completion depends on the shell that you are using.
bash – use the built-in command
complete -C '
/usr/local/bin is the default installation directory when you
install the AWS CLI with pip. See Locate the AWS Completer if you are not sure where the AWS CLI
tcsh – complete for tcsh takes a word type and pattern to define the completion behavior.
complete aws 'p/*/`aws_completer`/'
zsh – source
The AWS CLI uses bash compatibility auto completion (
bashcompinit) for zsh
support. For further details, refer to the top of
If you installed the AWS CLI using the bundled installer, add the install location to your PATH variable to allow command completion to find it.
Test Command Completion
After enabling command completion, type in a partial command and press tab to see the available commands.
TABs3 ses sqs sts swf s3api sns storagegateway support
Finally, to ensure that completion continues to work after a reboot, add the configuration command that you used to enable command completion to your shell profile. If you added a directory to your PATH variable, put the export statement in your profile as well.
The following example appends the profile for a bash user who installed the AWS CLI to /usr/local/aws using the bundled installer:
cat >> ~/.bash_profile
complete -C '
/usr/local/aws/bin/aws_completer' aws export PATH=