DEV Community

Cover image for ๐ŸŽฎ Exploring Amazon Q CLI Building a Simple Tic-Tac-Toe Game
Mohit Bisht
Mohit Bisht

Posted on

๐ŸŽฎ Exploring Amazon Q CLI Building a Simple Tic-Tac-Toe Game

Hello everyone!

I recently participated in the #AmazonQCLIGameChallenge, an exciting opportunity to build a game using the new Amazon Q CLI โ€“ an AI-powered coding assistant from AWS. As someone who's always learning and exploring new tools, I decided to tackle a classic: a simple Tic-Tac-Toe game using Q CLI and Python.

In this blog post, I'll walk you through my experience using Amazon Q CLI to build the game, share my key learnings, and show you how you can try it out for yourself!

๐Ÿง  What is Amazon Q CLI? Your AI-Powered Coding Partner

Amazon Q CLI is a groundbreaking AI-powered command-line tool from AWS. Imagine having a knowledgeable coding partner right in your terminal, available 24/7. That's exactly what Q CLI offers!

It empowers you to write, debug, and explore code simply by chatting with it.

You can ask Amazon Q CLI to:

  • Generate code snippets
  • Explain complex functions
  • Identify and fix bugs
  • Provide architectural insights

Itโ€™s like having ChatGPT, but seamlessly integrated into your terminal workflow.

๐Ÿ‘‰ Learn more on the Official Amazon Q CLI Page

โš™๏ธ My Setup: Getting Started with Amazon Q CLI

Hereโ€™s how I set up my environment to build the game:

1. Sign Up for an AWS Builder ID

This is your gateway to accessing AWS services and tools.
๐Ÿ‘‰ Get Your AWS Builder ID Here

2. Install Amazon Q CLI

๐Ÿ”น For Windows:

๐Ÿ‘‰ Amazon Q CLI Installation Guide for Windows

๐Ÿ”น For Linux (Ubuntu):

# Update your machine and install libfuse2
sudo apt-get update
sudo apt install libfuse2

# Download and install Amazon Q CLI
curl --proto '=https' --tlsv1.2 -sSf https://desktop-release.q.us-east-1.amazonaws.com/latest/amazon-q.deb -o amazon-q.deb
sudo apt install -y ./amazon-q.deb

# Login to Q CLI
q login
Enter fullscreen mode Exit fullscreen mode

3. Install Python

Since I was building a terminal-based game, Python was a great choice due to its simplicity and clean syntax.

4. Start Amazon Q CLI Chat

Once everything was installed, I opened my terminal and ran:

amazonq chat
Enter fullscreen mode Exit fullscreen mode

๐ŸŽฎ Building the Tic-Tac-Toe Game with Amazon Q CLI

With the chat session open, I asked:

"Create a Tic Tac Toe game in Python that allows two players to play turn by turn."

amazonq chat

To my surprise, Amazon Q CLI instantly gave me the full Python code. It also explained each part of the logic when I asked, making it easy to understand and customize.

Code

Within minutes, I had a working version of the game, ready to play in the terminal. This helped me understand:

  • How to manage turn-based logic
  • How to store and check game state
  • Simple Python tricks for cleaner CLI output

๐Ÿ–ผ๏ธ Game Screenshots

Game

โ–ถ๏ธ Demo Video

Want to see it in action?

๐ŸŽฅ Watch the YouTube Demo

๐Ÿ’ป Get the Code

Feel free to check out the code and try it yourself:

๐Ÿ”— GitHub โ€“ Tic Tac Toe Game Using Amazon Q CLI

My Experience with Amazon Q CLI

Amazon Q CLI turned a simple game idea into an engaging learning experience. It wasnโ€™t just about generating code โ€” it was about understanding the logic and building confidence as a developer.

Whether youโ€™re just getting started or youโ€™re looking to speed up your development process, I highly recommend giving Amazon Q CLI a try. It's like having an intelligent teammate sitting right inside your terminal.

Thanks for reading! If you enjoyed this post, give it a like, drop a comment, or share it with a fellow dev! ๐Ÿš€

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.