TuiCraft Ecosystem 🌌 Hub & Game Engine

Unified Multiplayer Terminal Gaming

Play retro text-based games instantly inside your terminal or browser, or leverage the open-source TuiEngine framework to build, test, and publish multiplayer sandboxed games to the Hub in seconds.

🌌 The TuiCraft Hub

A centralized matchmaking lobby for multiplayer console games. Connect over SSH with passwordless public key auth, join public game servers, or check leaderboards.

$ ssh play.tuicraft.com
Launch Web Client Register Profile →

The TuiEngine

The open-source game development framework. Scaffold projects, run physics tests locally, and publish sandboxed runner containers with a single terminal command.

$ bun create github.com/thoughtlesslabs/tuicraft
Read Developer Guides Get Publisher PAT →
tuicraft - live_arena.ts (Web SSH Viewport)
ONLINE (Port 2222)
+--------------------------------------------------+
| # # # # # # # # # # # # # # # # # # # # # # # #  |
| # . . . . . . . . . . . . . . . . . . . . . . #  |
| # . @ . . . . . . . . . . . . . . . . . . . . #  |
| # . . . . . . . . . # # # # . . . . . . . . . #  |
| # . . . . . . . . . # . . # . . . . . A . . . #  |
| # . . . . B . . . . # . . # . . . . . . . . . #  |
| # . . . . . . . . . # # # # . . . . . . . . . #  |
| # . . . . . . . . . . . . . . . . . . . . . . #  |
| # # # # # # # # # # # # # # # # # # # # # # # #  |
+--------------------------------------------------+
          
Click inside terminal, then use WASD or ▲◀▼▶ to move
[System] Starting authoritative tick loop (300ms)...
[System] SQLite loaded: data/mygame.db
[SSH] Listening on port 2222
[Web] Socket bridge opened on port 3000
[Join] player_guest connected.
player_guest: hello from the terminal!
[Join] bot_adventurer connected.
bot_adventurer: cool, real-time multiplayer!
>
ARCADE DIRECTORY

Explore Published TUI Games

Play multiplayer retro games instantly inside your web browser or join directly from your terminal.

⌛ Loading dynamic arcade directory from play.tuicraft.com...
ENGINES & INFRASTRUCTURE

Everything Built-in, Out-of-the-Box

TuiEngine is a blank-slate template configured to get you building terminal graphics immediately.

Dual Network Server

Playable natively over standard terminal SSH (`ssh localhost -p 2222`) OR in browser using a proxy WebSocket to xterm.js wrapper.

Authoritative Game Loop

Central action queue that executes inputs sequentially per tick (default 300ms) with auto-saving, state tracking, and idle room sweeping.

SQLite DB Integration

Utilizes `bun:sqlite` with predefined schemas for session recovery, bans, keys, chat logs, and hooks to easily register custom gameplay tables.

Admin Control Console

Beautiful, separate SSH control screen on port 2223 with TOFU public key security to kick/ban users, broadcast alerts, and trigger custom commands.

Model Context Protocol (MCP)

Built-in AI server allowing LLM agents, players, or developer bots to connect, inspect rooms, fetch logs, and trigger game controls dynamically.

Docker Orchestration

Docker Compose layouts and optimized multi-stage Slim builds containing curve25519 fixes for seamless deployments on Ubuntu/VPS nodes.

GETTING STARTED

Build Your First Multiplayer TUI

Bootstrap a production-ready repository structure in seconds.

index.ts
import { TuiEngine, BoxRenderable } from "tuiengine";

// 1. Instantiate the TuiEngine
const engine = new TuiEngine({
  databasePath: "data/mygame.db",
  tickRateMs: 300,
  onPlayerSession: handlePlayerSession
});

// 2. Handle the player rendering loop & UI layout
function handlePlayerSession(session) {
  const { renderer } = session;
  
  // Draw boxes and controls using OpenTUI components
  const box = new BoxRenderable(renderer.root.ctx, {
    width: "100%",
    height: "100%",
    border: true,
    title: " Welcome to TuiCraft "
  });
  
  renderer.root.add(box);
  renderer.requestRender();
}

// 3. Boot the servers! (SSH & Web)
engine.start();