๐ฎ Play DOOM in your terminal using OpenTUI's framebuffer rendering!
- Full DOOM gameplay in your terminal
- High-resolution rendering using half-block characters (โ) for 2x vertical resolution
- Mouse aiming - Turn and fire with your mouse (enabled by default)
- Keyboard input support with WASD and arrow keys
- Save/Load game support - saves persist to
~/.opentui-doom/ - Sound effects and music via mpv
- WebAssembly powered - DOOM compiled to WASM via Emscripten
- Bun - JavaScript runtime
- Emscripten SDK - For compiling DOOM to WebAssembly
- DOOM WAD file - Game data (shareware
doom1.wadis freely available)
If you have Bun installed, just download a doom1.wad and run:
bunx @muhammedaksam/opentui-doom --wad ./doom1.wadgit clone https://github.com/muhammedaksam/opentui-doom.git
cd opentui-doom
bun installgit clone https://github.com/emscripten-core/emsdk.git ~/emsdk
cd ~/emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.shbun run build:doomThis clones doomgeneric and compiles it to WebAssembly.
Download the shareware DOOM WAD:
- doom1.wad from ibiblio
- Or use your own
DOOM.WAD/DOOM2.WAD
Place the WAD file in the project root.
bun run dev -- --wad ./doom1.wadTo disable mouse aiming:
bun run dev -- --wad ./doom1.wad --mouse falseTo run with debug logging enabled (outputs to debug.log):
bun run dev:debug -- --wad ./doom1.wad| Action | Keys |
|---|---|
| Move Forward/Back | W / S or โ / โ |
| Turn Left/Right | Mouse or โ / โ |
| Strafe | A / D |
| Fire | Left Click or Ctrl |
| Use/Open | Space |
| Run | Shift |
| Weapons | 1-7 |
| Menu | Escape |
| Map | Tab |
| Quit | Ctrl+C |
Save games are stored in ~/.opentui-doom/ with DOOM's standard naming:
- Slot 1:
doomsav0.dsg - Slot 2:
doomsav1.dsg - ... up to Slot 6:
doomsav5.dsg
Saves are automatically synced every 5 seconds and on exit.
Sound effects and music require mpv to be installed:
# Ubuntu/Debian
sudo apt install mpv
# macOS
brew install mpv
# Arch
sudo pacman -S mpvSound files should be placed in the sound/ directory.
For the best experience, we recommend:
- Alacritty terminal emulator
- Font size: 5 (for maximum resolution)
- Maximize your terminal window
- Multi-key input: Terminals only send key repeat events for one key at a time. Holding W to move forward will stop when you press arrow keys to turn. This is a terminal limitation, not a bug.
- No Kitty keyboard protocol: While OpenTUI supports the Kitty keyboard protocol for proper key release events, it didn't work as expected in my testing. Currently using timeout-based key release as a workaround.
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ doomgeneric โโโโโถโ OpenTUI โโโโโถโ Terminal โ
โ (WASM) โ โ FrameBuffer โ โ Display โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โฒ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโ
Key Events
- DOOM runs as a WebAssembly module (compiled from C via Emscripten)
- Each frame, DOOM renders to a 1280x800 framebuffer
- OpenTUI reads the framebuffer and converts it to terminal cells using half-block characters
- Terminal keyboard input is mapped back to DOOM key codes
opentui-doom/
โโโ src/
โ โโโ index.ts # Main entry point
โ โโโ doom-engine.ts # WASM module wrapper
โ โโโ doom-input.ts # Keyboard input mapping
โ โโโ doom-mouse.ts # Mouse input handling
โโโ doom/
โ โโโ doomgeneric_opentui.c # Platform implementation
โ โโโ doomgeneric/ # doomgeneric source (cloned during build)
โ โโโ build/ # Compiled WASM output
โโโ scripts/
โ โโโ build-doom.sh # Build script
โโโ package.json
โโโ README.md
- This project code: MIT
- DOOM source code: GPL-2.0 (from id Software)
- doomgeneric: GPL-2.0 (by ozkl)
- id Software for the original DOOM source release
- doomgeneric for the portable DOOM implementation
- OpenTUI for the terminal rendering framework
Contributions are welcome! Please submit pull requests to the develop branch.