DEV Community

Cover image for Use the Amazon Q Developer CLI on AWS Graviton
Jason Andrews for AWS Community Builders

Posted on • Originally published at learn.arm.com

2 1 1 1 1

Use the Amazon Q Developer CLI on AWS Graviton

Amazon Q Developer CLI is a command-line tool for Amazon Q, a generative AI-powered assistant. You can use it to ask questions about AWS architecture, resources, and general development tasks.

It supports multiple operating systems, including Arm-based Linux distributions, and runs on AWS Graviton processors.

What should I do before installing Amazon Q Developer CLI?

You need a Builder ID to use the Amazon Q Developer CLI. If you don't have one, visit Do more with AWS Builder ID and click Sign up with Builder ID to create your AWS Builder ID.

This guide explains how to install Amazon Q Developer CLI on macOS and Arm Linux distributions, such as Ubuntu and Amazon Linux 2023.

How do I download and install Amazon Q Developer CLI?

The CLI is invoked using the q command.

How do I install Amazon Q Developer CLI on macOS?

Install Homebrew if it's not already available on your computer.

Then install the Q CLI:

brew install amazon-q
Enter fullscreen mode Exit fullscreen mode

How do I install the Q CLI on Arm Linux?

The easiest way to install the Q CLI on any Arm Linux distribution is to download and run the installer.

Before starting, ensure that curl and unzip are available on your computer.

For Debian-based distributions such as Ubuntu, use the commands below. For other Linux distributions, use the appropriate package manager to install curl and unzip.

sudo apt update
sudo apt install curl unzip -y
Enter fullscreen mode Exit fullscreen mode

Download the zip file with curl:

curl --proto '=https' --tlsv1.2 -sSf "https://desktop-release.codewhisperer.us-east-1.amazonaws.com/latest/q-aarch64-linux.zip" -o "q.zip"
Enter fullscreen mode Exit fullscreen mode

Extract the installer and run it:

unzip q.zip
bash ./q/install.sh
Enter fullscreen mode Exit fullscreen mode

You'll then be prompted about updating your shell config:

✔ Do you want q to modify your shell config (you will have to manually do this otherwise)? 
Enter fullscreen mode Exit fullscreen mode

To automate the install, add the --no-confirm flag to the install.sh command.

If you're using a Linux distribution with an older version of the GNU C Library - or one that does not use it at all, such as Alpine - you can download an alternative package built with the musl C library and has no external dependencies.

Substitute the curl command above with this one and use the same install instructions:

curl "https://desktop-release.codewhisperer.us-east-1.amazonaws.com/latest/q-aarch64-linux-musl.zip" -o "q.zip"
Enter fullscreen mode Exit fullscreen mode

How do I confirm the Q CLI is working?

You now have the latest version of the Amazon Q Developer CLI installed.

Confirm the CLI is available by invoking the q command to print the version.

q version
Enter fullscreen mode Exit fullscreen mode

The version is printed:

q 1.7.2
Enter fullscreen mode Exit fullscreen mode

How can I configure my AWS account to get the most from the Q CLI?

The Q CLI can answer questions and solve problems related to your AWS resources and help you develop faster on AWS. To get the maximum benefit, you can configure the AWS CLI to use your account.

Follow the AWS CLI Install Guide and the AWS Credentials Install Guide to set up the AWS CLI and generate and configure access keys.

This allows you to use the Amazon Q Developer CLI to ask questions and solve issues specific to your AWS account.

What is an example of using the Q CLI?

You can use q chat to find information about your AWS resources.

q chat
Enter fullscreen mode Exit fullscreen mode

When the chat session starts you see:

Hi, I'm Amazon Q. Ask me anything.

Things to try
• Fix the build failures in this project.
• List my s3 buckets in us-west-2.
• Write unit tests for my application.
• Help me understand my git status

/acceptall    Toggles acceptance prompting for the session.
/profile      (Beta) Manage profiles for the chat session
/context      (Beta) Manage context files for a profile
/help         Show the help dialogue
/quit         Quit the application
Enter fullscreen mode Exit fullscreen mode

For example, you can ask for the IP address of an EC2 instance instead of going to the AWS console or looking up the AWS CLI command to get it.

An example is shown below:

Image description

How can I set the Q CLI context to tailor responses?

The Q CLI reads your context when you start it. If you provide more information about yourself, you will get tailored responses that match your development environment.

There are multiple options to store context.

Use the /context command to see the possible locations to store your context.

/context show
Enter fullscreen mode Exit fullscreen mode

The help information is printed.

current profile: default

global:
    .amazonq/rules/**/*.md
    README.md
    AmazonQ.md
Enter fullscreen mode Exit fullscreen mode

For example, you can create a new file to store your context.

mkdir -p ~/.amazonq/rules/context
echo "I am an Arm Linux developer. I prefer Ubuntu and other Debian based distributions. I don't use any x86 computers so please provide all information assuming I'm working on Arm Linux. Sometimes I use macOS and Windows on Arm, but please only provide information about these operating systems when I ask for it." > ~/.amazonq/rules/context/context.md
Enter fullscreen mode Exit fullscreen mode

When you invoke q chat you can confirm your context information was read by asking.

did you read my context information?
Enter fullscreen mode Exit fullscreen mode

The response confirms the context file was read:

Yes, I've read your context information. I understand that you're an Arm Linux developer who prefers 
Ubuntu and other Debian-based distributions. You don't use x86 computers, so I should provide 
information assuming you're working on Arm Linux. You sometimes use macOS and Windows on Arm, but I 
should only provide information about those operating systems when you specifically ask for it.

I'll keep this context in mind when answering your questions, focusing on Arm Linux-specific 
information and Debian-based distributions by default.
Enter fullscreen mode Exit fullscreen mode

Give it a try by asking questions such as how do I install the aws cli? and check that the answers match the provided context.

You're ready to use the Q CLI. For more AWS content, check out Arm Learning Paths.

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo 📊✨

Top comments (0)

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay