DEV Community

Cover image for AWS CLI - Command Completion
Unni P
Unni P

Posted on • Originally published at iamunnip.hashnode.dev

AWS CLI - Command Completion

In this article we will look how we can enable command completion for AWS CLI.

Prerequisites

Install AWS CLI on the Ubuntu distribution.

$ aws --version
aws-cli/2.13.32 Python/3.11.6 Linux/6.2.0-1012-aws exe/x86_64.ubuntu.22 prompt/off
Enter fullscreen mode Exit fullscreen mode

Check out my article on installing AWS CLI.

Configuration

Verify the path of aws_completer in our system.

$ which aws_completer
/usr/local/bin/aws_completer
Enter fullscreen mode Exit fullscreen mode

Verify the shell of our system.

$ echo $SHELL
/bin/bash
Enter fullscreen mode Exit fullscreen mode

Add the location of aws_completer in the PATH.

$ vi ~/.bash_profile
    export PATH=/usr/local/bin/:$PATH
Enter fullscreen mode Exit fullscreen mode

Enable the command completion by adding the below entry in .bashrc file.

$ vim .bashrc
    complete -C '/usr/local/bin/aws_completer' aws
Enter fullscreen mode Exit fullscreen mode

Reload the profile to take the new changes.

$ source ~/.bash_profile

$ source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Verify the command completion.

$ aws dynamodb d<TAB>
delete-backup                           describe-contributor-insights           describe-import                         describe-time-to-live
delete-item                             describe-endpoints                      describe-kinesis-streaming-destination  disable-kinesis-streaming-destination
delete-table                            describe-export                         describe-limits
describe-backup                         describe-global-table                   describe-table
describe-continuous-backups             describe-global-table-settings          describe-table-replica-auto-scaling
Enter fullscreen mode Exit fullscreen mode

Reference

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay