Setup CodeWhisperer in VS Code - Free AI Coding Assistant

Recently I started using a new AI coding tool by AWS called CodeWhisperer.

You may have stumbled upon GitHub Copilot, GitHub's "AI Pair Programming tool", and CodeWhisperer is AWS's entry into this AI code generation tool arena.

Copilot vs CodeWhisperer

Full transparency - I don't know!

I've yet to use either tool long enough to have a strong opinion in favor of either.

I might update this when I spend more time with both with a personal comparison.

Since I've been building with AWS CDK lately, I've found CodeWhisperer much more reliable than Copilot on AWS-based software, which shouldn't be surprising.

The only difference that helped me nudge over to try CodeWhisper is that it's FREE for personal use, unlike Copilot, which is still very affordable at $10 a month.

Prerequisites

You will need VS Code installed to follow this tutorial.

Install AWS Toolkit

Find and install the AWS Toolkit extension in VS Code.

AWS Toolkit in VS Code

Setup CodeWhisperer

Once installed, open the tool in the sidebar, and under "Developer tools", under "CodeWhisperer", select "Start".

Showing the AWS Toolkit tab

The next step is to choose the personal account option by selecting "Use a personal email to sign up and sign in with AWS Builder ID".

Showing the menu after selecting start on the AWS Toolkit

Once selected, this should open a prompt.

At the prompt "Copy Code for AWS Builder ID", and choose "Copy Code and Proceed".

At the prompt "Do you want Code to open the external website?" choose "Open".

A browser tab will open, displaying the Authorize request window.

The required code should be in your clipboard from the last steps. Paste it and choose Next. If it's not on your clipboard, you should see the code in an open extension in VS Code.

Now a page will open where you can "Create AWS Builder ID" (or sign in if you, for some reason, already have an account).

Codebuilder sign-in or sign-up page

Since I assume you do not have an account, follow the steps to create the account.

Once your account is created and signed in, a tab will open with a message asking you to "Allow AWS Toolkit for VSCode to access your data". Choose "Allow".

Allow Toolkit to access your data screen

Finally, head back to VSCode and you can start using CodeWhisperer!

Note

If you have already used and authenticated with AWS tools using IAM, you will be asked if you want to use your new builder ID for all services. Choose whatever is suitable for your use case.

How to use it?

Once connected, you will start seeing suggestions for code once you pause during your code creation. For example, when I start typing a TypeScipt function called addTwoNumbers and stop for a second, it will suggest how to write it:

Example suggested output from CodeWhisperer

Then simply hit tab to accept the suggestion:

Example completed output from CodeWhisperer

That's it!

Hopefully it boosts your productivity, leaving you with more time for coffee... ☕️


Follow me on Twitter or connect on LinkedIn.

🚨 Want to make friends and learn from peers? You can join our free web developer community here. 🎉

VscodeAwsCodewhisperer
Avatar for Niall Maher

Written by Niall Maher

Founder of Codú - The web developer community! I've worked in nearly every corner of technology businesses; Lead Developer, Software Architect, Product Manager, CTO and now happily a Founder.

Loading

Fetching comments

Hey! 👋

Got something to say?

or to leave a comment.