Development and deployment
These instructions describe the 0.40.1 source line. See the release notes.
Requirements
- Node.js 22 or newer
- npm
- Bun 1.3.11 to build the included first-party plugins from their sources
- A modern Chromium-based browser is recommended for the File System Access API; other browsers use download/upload fallbacks.
Quick start
From your cloned repository root:
npm ci
npm run dev
Open http://localhost:5173/.
Editor development and production builds regenerate the included shader packs, Broadcast Motion
and Chart.js bundles. Their exact hashes are compiled into the application, and their archives
are served locally, including in the offline standalone executable. npm run plugins:bundle
regenerates these assets explicitly; npm run plugins:check verifies their source and byte pins.
The root development command builds the runtime bundle before starting Vite. If you change
packages/ograf-runtime/src while the editor is already running, rebuild it explicitly:
npm run build --workspace @ograf-editor/ograf-runtime
Build version
Studio's displayed version and standalone executable metadata come from the root package.json.
For this source line, check it with:
npm pkg get version
# Expected: "0.40.1"
Restart the development server or rebuild after changing the version. Packaging creates local artifacts; it does not create a Git tag or publish a GitHub release.
Run the MCP server
Start the editor first, then use a second terminal:
npm run mcp:start
Endpoints:
- MCP:
http://127.0.0.1:4318/mcp - Editor bridge:
ws://127.0.0.1:4318/editor - Health:
http://127.0.0.1:4318/health
To start the editor and MCP server together as hidden background processes, run:
npm run start:all
The command skips a service that is already online, waits up to 45 seconds for both endpoints, and
writes stdout/stderr logs under .logs.
Single-executable server
The optional standalone distributions serve the production editor, MCP endpoint, editor WebSocket,
health endpoint, fonts, icons, application assets, and matching OGraf Authoring skill from one
headless executable per operating system and architecture. Source checkouts can use npm run dev,
npm run mcp:start, or npm run start:all.
Install Bun on the build machine, then run:
npm run server:package
This creates the Windows x64 executable. Build the complete release matrix with:
npm run server:package:all
Set OGRAF_STANDALONE_PLATFORMS=windows,linux to exclude macOS from packaging and artifact
verification. The release workflow uses this selection.
The matrix produces:
| Operating system | Architecture | Artifact |
|---|---|---|
| Windows | x64 | OGrafStudioServer.exe |
| macOS | Intel x64 | OGrafStudioServer-macos-x64 |
| macOS | Apple Silicon | OGrafStudioServer-macos-arm64 |
| Linux | x64 | OGrafStudioServer-linux-x64 |
| Linux | ARM64 | OGrafStudioServer-linux-arm64 |
Bun, Node.js, npm, and the source tree are not needed on destination machines. Start the applicable file directly and open the reported URL in any normal browser:
OGrafStudioServer.exe
OGrafStudioServer.exe --open
OGrafStudioServer.exe --port 4400 --workspace "D:\OGraf Projects"
The standalone listener for the editor and MCP binds to 127.0.0.1. Its default writable
workspace is Documents\OGraf Studio\Projects; --workspace and the existing
OGRAF_WORKSPACE_ROOT environment variable can override it. --open launches the system browser,
while the default remains suitable for a console or background process. Run
OGrafStudioServer.exe --help for the complete option list.
View Studio's Live preview on the LAN
Start Studio normally. The console prints a fixed viewer URL and shows its QR in a color terminal when a private LAN address is available. Open the viewer URL in a browser or scan the QR. The viewer waits until Studio opens a template with playout content. Starting an empty template keeps any existing shared session on air until the new template has content to publish.
Opening a template or coordinated template set prepares a playback copy in memory. The viewer and the Live screen in Preview & Export use that same session, including its data and playout controls. The Preview menu presents that session with Studio's fullscreen controls. The designer can keep editing the source document separately. Opening another template updates the viewer at the same URL.
Use the viewer on a trusted LAN. Anyone who can reach its URL can watch and retrieve the browser's playback files, including packaged assets and authored data defaults. Studio and the separate Operator link control the shared session. Right-click the output to open remote controls. With Sync viewers checked, viewers follow the shared session and their playout controls are read-only. Uncheck it to give each viewer their own controls and data, then check it again to restore the operator's current output on every viewer. Independent controls act only in that browser.
The synced Live preview forwards the operator's pointer position and the graphic's mouse and keyboard interactions to connected viewers. The viewer shows the operator's pointer over the graphic. Studio shortcuts and typing in control fields stay local. Inputs are delivered live and are outside the command replay used by a reconnecting viewer.
Keep the Studio server process running after closing the editor tab. Reconnecting synced viewers restore the current playback copy, accepted commands, and last received live data. Configured Studio Data Connections run from the editor tab and send their latest exposed values separately from playout commands. Each browser renders at its own cadence. If a browser cannot start playback, Retry preview reloads the current session in that browser.
Use --playout-host 127.0.0.1 for a viewer on this workstation, or specify another assigned IP
and port with --playout-host and --playout-port. Use --no-playout to start Studio without
the viewer listener. The editor and MCP stay on loopback.
Export the bundled skill or print the setup prompt
The executable contains the full version-matched ograf-authoring.zip. The startup hint shows
how to print a setup prompt for an external AI client. On Windows, for example:
.\OGrafStudioServer.exe --print-setup-prompt
.\OGrafStudioServer.exe --export-skill .\ograf-authoring.zip
Each command exits after printing the prompt or writing the archive. The export requires a fresh path and preserves existing files. Use the filename for your platform. See the client install locations and source setup fallback in the AI authoring guide.
For source-level testing of the same combined host, use npm run server:start. This command requires
Bun because it runs the TypeScript entry point directly; only the generated executable is
self-contained.
Linux users must make the downloaded file executable with chmod +x. The macOS artifacts are raw,
unsigned command-line executables; they require code signing and notarization before broad external
distribution. The Windows executable contains Zero Density product/version metadata and the official OGraf
icon; headless macOS/Linux executables do not have desktop application icons.
The source-level npm run mcp:start server also binds only to loopback, but defaults its writable
workspace to the repository root. Set OGRAF_WORKSPACE_ROOT before starting that command to use a
different confined workspace. Set OGRAF_MCP_PORT to change port 4318, and set the editor's
VITE_OGRAF_AGENT_BRIDGE_URL to the matching WebSocket URL when changing the port.
Count what agents call
The server can count which tools and operation types agents call, and which calls it refuses. The
counts show what the tool list is used for, which earlier names are still called, and where agents
fail. Counting is off unless OGRAF_AGENT_USAGE_FILE names a file:
$env:OGRAF_AGENT_USAGE_FILE = "$env:LOCALAPPDATA\OGraf Studio\agent-usage.json"
The file is JSON with one section for MCP clients and one for the built-in AI Assistant. It holds names and counts only: a tool with the choice it was called with, an operation type, and the shape of a refusal, in which quoted names, IDs and numbers are replaced. Nothing from a project is kept and nothing is sent anywhere. Later runs add to the same file; delete it to start again.
Can the editor run without a backend?
Yes. The visual editor is a client-side application and can author, preview, import, certify, save
.ogs, and export .ograf.zip files without the MCP server. Autosave uses browser storage, and
explicit saves use the browser file picker or downloads.
Without the MCP server you lose:
- external agent/tool access;
- revision-checked MCP mutations, agent undo/redo, and temporary MCP sessions;
- MCP-requested PNG captures, contact sheets, and text measurements;
- agent-controlled certified save/export to a workspace path.
Normal visual editing and browser-driven save/export remain available. A production build can be served as static files; the MCP server is an optional authoring companion, not an application backend.
Verification
Run the complete local gate before publishing changes:
npm run verify
It checks generated MCP contract drift, formatting, lint, every workspace typecheck, all tests, the
OGraf runtime bundle, and the editor production build. npm test also prebuilds the ignored runtime
bundle so tests work in a fresh clone.
Authoring skill bundle freshness
Build commands regenerate skills/ograf-authoring/ograf-authoring.zip from the canonical skill,
references, and metadata. Entries are sorted, line endings normalized, and timestamps fixed, so
unchanged sources produce the same archive. The archive excludes itself.
Standalone builds embed these exact bytes. The separate release ZIP uses the same archive for
manual installs and clients that accept ZIP uploads.
npm run skill:package
npm run skill:check
npm run hooks:install
The first build installs the repository's pre-push guard when no custom hook is configured. It checks
the committed revision being pushed, so a freshly rebuilt but uncommitted ZIP cannot hide a stale
archive in the commit. Commit the rebuilt ZIP alongside skill changes. Custom hook configurations
are preserved; chain node scripts/packageAuthoringSkill.mjs --check-push from the existing pre-push
hook, passing its standard input. npm run verify also checks ZIP/source parity.
The guard is configured per checkout. When extensions.worktreeConfig is on, each checkout records
its own .githooks path with git config --worktree, so the shared .git/config is never changed
and removing one worktree cannot disarm another. Without that extension a linked worktree has no
config of its own: run npm run hooks:install from the main checkout instead.
Repository layout
apps/editor— React/Vite visual editor.apps/mcp-server— localhost Streamable HTTP MCP server and editor bridge.packages/agent-tools— transport-neutral canonical tool records, provider schemas, generated authoring prompt, and bridge/workspace ports shared by MCP and the in-app agent.packages/scene-model— canonical editable project model and migrations.packages/authoring-core— framework-neutral revisioned authoring operations.packages/codegen— manifest, descriptor, and export artifact compiler.packages/ograf-runtime— descriptor-driven OGrafGraphiccustom element.packages/validation— official-schema and semantic validation.skills/ograf-authoring— reusable MCP authoring skill and references.docs/generated— generated public MCP tool/schema contracts; regenerate instead of editing by hand.templates— example editable sources and OGraf packages.fixtures/ograf-schema— vendored OGraf schema closure used by validation.
See Using Studio for supported workflows and compatibility notes, and Contributing for community development guidance.