AWS Logo
Menu

Using Q Developer CLI for Agentic code development

2025 is the year for agentic development!

Pablo Guzman
Amazon Employee
Published May 19, 2025
I have been a backend developer for 20+ years and during 2024 I gave co-pilots a go and was... quite disappointed. The recommendations were not great for professional developers and added more overhead time trying to adapt the proposed code or troubleshooting bugs than the time they really saved.
In Mar 6th AWS launched Q Developer CLI, which provides (at the begining) a CLI experience to develop code. To understand it, think of this: A semi-autonomous Generative AI agent that can use tools (with user-confirmation) such as: read/write from your filesystem, execute bash scripts, and execute AWS CLI.
Now... if you are like me you will be hell scared that this thing it's going to decide throwing a rm -rf of my filesystem and destroy my computer. Regardless, I decided to give it a go and see "What could possibly go wrong?".
With a simple "q chat" command you open it's CLI GUI
Q Chat CLI GUI
In there you can ask it to run commands, such as "Read the files in my directory and provide a summary for each file", or "List the running EC2 instances in my AWS Account", or "Run pytest and fix the errors found in the code"... you get the idea.
At the beginning I used those kind of prompts and then, seeing it's success, started to get more and more involved with it. I began to use the --trust-all-tools by default and let it do it's thing.

Proof of concepts made easy

One of the key hurdles with the GenAI code suggestions approach was that the code could be very buggy and not work at all, and the assistant just did it's best poker face and told you it was good code. With Agentic Development you give GenAI the possibility to run and fix it's own code, which solves a lot of the issues that I previously encountered.
Here is a sample prompt I used for one of my proof of concepts
On the current folder, design a step0 python script, which opens the file ./2025.csv , groups the insights per category and then for each category it sends a prompt to Amazon Bedrock with all the insights in that category, asking it to output a list of trends found on the current year. Print that answer to the CLI. After generating the code, run it and iterate until it runs successfully.
Here is the play-by-play (that it did autonomous with --trust-all-tools )
First he went and read the CSV file to understand the structure
Reads the directory and CSV file to understand the context
He then wrote a code to send it to Bedrock
Agent starts writing code
He generated and ran the code to test it
Creates code and runs it
He analyzed the output and decided to refine the code
Thinking about the generated code
And lastly, it said it was done.
It took a few minutes through all the steps (that I was just doing some other work like answering mails) and... that's it, I got a working PoC of a insights-to-trends code. I had to iterate the trend-generating prompt manually with things I neglected to tell Q, but that was just expected.
I have make it do streamlit applications, lambda functions and so many awesome things. Some of my customers are using it to upgrade Lambda Python 3.8 to 3.12 runtime, by asking it to create tests and iterate the test until they pass, then upgrade the code to 3.12, and then fix the code until it passes the tests.

Prompt suggestions

After a few projects I narrowed down a few phrases that I add to my coding prompting that improved the quality of the generated code:
  • Add enough prints to be able to diagnose if the script ran as intended, make sure to print any errors to the stdout
  • When done coding, run the code, and if it fails, fix it and try again until you get it right.
  • Review the printed output and adjust the code if it doesn't meet the stated goal
  • Follow clean-code patterns when writing code

Conclusions

Agentic development it's awesome for proof-of-concept building and Sonnet 3.7 (the model behind Q Developer CLI currently) is great for the coding task. For live projects the jury is still out, however, when combined with proper testing I think it can make a real impact on day-to-day for professional coders. It certainly doesn't replace coders as it requires experienced guidance to provide the needed output. A good sample would be to
  1. Provide a scaffolding of what the classes and functions are
  2. Collaborate with AI to build a effective test suite
  3. Launch agentic development to fill in the code
You certainly should give it a try!
 

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

Comments