Skip to content

Scaffold a project & drive the editor (CLI)

cli tutorial Beginner ⏱ 5 min vgai 0.1.0

Prerequisites: Node.js installed

What you'll learn

  • Scaffold a new game project from the editor template
  • Know the vgai CLI commands for driving the editor

What you'll build: A terminal walkthrough of scaffolding a project and the vgai CLI.

One public CLI creates the project and opens its editor. After creation, the project-pinned npm run vgai -- … command drives that editor (open scenes, enter Play, select/focus entities) without relying on a global installation. The transcript below is real captured output.

# transcript pending capture β€” run: node site/media/capture-cli.mjs
Terminal β€” Scaffold a project & drive the editor (CLI) Β· captured by site/media/capture-cli.mjs
  1. Scaffold a new project.

    Terminal window
    npx @vgai/cli@latest create my-game

    It creates a standalone default project with Three.js and React roots, installs versioned packages, opens the editor, and prints its URL. Shipped example gameplay is available only when you explicitly pass --example.

  2. See the CLI commands.

    Terminal window
    npm run vgai -- --help

    The project-pinned CLI talks to a running editor: scene <path> opens a scene, play / stop / pause control play mode, create scaffolds, edit launches the editor (or just vgai <folder> / vgai . as shorthand), and select / focus drive the viewport. (It connects over a local URL β€” start the editor first.)

Recap

New functionality

  • Scaffolded a new game project from the template
  • Learned the vgai CLI commands

New concepts & skills

  • the public CLI creates and opens a standalone project
  • the project-pinned VGAI CLI drives a running editor
  • the CLI connects to the editor over a local URL

Next lesson β†’ Build & publish