@moku-labs/editor
Devtools for a running game: flow, state, render.
Overview
@moku-labs/editor is the devtools for a running @moku-labs/game. One tools page shows the
flow, the state, the render and the files of the live game, and lets you change them. It is a dev
dependency: nothing of it ships in a release build.
- One registry, every surface. The overlay, the tools page, MCP and a test read the same sources and commands.
- Doors, not hooks. The editor touches the game only through
@moku-labs/game/inspectand@moku-labs/game/control. No private hooks, no engine fork. - Edits keep the game state. A save reloads the game page and restores the bookmark taken just before it.
Install
bun add -d @moku-labs/editor @moku-labs/game typescriptQuick start
In a moku-game folder, the one with index.ts and config.ts, run the editor:
bunx moku-editor --root .It prints the two pages:
Game http://127.0.0.1:3000/
Tools http://127.0.0.1:3000/__editor/
Root /home/dev/timberThe engine writes the dev page with the editor's agent on it, so the game needs no HTML file and no dev entry.
| Flag | Default | What it does |
|---|---|---|
--root, -r | . | The game folder. |
--port, -p | 3000 | Port on 127.0.0.1. 0 picks a free port. |
--no-hmr | hot reload on | Serves the game without hot reload. |
--packed | loose files | Serves the packed assets of moku-game pack. |
Use with Claude Code
moku-editor mcp is a stdio MCP server. Register it from the game folder, and Claude can read the
game, run commands and take screenshots:
claude mcp add moku-editor -- bunx moku-editor mcpStart with Claude
Describe what you want. The conductor picks the packages.
Build a blog with tags and an RSS feed on @moku-labs/web
Add a D1-backed comments API with @moku-labs/worker
Make a couch quiz game: TV shows questions, phones answer
Ship this app to macOS and iOS