If you are reading this then there is a good chance your curiosity has been piqued by the excitement that Amazon Q Developer CLI has been generating online. Developers have been sharing how they have been using Amazon Q Developer CLI to create amazing automations, create new applications from scratch, vibe code fun games, and much more (check out the end of this post for a small selection of those). You don't need to have an AWS Account to be able to use Amazon Q Developer CLI, so everyone can join in the fun...yes everyone!
In this post I am going to talk more about what Amazon Q Developer CLI is, and then help you get started. Lets dive right in.
What is Amazon Q Developer CLI
How often to you use your terminal or shell? As a developer, I spend probably most of my time in the terminal when I am not writing code in my IDE. If you are not a developer, maybe you work as a sysadmin, or perhaps a devops engineer, you might spend all of your time in the terminal - writing scripts to automate stuff, running various tools to help with your job, and helping to fix things when they go wrong. The terminal is an essential part of our job, and so we need to make sure we are 'command line confident' as I like to say.
It's tough though, with so many tools we use to help with our activities, it is easy to sometimes forget command line parameters and options - especially when these are being updated to support newer versions. With generative AI increasingly being integrated and enabled in developer tooling, wouldn't it be great if we could have some of those capabilities to use in the command line.
Well the good news is that you can! All the goodness you have in the IDE with things like the Amazon Q Developer IDE plugin, you can now have at your fingertips in your terminal and on the command line. Amazon Q Developer CLI is an open source (dual licensed, Apache 2.0 and MIT) that you can download and install, and provides these capabilities:
- command auto complete - if you are a fan of how auto completion works in the IDE, Amazon Q Developer CLI supports hundreds of popular CLI tools (for example git, docker, aws) and brings that to the command line
- natural language to command translation - helps you convert your intent to the appropriate tools and arguments that you can then run in the command line - perfect for those situations where you might forget all the various command line parameters and options, but you know what you want to do
- natural language chat with agentic execution - lets you interact with your terminal using natural language (ask questions, debug issues, explore the codebase, etc) and then take action (generate code, edit files, automate Git workflows, resolve merge conflicts, and more) with your permission
Whats more, if English is not your first language then don't worry as you can interact with Amazon Q Developer CLI in lots of languages. My colleague Jeff Barr was even able to use it with Quechua, the indigenous language dating back to pre-Columbian times (read more here). I have tried it in Spanish, and my colleagues from across the world have tried it in their local languages and we all give it the thumbs up!
Ok so I hope this sounds good to you. Lets get started, by walking you through the installation steps and then showing you how to get started.
Installing
To use Amazon Q Developer CLI all you need is a supported operating system (MacOS, Linux, and Windows using the Windows Subsystem for Linux, wsl), a supported terminal (don't worry, unless you are using something very different it is likely you are using a supported terminal), and a supported shell (zsh, bash, and fish).
Minimal and Full installations - There are two types of installation: a minimal installation that installs the Amazon Q Developer CLI chat and autocomplete features, and then a full installation that additional installs the GUI configuration tool. Don't worry too much though, the key thing is that both installation types will help you get Amazon Q Developer CLI up and running in your environment.
The installation process installs the binaries for your platform, configures integration with the terminal (or shell), and then help you log in. I have put together a couple of guides to help with installation. First up is the Essential guide to installing Amazon Q Developer CLI on Linux for those of you who are using Linux, and then for Windows users I put together The essential guide to installing Amazon Q Developer CLI on Windows. For MacOS users, they have the simplest installation which you can find here, with a direct download or using brew to install it.
AWS Community Builder Ravindra Singh has also put together a Mac installation guide, Install and Use Amazon Q AI Assistant on Mac
Once installed, you will need to login. There are two types of account you can login with: Builder ID and Identity Centre accounts. To get started for free, we can use the Builder ID login. If you have not already used this, then it is super simple. Access the Builder ID page, and you can register for your free Builder ID alias using your email address. You don't need to have an AWS Account.
Here is a short video of what this looks like:
Once you have installed it, you are good to go and will now have a number of new commands available from within your terminal. Lets take a look at these and how you can get started.
Getting started
Now that you have Amazon Q Developer CLI installed, all we need to do to access it is open up a terminal. Your terminal will open up a shell, and as part of the installation, that shell will start qterm automatically. Lets walk through some things to get you up and running.
Command completions
The first thing we are going to look at is how command completion works. When you type in a command from the terminal, you will notice that there is now a helper that will provide suggestions as to what command options you want to use.
You can navigate using the up and down arrow keys for the various options, or you can keep typing and the options will change as you type. If you want those options to stop or go away, you can press ESC and it will cancel.
Check out this short video of this in action.
Translating commands
The next thing we are going to do is use Amazon Q Developer CLI to translate your intent to a specific command. Lets say for example we wanted to run a command but we could not remember all the parameters and command line options we needed. This happens to me all the time. So for example, lets say I wanted to find all the files in my local directory that contained the world "amazon-q".
From a terminal I can type:
q translate "find all the files in my current directory and all subdirectories that contain the word amazon-q but exclude hidden files and directories"
and after a short moment, this is what I will get
q translate "find all the files in my current directory and all subdirectories that contain the word amazon-q but exclude hidden files and directories"
Shell Β· find . -type f -name "*amazon-q*" -not -path "*/.*" -not -path "./.*"
β― β‘ Execute command
π Edit command
π Regenerate answer
β Ask another question
β Cancel
I can now use the arrow keys to select the option. The default option is to execute the command when pressing enter. I can also edit the command if I wanted, ask it to redo the answer if I think it has made a mistake, ignore this and ask a different question (at which point it will provide me with a prompt) or just cancel and exit this.
I use this capability a lot and its super handy when working with all the command line tools you use day in day out,
Chat
I have saved the best feature for last. You can use Amazon Q Developer CLI in chat mode, and engage in natural language conversations, ask questions, and receive responses from Amazon Q within your terminal environment.
But wait, it does more than just respond to your prompts. Amazon Q Developer CLI has full agentic capabilities, taking your prompts and then breaking these down into tasks which it will act upon. You will notice this as you start using it and see the word "Thinking..." appear. As it starts to work on the tasks you have given it, it will prompt you along the way as and when it needs more input, to confirm an operation it wants to do, or to keep you informed. Check at the end of this post for some good examples of some of the things that you can achieve.
Ok so lets take a look at how to use this. From the terminal simply type:
q chat
which will open up a new chat session:
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
>
You can also invoke a chat session with some text using the format:
q chat "Can you tell me which is the largest file in my directory"
Which will open up the chat session and start working immediately on the question you asked it.
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
> Can you tell me which is the largest file in my directory
I'll help you find the largest file in your current directory. Let me run a command to check that for you.
Execute shell command
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
I will run the following shell command:
find . -type f -maxdepth 1 -exec du -h {} \; | sort -hr | head -n 10
Enter y to run this tool, otherwise continue chatting.
It will wait for you to respond with "Y" to proceed, before completing the request.
Executing `find . -type f -maxdepth 1 -exec du -h {} \; | sort -hr | head -n 10`...
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
21M ./q-x86_64-linux-musl.zip
580K ./.zsh_history
120K ./.zcompdump-bcd074a65b1c-5.9.zwc
52K ./.zcompdump-bcd074a65b1c-5.9
52K ./.zcompdump
24K ./.DS_Store
20K ./.viminfo
12K ./.aider.chat.history.md
8.0K ./aws.prg-vice.log
8.0K ./.zshrc
π’ Completed in 0.207s
Based on the results, the largest file in your current directory (/Users/ricsue) is:
q-x86_64-linux-musl.zip at 21MB
The next largest files are:
β’ .zsh_history (580KB)
β’ .zcompdump-bcd074a65b1c-5.9.zwc (120KB)
β’ .zcompdump-bcd074a65b1c-5.9 (52KB)
β’ .zcompdump (52KB)
Asking for permission
When performing operations using the tools, Amazon Q generally prompts you to confirm that you want to allow it to perform those actions. Amazon Q doesnβt seek permission for the following readonly commands: ls, cat, echo, pwd, which, head, and tail. You can use "/acceptall" to automatically accept all the requests, but please use this with care and always supervise what is going on.
Available commands
You can use "/help" at any time to get a list of the commands available.
Context
As you work with tools like Amazon Q Developer CLI, it is important to understand how to configure context to provide more relevant and context-aware responses. The default is that Amazon Q for command line will integrate contextual information from your local development environment, i.e. the directory you are currently in.
Creating documents in markdown format is a good way to help steer the output. For example, I typically put together my own coding preferences in a doc within a directory called "spec" in the working directory I have, which provide additional context for Amazon Q Developer CLI. It will review those resources and factor that into the output created.
You can add specific files and resources within a "q chat" session to fine tune that context. If you us the "/context show" command, it will provide you with details of how it will use certain files to help with its suggestions.
> /context show
current profile: default
global:
.amazonq/rules/**/*.md
README.md
AmazonQ.md
profile:
<none>
>
You can add additional files you want to add to the context, which is super useful if you have a standard way of working and you want to define these in those markdown docs.
These files are located in your ~.aws/amazonq directory, and you can view and edit them in your favourite editor if you want.
You can create different profiles using the "/profile" command that allows you to configure different contexts, providing you with flexibility based on your needs.
As your projects get larger and the use cases more complex, being able to fine tune context will help you achieve better output.
Executing commands
When you are in a "q chat" session, you can execute commands without leaving by using the "!" prefix. So for example, I could use:
> ! echo "Q is cool"
And that command will execute (and you should see the output from running the tool). This is useful to know.
Exiting
To leave the chat session, you enter "/q" and this will return you to the shell.
Walkthrough demo
Here is a quick video from my colleague Donnie Prakoso that walks you through these features
Get inspired
If you are looking for inspiration, then the AWS developer community, my colleagues and myself have been putting together some content already to give you an idea of what you can achieve. Here is a small selection:
- Making Makefiles for fun and profile
- Lets Build a game ! Scratch that, lets build two !
- From PHP to Python - porting a Reddit clone with the help of Amazon Q Developer
- What I Learned from Vibe Coding
- Using Amazon Q Developer CLI to build applications from the command line
These should give you a great starting point, but it seems that every day I am hearing new ways in which developers are able to use Amazon Q Developer CLI to do wonderful things.
Get started with Amazon Q Developer
Amazon Q Developer CLI powered by Claude Sonnet 3.7 isnβt just an assistantβit THINKS, writes, fetches, updates, acts, and most importantly, prompts before making any modifications. I hope this blog post has inspired you to want to try Amazon Q Developer CLI for yourself.
You can try it for free by signing up for a Builder ID and then downloading the app from here.
I have some amazing and exclusive Amazon Q Developer challenge coins for the best content that is created on this, so get in touch if you do create something and who knows, one of these coins could be heading your way!
Until next time folks!
Made with 𧑠by DevRel!
Top comments (1)
I cant wait for MCP support to come!