Code Whisperer for the Command Line
The lead-up to re:Invent is always filled with new releases for products, services, and enhancements. This year is no different. This year one of the announcements that jumped out at me was the launch of Code Whisperer for the Mac command line.
Code Whisperer
For those who are not familiar, Code Whisperr is a GenAI service focused on helping developer productivity. Until now, Code Whisperer has been delivered as a plug-in for IDE's like Visual Studio Code and the Jetbrains suite of IDE's. Code Whisperer looks at what you are currently doing, and provides suggestions that you can use to improve your productivity.
Code Whisperer is a useful tool for writing code, however developers need to use other tools than just their IDE when it comes to being productive, many of these are command line tools. I love command line tools... unfortunately my memory for remembering commands, sub command, switches and the like hasnever been very good. Every time I need to undo local changes in Git I have to hit Google... and half the time I end up just deleting the local repo and doing a fresh pull.
Now Code Whisperer can help with the command line!
Instalation
You can download Code Whisperer for the mac command line from here. A single download installs into the default Mac shell, as well as things like the VSCode shell built into the IDE.
Once installed Code Whisperer helps you in two different ways.
Terminal Auto-Complete
Terminal Auto-Complete helps you as you type suggesting what comes next. For example if I type "ls" Code Whisperer makes suggestions.
if I start typing "git" Code Whisperer starts suggesting the next parts of the command for me:
In all of these situations the Auto-Complete suggestions will automatically update as I type more of the command.
Alternatively I can use the up and down arroes to select the option that I want to pick form the list.
Natural Language Completion
We wouldn't be talking about Generative AI if we didn't look at natural language prompting. If you are like me you can probably describe what you want to do... but actually figuring out the command to achieve that outcome is a guess.
Ths is where Code Whisperer really shines. By invoking the Code Whisperer AI, I can provide a natural language description of what I want to achieve, and Code Whisperer will figure out the hard work for me.
From the command line, I can execute the command "CW AI" for Code Whisperer AI.
CW AI
From here, you can type in natural language the outcome you want to achieve and press Enter. Code Whisperer will then use your text to create a command line that that you can use to accomplish what you typed.
For example:
Code Whisperer generates a new command for me:
I can then use the up and down keys to decide if I want to execute the command as is, edit the command, or other options.
As with other uses of Code Whisperer, you must have an AWS Builder ID to use Code Whisperer. The AWS Builder ID is free to create. AWS Code Whisperer is free to use for individuals.
Summary
Code Whisperer is a tool to help make you, a developer, more productive by being your AI Assistant when it comes to cutting code. With this release, Code Whisperer also helps you at the command line as well as in your IDE.
Happy Coding!