Amazon CodeWhisperer AI-Powered Coding Companion : Quick Guide

Amazon CodeWhisperer AI-Powered Coding Companion : Quick Guide

Amazon CodeWhisperer is an AI-powered coding companion that provides real-time code suggestions in your IDE based on natural language comments you write. As a software engineer, this tool can help you speed up the development process, improve code quality, and save time on tasks that might otherwise be time-consuming.

Table of Contents

  1. Supported Languages and IDEs
  2. Licensing Options
  3. Getting Started with AWS Builder ID
  4. Setting Up SSO for Enterprise Usage
  5. Installation and Configuration
  6. Usage Example

Supported Languages and IDEs

CodeWhisperer supports a wide range of programming languages, including:

  • Python
  • Java
  • JavaScript
  • TypeScript
  • C#
  • Go
  • Rust
  • PHP
  • Ruby
  • Kotlin
  • C
  • C++
  • Shell scripting
  • SQL
  • Scala

It is available for various IDEs, such as:

  • Visual Studio Code
  • JetBrains family of IDEs (IntelliJ, PyCharm, GoLand, CLion, PhpStorm, RubyMine, Rider, WebStorm, and DataGrip)
  • AWS Cloud9
  • AWS Lambda console
  • JupyterLab
  • Amazon SageMaker Studio

Licensing Options

There are two licensing options for CodeWhisperer:

  1. Individual (free): Use CodeWhisperer for free by creating and signing in with an AWS Builder ID.
  2. Professional ($19 per user, per month): Provides administrators the ability to enable CodeWhisperer for their organization with single sign-on (SSO) authentication, integrate with existing workforce identity solutions, and configure organization-wide settings.

Getting Started with AWS Builder ID

To use CodeWhisperer Individual, you'll need to sign up for an AWS Builder ID. The sign-up process only takes a few minutes and does not require a credit card or an AWS account. Follow these steps:

  1. Visit the?AWS Builder ID sign-up page?.
  2. Fill in the required information and complete the sign-up process.
  3. Once you have your AWS Builder ID, you can use it to authenticate and access CodeWhisperer.

Setting Up SSO for Enterprise Usage

For CodeWhisperer Professional, administrators must set up SSO through AWS IAM Identity Center (previously known as AWS Single Sign-On). Follow these steps:

  1. Sign in to the?AWS Management Console?.
  2. Navigate to the IAM Identity Center.
  3. Set up SSO authentication for your organization if it's not already enabled.
  4. Enable CodeWhisperer and assign access to users and groups in your organization.

For more detailed instructions, refer to the?official documentation?.

Installation and Configuration

To start using CodeWhisperer, you'll need to install the AWS Toolkit for Visual Studio Code or the appropriate plugin for your IDE. Follow these steps for Visual Studio Code:

  1. Update Visual Studio Code to the latest version.
  2. Install the?AWS Toolkit for Visual Studio Code?.
  3. Configure the toolkit with your AWS Builder ID or IAM Identity Center credentials.

For other IDEs, refer to the respective documentation for installing and configuring the appropriate plugin.

Usage Example

Here's a concrete example of how CodeWhisperer can help you write code more efficiently:

For Code Development:

  1. In your IDE, write a comment in natural language describing the task you want to accomplish, e.g.,?# Sort a list of numbers in descending order.
  2. CodeWhisperer will analyze your comment and provide one or more code snippets that can accomplish the task.
  3. Review the suggested code snippets and choose the one that best fits your needs.
  4. You can quickly and easily accept the top suggestion (tab key), view more suggestions (arrow keys), or continue writing your own code.
  5. Edit the code snippet if necessary to ensure it does exactly what you intended.

For Unit Test:

  1. In your IDE, write a comment in natural language describing the unit test task you want to accomplish, e.g.,?# Unit tests for example_function(param1, param2) by using Pytest and Moto.
  2. Follow the above steps described in code development.

Remember to always review the code suggestions provided by CodeWhisperer and make any necessary edits to ensure the code meets your requirements. As a software engineer, it's crucial to maintain a strong understanding of the code you're working with and ensure it's of high quality.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了