Learn it. Build it. Ship it for others.
JavaScript and TypeScript battle game for the CLI
WarriorJS is a programming game where you write JavaScript or TypeScript to control a warrior through puzzle towers. The code you write decides how the warrior moves, fights, rescues captives, and survives each floor. The project ships a CLI, a website, shared game libraries, and tower content.
People who want to practice coding by solving game levels in the terminal or browser.
You can learn and practice JavaScript or TypeScript by writing code that directly controls game behavior.
What it does
CLI gameplay
Start the game with `warriorjs` and play through guided tower levels from the terminal.
Browser play
Play the game from the website at warriorjs.com without using the CLI.
Tower-based puzzles
Solve levels built around enemies, captives, stairs, and floor-by-floor objectives.
Player API docs
The docs explain the gameplay, towers, and the API you use to write your warrior logic.
Tower authoring
Contributors can build new towers that other players can install and play.
How to get it
- 1Install the CLI
npm install --global @warriorjs/cli
- 2Launch the game
warriorjs
README
In WarriorJS, you write JavaScript or TypeScript to guide a warrior through towers full of enemies. Each floor is a puzzle: battle sludge, dodge archers, rescue captives, and reach the stairs alive. The code you write is the strategy — there's no clicking, no dragging, just logic and sharp thinking.
Whether you're writing your first if statement or refactoring for a perfect
score, every floor will test you.
Quick Start
-
Install Node.js 22 or later.
-
Install the CLI:
npm install --global @warriorjs/cli
- Launch the game:
warriorjs
The game walks you through creating a warrior and choosing a tower. Open the
generated README.md for your first level's instructions, write your solution
in Player.js, then run warriorjs again to see how your warrior fares.
You can also play from your browser at warriorjs.com.
Documentation
The official docs cover everything from first steps to building your own towers:
Contributing
The best way to contribute is to build a tower — a set of levels that other players can install and play.
You can also fix bugs, improve the docs, or add new abilities and units. See the contribution guide and Code of Conduct.
Acknowledgments
This project was born as a port of ruby-warrior. Credits for the original idea go to Ryan Bates.
Special thanks to Guillermo Cura for designing a wonderful logo.
License
WarriorJS is licensed under a MIT License.
Files in the repo
- .github
- apps
- docs
- libs
- logo
- towers
- .editorconfig
- .gitattributes
- .gitignore
- biome.json
- CHANGELOG.md
- CLAUDE.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- lefthook.yml
- LICENSE
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
- README.md
- tsconfig.json
- turbo.json
- vitest.config.ts
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tutorials & guides
Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1
A visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Specification and documentation for Agent Skills

💻 vibe coding 101|The first course for AI-native product builders.

End-to-end, code-first tutorials for building production-grade GenAI agents. From prototype to enterprise deployment.