AWS Logo
Menu

The Ultimate Cheat Sheet for Using Amazon Q Developer in Your IDE

Get the most out of Amazon Q Developer in your IDE with this handy cheat sheet

Brooke Jamieson
Amazon Employee
Published Apr 30, 2024

Introduction

As a developer, having the right tools available in the right place at the right time can really boost your efficiency and workflow. Amazon Q Developer is a generative AI powered assistant that you can access in your IDE, and I’ve loved being able to crank out new features and iterate on my ideas.
After a few weeks working with it, I put together a cheat sheet of the commands I think are essential for anyone getting started — and I added in some example prompts to start leveraging too.

Quick Command Cheat Sheet

Once you’ve set up Amazon Q Developer in your IDE, you can enter these handy quick commands in the chat panel. Here are the key ones to know:

/clear

This command clears your current conversation by removing all previous text and stored content. Use it when you’re ready to start a new chat session.

/dev

Initiate a conversation about Amazon Q’s feature development capabilities. This command starts the process of creating an implementation plan for adding new features to your project.

/transform

Upgrade your code by using this command to start a conversation about transforming your codebase from one language version to another with Amazon Q’s code transformation capabilities.

/help

This one is what it sounds like - help! Get an overview of what Amazon Q can do, example questions, and available quick commands by entering /help in the chat.

Explain and Update Code Commands

Amazon Q doesn’t just answer questions, it can also directly explain and update your code within your IDE. Just highlight the section of code you need help with, and choose from these options:

Explain

Get a plain language explanation of your highlighted code.
Keyboard shortcut - Visual Studio for Mac: ⌥⌘E

Refactor

Have Amazon Q improve the readability, efficiency or other aspects of your code.
Keyboard shortcut - Visual Studio for Mac: ⌥⌘U

Fix

Debug issues within your highlighted code.
Keyboard shortcut - Visual Studio for Mac: ⌥⌘Y

Optimize

Enhance the performance of your code with optimizations suggested by Amazon Q.
Keyboard shortcut - Visual Studio for Mac: ⌥⌘A

Send to Prompt

Send your highlighted code to the chat panel, so you can ask specific follow-up questions about it.
Keyboard shortcut - Visual Studio for Mac: ⌥⌘Q

Example Prompts and Use Cases

Here’s some ideas and examples to help get you started with Amazon Q Developer’s capabilities within your IDE:
  1. “What AWS services should I use for a serverless application backend?”
  2. “Explain this React component” (Send component code to prompt)
  3. “/dev I want to add user authentication to my app”
  4. “How do I write unit tests for this Python function?“ (Send function code to prompt)
  5. “/transform my Java 8 project to Java 17“
  6. “Fix: Why is this code throwing an error?” (Send buggy code to prompt)
  7. “What are the best practices for data partitioning with Amazon DynamoDB?”
  8. “Refactor: Improve the readability of this code snippet” (Highlight code snippet)
  9. “Optimize: Enhance the performance of this query“ (Send query to prompt)
  10. “Generate boilerplate code for creating a new React Native app”

Conclusion

Amazon Q Developer is a powerful AI assistant that can streamline your development workflow and enhance your productivity within your IDE. With this cheat sheet, you now have a reference for leveraging Amazon Q’s key capabilities including quick commands, code explanation and improvements, and AWS guidance.
Integrate Amazon Q into your coding flow by firing off questions, sending code snippets for analysis and using unique features like code transformation. The more you engage with this AI pair programmer, the more you’ll benefit from it’s contextual understanding and assistance.
Note: Amazon Q Developer is now Generally Available! For the latest information on pricing and availability, please refer to the official Amazon Q pricing guide and news blog post.

About the Author: Brooke Jamieson is a Senior Developer Advocate at AWS. You can follow Brooke on LinkedIn, Twitter, Instagram & TikTok.
Read other articles from Brooke:

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

3 Comments