DEV Community

Amar
Amar

Posted on

Building a Classic Terminal Snake Game with Amazon Q CLI ๐Ÿš€๐Ÿ

I recently built a classic Snake game you can play right in your terminal โ€” and Iโ€™m excited to share the journey with you!

What I Built

Snake is one of the simplest yet most addictive games ever made. My version runs entirely in the terminal using Pythonโ€™s curses library for handling input and screen rendering. The result? A smooth, retro-style gameplay experience with arrow-key controls, growing snake length, and a fun challenge to avoid crashing.

You can find the full source code here on GitHub:
๐Ÿ‘‰ https://github.com/Amarnath-Rao/QCLI-Snake-Game


Why a Terminal Game?

While web and graphical games are popular, terminal games have their own charm โ€” theyโ€™re lightweight, easy to run anywhere, and nostalgic for many developers. Plus, building one helps sharpen your skills in handling input/output, timers, and game logic without relying on heavy frameworks.


How I Built It โ€” Powered by Amazon Q CLI

I developed this game using Amazon Q CLI, an AI-powered assistant that helps with writing, debugging, and iterating code straight from the terminal. It made scaffolding the gameโ€™s structure and handling tricky parts like collision detection much faster.

If you havenโ€™t tried Amazon Q CLI, itโ€™s definitely worth checking out to boost your productivity!


How to Run It Yourself

Clone the repo:

git clone https://github.com/Amarnath-Rao/QCLI-Snake-Game.git
cd QCLI-Snake-Game
Enter fullscreen mode Exit fullscreen mode

Run the game:

python3 snake_game.py
Enter fullscreen mode Exit fullscreen mode

Windows users:
Install windows-curses first:

pip install windows-curses

Live Demo โ€” Play It Online!

Thanks to Gitpodโ€™s cloud IDE, you can even play the game live in your browser, no setup required:
๐Ÿ‘‰ https://amarnathrao-qclisnakega-pqoei3nva6v.ws-us120.gitpod.io


Screenshots

Gameplay:

Screencast from 2025-06-01 17-00-35.webm

Screenshot from 2025-06-01 14-59-32

Game from gitpod (note: this is terminal based game)

Screenshot from 2025-06-01 15-21-39

Code:

Screenshot from 2025-06-01 15-00-29


Join the Conversation

I shared a social media post about the game:
Twitter / X post

๐Ÿš€ โ€œJust built a classic Snake game you can play right in your terminal! Check out the code and try the live version!โ€


Whatโ€™s Next?

Iโ€™m planning to enhance the game with new features like levels, high score tracking, and maybe a more polished UI. If you want to contribute or suggest ideas, feel free to open an issue or PR on GitHub!


Thanks for reading! If you try out the game, let me know your high score. ๐Ÿ๐ŸŽฎ


More screenshots:

Image description

Image description

Image description

Image description

Image description

Resources that helped me:

Top comments (0)