Skip to content

CLI, SDK & scaffolding

create-vgai-project (packages/create-vgai-project/src/index.ts) generates a project from the full template (the example project): it copies the template, rewrites package.json, tsconfig.json, vite.config.ts, and project.json for your name, and runs npm install. It takes a project name and an optional target directory.

Terminal window
npx create-vgai-project my-game [target-dir]

The vgai CLI’s create command additionally offers a template choice via --template: starter (the full example project) or empty (a minimal scene + src/main.ts + config):

Terminal window
vgai create my-game --template empty

The vgai CLI (packages/vgai-cli/src/index.ts) controls a running editor — useful for scripting and automation:

The CLI and editor SDK drive a running editor over REST and SSE
The CLI/SDK talk to the editor over /__editor/* (REST + SSE).
AreaCommands
Projectcreate, edit, open, project, projects
Scenescene <path>, open-asset <path> <kind>
Playplay, stop, pause, resume, step
Navigateselect <id> | --all, focus [id], view <top|front|right|perspective>
Panels/displayshow <viewport|inspector|console|build>, grid, helpers, stats, shading
Statestatus

Under the hood it talks to the editor’s /__editor/* routes (REST + SSE), defaulting to http://localhost:5173 (override with VGAI_EDITOR_URL).

@vgai/editor-sdk (packages/editor-sdk/src/) is the TypeScript client the CLI uses — EditorClient with methods like openScene, play/stop/pause/resume/step, select, focusEntity, viewPreset, panel toggles, getState, and waitForState. Use it to build custom tooling.