Skip to main content

Amazon CodeWhisperer for JupyterLab

Project description

Amazon CodeWhisperer for JupyterLab

Amazon CodeWhisperer is an AI coding companion which provides developers with real-time code suggestions in JupyterLab. Individual developers can use CodeWhisperer for free in JupyterLab and AWS SageMaker Studio.

Codewhisperer demo

Requirements

In order to use CodeWhisperer in JupyterLab, you must have a version of JupyterLab >= 3.5 installed. This extension does not yet support JupyterLab > 4.0. You will also need a free AWS Builder ID account to access CodeWhisperer. (You can set that up the first time you log in.)

In order to use CodeWhisperer in SageMaker Studio, you must have set up a SageMaker Studio notebook instance, along with an execution role with the appropriate IAM Permissions.

Getting Started

Jupyter Lab

You can install and enable the CodeWhisperer extension for JupyterLab with the following commands.

pip install amazon-codewhisperer-jupyterlab-ext
jupyter server extension enable amazon_codewhisperer_jupyterlab_ext

Once installed, choose Start CodeWhisperer from the CodeWhisperer panel at the bottom of the window. This will enable to you log in to AWS Builder ID to access CodeWhisperer. Refer to Setting up CodeWhisperer with JupyterLab for detailed setup instructions.

SageMaker Studio

To setup the CodeWhisperer extension with a SageMaker Studio notebook instance, you must add IAM Permissions for codewhisperer:GenerateRecommendations for your user profile. Then you must install and enable the extension with the following commands.

conda activate studio
pip install amazon-codewhisperer-jupyterlab-ext
jupyter server extension enable amazon_codewhisperer_jupyterlab_ext
conda deactivate
restart-jupyter-server

After you complete installation and refresh your browser, a CodeWhisperer panel will appear at the bottom of the window. Refer to Setting up CodeWhisperer with SageMaker Studio for detailed setup instructions.

Features

Code Completion

CodeWhisperer for JupyterLab provides AI powered suggestions as ghost text with the following default keybindings. These can be modified in the settings.

Action Key Binding
Manually trigger CodeWhisperer Alt C (Window) / ⌥ C (Mac)
Accept a recommendation Tab
Next recommendation Right arrow
Previous recommendation Left arrow
Reject a recommendation ESC

Python is the only supported programming language for now. Users can start or pause suggestions by toggling the menu item in the CodeWhisperer panel that will appear at the bottom of the window.

Code References

With the reference log, you can view references to code recommendations. You can also update and edit code recommendations suggested by CodeWhisperer.

To view Code References for accepted suggestions, choose Open Code Reference Log from the CodeWhisperer panel at the bottom of the window. Users can also turn off code suggestions with code references in Settings.

More Resources

Change Log

1.0.4

  • Add Glue Studio Notebook support

1.0.3

  • Bug fix: No recommendation when user turn off code suggestions with references in settings.
  • Bug fix: Issue with browser login flow for some Builder ID users.
  • Bug fix: Fix an issue where SageMaker Studio users will incorrectly see the Share content with Amazon CodeWhisperer settings option.

1.0.0

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amazon-codewhisperer-jupyterlab-ext-1.0.4.tar.gz (174.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page