Magesh

Magesh

Magesh

December 22, 2025

 • 2 min read

0

Wordle CLI Game using JavaScript

A few years ago, a simple game called Wordle gained immense popularity worldwide. Everyone was playing and sharing stats on Twitter / X with so much excitement. Later, The New York Times acquired it for a few million dollars. I thought, millions for such a simple game? Wow! But it is a fantastic game.

My wife and I played it every evening after work. But we could only play one game and then had to wait 24 hours for the next one. So I decided to build the game myself so we could play it as many times as we wanted.

I wanted to build a console-based game, so I didn’t have to worry much about the UI. I did create a CLI interface, a good-looking one. A coder like me would always enjoy doing things on the console, and it could be a good learning project to practice my craft, I thought to myself.

My wife and I both wanted to try to build our own versions. I wrote it in JavaScript, and she used Python. It was fun. I built the first scrappy version over a weekend. My wife and I started playing unlimited games with the version I built. Isn’t that cool?

Recently, I took the time to polish it a bit and publish it online for others to play.

I published it as an npm package, so anyone can easily install and play it with a single command. If you want to try, open your terminal and type the following command:

npm install -g wordle-cli-js

and then type,

wordle

That will start the game, and you can play if you know the rules.

If you are interested in seeing the code, you can take a look at it on GitHub:

https://github.com/imagesh/wordle-cli

Let me know if you find any issues or have any suggestions for improving the code.