Setting Up Amazon CodeWhisperer: Your GitHub Copilot Alternative in PhpStorm
Tags: webdev, codewhisperer, howto, php
Published: 2023-10-19 06:57:07

As a developer, the constant task of writing code can become tiresome. To alleviate this, having a personal assistant that aids in writing code more efficiently becomes essential. This is where AI-based coding tools like GitHub Copilot and Amazon CodeWhisperer come into play.

GitHub Copilot is an excellent tool, but it comes with a paid subscription. On the other hand, its alternative, Amazon CodeWhisperer, offers two tiers: "Individual tier" and "Professional tier," with the "Individual tier" being free.

Today, we'll walk through the steps of installing the free version of Amazon CodeWhisperer in PhpStorm. Here are the steps:

### Step 1:
In PhpStorm, click on the top-left menu **PhpStorm**, and then select **Settings**.

![PhpStorm settings] (https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4l7sk73g2bagskdon6xq.png)

### Step 2:
Choose the **Marketplace** in the **Plugins** section.

![Plugins -> Marketplace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1uderkaoav6se4tm9noc.png)

### Step 3:
Search for **AWS Toolkit** and click **Install**.

![Search for Aws Toolkit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1q7tsi0vbe54j3d6uk0h.png)

After successful installation, restart the IDE when prompted.

![Restart IDE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4fxrtjy19gnezcku9da7.png)

### Step 4:
After restarting, click on the **AWS** icon in the top-left panel, navigate to **Developer Tools**, and double-click **Start**.

![Aws Developer Tools](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f521rplruma1ivb55vvf.png)

A window will appear; select the first option and click the **Connect** button.

![Connection Option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ky4qpcjg2kbbygt8ybib.png)

### Step 5:
In the window, a code will be displayed. Click on **Proceed to Browser**.

![Proceed to Browser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xmcfsuhw6rv7ipnc2l65.png)

A new window should open in a browser. Confirm that it's displaying the same code as shown in the previous window and then click **Confirm and Continue**.

![Confirm the code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n55jws83q0unb0fxprb.png)

You'll be prompted to create an AWS Builder Account.

![AWS Builder Account](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m9m0045w0srbw7eqdw34.png)

Follow the steps to create your account. Once the account is successfully created, you'll be asked to allow AWS Toolkit for JetBrains to access your data. Click **Allow**.

![Allow AWS Toolkit to access JetBrains data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jh1zfgqvm2cb4g7hufsf.png)

Upon success, you'll see the following message:

![Success message](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l715vvqu6vyhpf4rxg96.png)

### Step 6:
Back in **PhpStorm**, you'll see a message asking you to stay connected to CodeWhisperer. Click **Yes**.

![Stay connected to CodeWhisperer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdj2lgr4ewry2cb1teh2.png)

You can confirm CodeWhisperer status by clicking on the **AWS** icon, then **Developer Tools**, and you should see the following message:

![CodeWhisperer status](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwt7cezpt2cl6wes0bjv.png)


References:
* [Setting up CodeWhisperer](https://docs.aws.amazon.com/codewhisperer/latest/userguide/setting-up.html)
* [Getting started with Amazon CodeWhisperer with IntelliJ](https://www.youtube.com/watch?v=Z3ZAJoi4x6Q)
* [Getting started with the AWS Toolkit for JetBrains](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/getting-started.html)