Wordle cli game is for the CLI enthusiasts. Using this code you can play the trending game Wordle from within your terminal console. I built this for fun. Feel free to suggest improvements or add issues in the issues tab.
You can install the latest version globally from npm:
npm install -g wordle-cli-jsThen run the game from anywhere with:
wordleOr, to use as a project dependency:
npm install wordle-cli-js- Play Wordle in your terminal
- Random 5-letter word fetched from an online API, with a robust local fallback word list (works offline)
- Colored feedback for correct, misplaced, and incorrect letters
- Handles edge cases and errors gracefully
- Well-tested with comprehensive test coverage
- Node.js v14+ recommended
- Internet connection (for fetching random words)
Clone the code and then run the following command
cd wordle-cli
npm iand then to play the game type the following command:
npm startWelcome to Wordle CLI!
Guess the 5-letter word in 6 tries.
Green = correct letter & position, Yellow = correct letter, wrong position, White = not in word.
_ _ _ _ _
_ _ _ _ _
_ _ _ _ _
_ _ _ _ _
_ _ _ _ _
_ _ _ _ _
For running the test cases, run
npm run testThe test suite covers core logic, edge cases, and user-facing output.
See TESTING.md for details on the test suite structure and what each test file covers.
MIT