Skip to content
Moku LabsDocs
@moku-labs/editor pages

@moku-labs/editor

Devtools for a running game: flow, state, render.

editor.mdllms.txt

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/inspect and @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 typescript

Quick 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/timber

The engine writes the dev page with the editor's agent on it, so the game needs no HTML file and no dev entry.

FlagDefaultWhat it does
--root, -r.The game folder.
--port, -p3000Port on 127.0.0.1. 0 picks a free port.
--no-hmrhot reload onServes the game without hot reload.
--packedloose filesServes 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 mcp

Start 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