From Swift to Java Script Link to heading

Remember that old project? The one where I spent time with Swift back in 2023, trying to build a simple game about work-life balance? It was an entertaining idea to demonstrate how easily things can go wrong when given only a few options. But like many side projects, it was abandoned because of time constraints and, to be honest, the lack of robust GenAI tools at the time.

Fast-forward to today. I decided to resurrect that concept, but with a twist. This time, I’d leverage the power of Amazon Q CLI and aim for a Node.js/TypeScript implementation. Why the switch? Simplicity and the ease of deploying to the AWS cloud. My goal was a “100% vibe coding experience” – meaning, I’d let Amazon Q do the heavy lifting. No manual code changes, just commands to Q.

I started by feeding Q the old Swift project and its notes, asking it to translate the game into JavaScript.

Initial Swift Project

The initial results were impressive. Q managed to port the core logic to JavaScript. There are just maybe a few lines of code in that Swift Project, but Amazon Q able to understand the task and prepare a completely different application. This is not just a “standard” Java 8 to Java 18 upgrade. Here is a platform migration from macOS to Web Application.

Q generates JavaScript code

Next, I tasked Q with adding tests. It’s crucial for Q to be able to run the code, identify issues, and fix them. I always recommend letting GenAI tools be able to test their code.

Q adding tests

And here’s the migration to JavaScript, completed by Amazon Q. It looks basic, but all the code was migration, and what is more important - project bootstrapping. I don’t need to spend time preparing the development environment.

JavaScript code by Q

With the basic game ported, it was time for new features.

Q adding new features

ToDo.md as bidirectional communication Link to heading

While Q was processing, I started a todo.md file to queue up more commands and ideas. AI can read files, right? All because of the built-in MCP inside the Q CLI. Here we could find a set of basic tools: https://github.com/aws/amazon-q-developer-cli/blob/main/crates/cli/src/cli/chat/tools/fs_read.rs
Oh, I maybe forgot, but yes, Amazon Q Developer CLI is open source. Another critical part is the set of MCP servers, which, if you are interesting you could find here.

Creating a TODO file

It is a bit better to tell Q CLI to use this todo.md file. It’s hard for these tools to understand which content, for example, needs to be processed in the repository. The codebase could be big.

Asking Q to use the TODO file

Exciting “Ah-ha” moment, Q started proposing its ideas and adding them to the todo.md file. This created a cool back-and-forth communication channel, all within a simple markdown file. You know, currently we can’t speak with the CLI Tool yet, but we can both read and write text files.

Q suggesting ideas in TODO file

We even got checkboxes working in the to-do list, and Q was smart enough to understand them and mark items as done. This kind of interactive coding is quite something.

Q using checkboxes in TODO

Deployment to AWS Amplify Link to heading

With development progressing nicely, the next logical step was deployment. I decided to feign a bit of AWS unfamiliarity and asked Q for guidance on deploying the app.

Asking Q how to deploy

Q suggested AWS Amplify, and the process was surprisingly straightforward. Connecting to GitHub was a breeze.

Amplify connect to GitHub

Setting up the app basics in Amplify was also just a few clicks.

Amplify app basics

And just like that, the app was deployed, complete with the new features. Amplify handled all the build processes, so no need for manual CI/CD setup.

Deployed app with new features

The most fascinating part? Even the commit messages were AI-generated!

GitHub commits from AI

This entire experience showcased that Amazon Q CLI is much more than just a chat interface. It can be a powerful partner in the development lifecycle, from coding and testing to deployment and even project management. It’s a glimpse into a new era of software development.

The game itself is here: https://timetectonic.cageyv.dev/
My goal mostly was to try the autonomous behavior of Q and ability to follow instructions and perform not well described tasks.

Summary Link to heading

  • Amazon Q Developer CLI could bring agentic behavior to the terminal as independent from the applications.
  • It is giant progress since the CodeWhisperer era
  • Build-in tools help a lot and let the agent execute many commands.
  • Amazon Q Developer CLI could also: debug issues in AWS, check logs, and S3 buckets. With access to the AWS API, it is a very powerful tool.