Shell completion makes AWS CLI sessions faster to drive and less error-prone when exploring unfamiliar services, operations, and flags. Pressing Tab against a partial aws command exposes valid choices immediately instead of relying on repeated help lookups or trial-and-error typing.
The feature is powered by the aws_completer program that ships with AWS CLI. The shell loads that helper through a completion rule in the appropriate startup file, so bash, zsh, or tcsh can ask aws_completer for matching service names, operations, and options as commands are typed. In AWS CLI v2, the completer can also suggest some resource values when the active profile and region allow it.
These steps target Linux and macOS shells. The completer path varies by installation method, Amazon Linux on EC2 often enables completion already, and PowerShell on Windows uses a separate profile-based registration method, so the safest workflow is to confirm the installed completer path first and update only the startup file for the shell that actually runs aws.
Related: How to configure AWS CLI on Linux and macOS
Related: How to check AWS CLI version
$ which aws_completer /opt/homebrew/bin/aws_completer
If no path is returned, locate the binary with find / -name aws_completer 2>/dev/null. Add that folder to PATH or use the absolute path it returns in the completion commands below before continuing.
Related: How to install AWS CLI on Ubuntu
Related: How to install AWS CLI on CentOS or Red Hat
Related: Install AWS CLI version 1 using pip
$ echo $SHELL /bin/zsh
Use ~/.bashrc for bash, ~/.zshrc for zsh, and ~/.tcshrc for tcsh. If echo $SHELL shows the login shell rather than the current one, confirm the active shell with ps -p $$ -o comm=.
$ cat >> ~/.bashrc <<'EOF' complete -C '/opt/homebrew/bin/aws_completer' aws EOF
Keep the absolute path returned by which aws_completer if it differs from /opt/homebrew/bin/aws_completer. Login-shell setups should also ensure that ~/.bash_profile or ~/.profile sources ~/.bashrc.
$ cat >> ~/.zshrc <<'EOF' autoload bashcompinit && bashcompinit autoload -Uz compinit && compinit complete -C '/opt/homebrew/bin/aws_completer' aws EOF
The bashcompinit loader is required because AWS CLI ships bash-compatible completion logic. Keep the existing compinit setup if ~/.zshrc already initializes completion elsewhere.
$ cat >> ~/.tcshrc <<'EOF' complete aws 'p/*/`aws_completer`/' EOF
If the completer is not already in PATH for tcsh, replace aws_completer inside the backticks with the absolute path found in the first step.
$ source ~/.bashrc $ source ~/.zshrc $ source ~/.tcshrc
Run only the command that matches the file that was changed. Opening a fresh terminal window avoids sourcing an unrelated shell profile by mistake.
$ aws sts g<Tab> get-access-key-info get-caller-identity get-delegated-access-token get-federation-token get-session-token get-web-identity-token
If no suggestions appear, check the startup file for typos and confirm that the completion rule still points to the installed aws_completer path. On AWS CLI v2, completion can also suggest some resource values after flags such as --table-name when the active profile can query them.
Related: How to check AWS CLI version