DEV Community

Davide de Paolis for AWS Community Builders

Posted on

Enable AWS CLI Completer for increased productivity

Days ago I was scrolling LinkedIn and noticed a video post from AWS Hero Andrew Brown.

Andrew Brown - AWS CLI Prompt

A prompt/autocomplete for AWS CLI Prompt?!? Cool!

Is that available only within Cloud Shell he's using in the video?
As Andrew already mentions in the comments, you can use it everywhere you have AWS CLI, therefore I immediately tried it out, and it was mind-blowing.

Just type:

export AWS_CLI_AUTO_PROMPT=on-partial
Enter fullscreen mode Exit fullscreen mode

in your terminal and everything you type next will be autocompleted ( or if there are more matches, the available matches will be prompted).

The cool thing is not that it autocompletes the available services - sure you can save some keystrokes if when typing aws dy you can get it autocompleted to aws dynamodb but that would not be so helpful.

No, it will prompt you all the available commands for that resource!

AWS CLI Prompt command

and most importantly, its parameters!

AWS CLI Prompt parameters

That is really cool, but... do I have to export that variable every time I launch a terminal window? of course not:

Basically, Open your shell of choice ( I use .zsh ) export the Completer path (not just the Prompt variable), reload it and tadaa!

PATH=/usr/local/bin/aws_completer:$PATH
Enter fullscreen mode Exit fullscreen mode

Check the docs to find out how to set it up for your shell (bash, zsh and so on)

Top comments (5)

Collapse
 
loige profile image
Luciano Mammino

You can now also do:

aws --cli-auto-prompt
Enter fullscreen mode Exit fullscreen mode

And you'll be entiring an AWS repl that has nice autocomplete (and more)

Collapse
 
dvddpl profile image
Davide de Paolis

cool! will check that out!

Collapse
 
elbik profile image
Sergii

Wow!!! Thank you for sharing!

Collapse
 
lockhead profile image
Johannes Koch

Wow, I wasnt aware.
Thats really cool.

Does anyone from AWS know when this will be the standard? ;)

Collapse
 
dvddpl profile image
Davide de Paolis

dunno. this was also was surprised me. why isn't that the default setting?