The runtime for
board game rules engines.
Express your game’s state, commands, and turn flow as plain TypeScript. tabletop-engine handles validation, execution, hidden information, and deterministic replay — so you can ship the rules with confidence.
Model state with decorators.
Describe your game’s data model with @State() and @field(). The
engine compiles a type-safe canonical schema, hydrates a working
facade for execution, and projects per-player views for hidden
information — all from one declaration.
Author commands with validate and execute.
Every player action is a command with a validate step and an
execute step. The engine runs them transactionally, surfaces
structured errors, and emits semantic events you can stream to
clients.
One executor for your rules.
createGameExecutor gives you a single runtime that handles command
dispatch, stage progression, deterministic RNG, snapshots, and
replay. Use it to drive local tests, simulations, and game sessions
from the same rule definitions.
Generate schemas and types from your rules.
Use the CLI to derive JSON schemas and TypeScript declarations from your game definition. Keep runtime validation, generated types, and tests aligned with the rules your engine actually runs.
CLI reference →Built for real games.
Everything you need to model rules end-to-end — from the first turn to a reproducible runtime.
Hidden information
Stage progression
Deterministic RNG
Snapshots & replay
Scenario testing
Rules-first runtime
Build your next game.
Install the package, define a state, write a command, and run it. The first end-to-end game takes about ten minutes.