K

Author from the command line

The check, add, screenshot, iterate loop outside the app.

You can build a device entirely from the terminal with msh-helper: compile it offline, add it to a running Msh, hot-reload edits, and screenshot the result to see what you made. It's the same set of operations as the in-app GUI, scripted. For the full command list see CLI and MCP.

Open a draft folder. A device is a folder of parts (index.ts, ui.ts, canvases/.../paint.ts). Adding a device in the app scaffolds one from the template; the authoring guide and SDK types are always at hand offline:

msh-helper docs    # the device-authoring guide
msh-helper types   # the SDK type definitions (msh-device.d.ts)

Put your draft under the watched library tree so hot-reload can fire (see the callout below).

Compile it offline. check compiles the folder in-process and reports per-file diagnostics. No running app needed:

msh-helper check ./my-device

Fix anything it reports, then run it again until it's clean.

Add it to a running instance. List the running instances to get an id, then add the compiled device as a live node:

msh-helper instances
msh-helper instance <id> add-device ./my-device --name "My Device"

Read the graph back to learn the new node's id:

msh-helper instance <id> graph

Edit and hot-reload. Change ui.ts or a paint.ts and push just the UI (no DSP recompile):

msh-helper instance <id> write-ui ./my-device --node <node-id>

Change index.ts and hot-swap the sound in place, preserving param values:

msh-helper instance <id> update-device ./my-device --node <node-id>

Screenshot the result. Capture the node as a JPEG to see the face you drew. The editor must be open with the node on-screen:

msh-helper instance <id> screenshot --node <node-id> --out tile.jpg

Pass --focus to fit the node into view first if it isn't visible.

Verify with the graph. Read the graph back to confirm params, settings, and ports landed the way you expect:

msh-helper instance <id> graph

Note

The draft folder must live under the watched <library>/user/devices/ tree for hot-reload to fire. A folder anywhere else compiles with check and add-device, but saving it won't trigger the engine's file watcher.

The helper also runs as an MCP server (msh-helper mcp-stdio), so an MCP-capable client drives this same loop as tool calls. See CLI and MCP for the tool names and sdk:// resources.