Quick Tip: AWS CLI Command Autocompletion

Posted by on August 22, 2016 · 1 min read

The AWS CLI is extremely powerful and can enable access to AWS services and data for scripting and other purposes. Personally, remembering the breadth of commands available is a challenge, but I learned today that autocomplete is available.

The following describes how to setup autocompletion for a system using bash and installed via pip, yum, or Homebrew.

Locate the auto completer package:

$ which aws_completerEnable command autocompletion (assumes default path to aws_completer):

$ complete -C ‘/usr/local/bin/aws_completer’ awsTest command completion:

$ aws e*TAB
*ec2 efs elastictranscoder esecr elasticache elb eventsecs elasticbeanstalk emrTo enable auto completion in the future, add it to the bash user’s profile (assuming default path):

$ cat » ~/.bash_profile
complete -C ‘/usr/local/bin/aws_completer’ aws
export PATH=/usr/local/aws/bin:$PATH
CTRL+DFurther detail can be found in AWS Documentation, including details on other types of shells and where else you may find the aws_completer package.