How to install and use Amazon CodeWhisperer on VS Code

Kevin Kiruri
3 min readDec 29, 2023

--

AI is coming up greatly and our buddies at AWS have not been left behind. We now have AWS CodeWhisperer. Let’s look at how to install it on VS Code, how to use it and establish whether it’s a worthwhile tool

Prerequisites

  1. Install Visual Studio Code (VS Code). You can get it here

Install the AWS Toolkit extension

  1. On VS Code, click on the extensions icon on the left hand panel

2. Search for AWS Toolkit on the search bar. Select the toolkit created by Amazon Web Services and click on Install

3. Once installed, the AWS Toolkit icon should appear on the left hand panel

Sign in with your AWS Builder ID or Sign up if you do not have one

  1. Click on the AWS Toolkit icon then click on Sign in to get started and select Use for free wih AWS Builder ID .

2. Open the link in your browser. You are asked to confirm the characters on your browser with the characters that appear on your VS Code screen. (Giving some Bluetooth connection vibes 😅). Click on Confirm and continue

3. Create an AWS Builder ID if you don’t have one. If you already do, you can proceed to Sign in

4. Once connected, your screen on VS Code will show that you are Connected to AWS Builder ID

Testing

Now that we have the power of AI, let’s test it out

We’ll let CodeWhisperer create a function that takes in a string and returns the number of vowels in the string. Let’s see how it does

  1. Open the file in the language you want to code in. We will be using a Python file (.py)
  2. Enter the command starting with // . In our case, we will enter //create a function that takes in a string and returns the number of vowels in the string
  3. Click on Alt+C (Option+C on Mac) to run CodeWhisperer. CodeWhisperer makes suggestions and you can accept them by hitting Tab
  4. Once done, comment the CodeWhisperer commands and run your code to test it

Verdict

There is no doubt that AI is here to help us make our work easier. Using this as a stepping stone, let’s build even more products in a faster and more efficient way. AWS CodeWhisperer is definitely a tool to use. Can’t wait to see AWSome products from it.

--

--