Skip to content
Browse documentation

SpawnKit CLI reference

Use @spawnkit/cli to create and extend games, connect a project, and manage deployments.

View Markdown
On this page

Install or run @spawnkit/cli

Install Node.js 24 or newer and pnpm 12. Run the CLI directly without a global install. Both tabs invoke the same @spawnkit/cli package; generated game projects use pnpm for their dependencies and scripts.

pnpm
pnpm dlx @spawnkit/cli --help
pnpm dlx @spawnkit/cli --version

The examples throughout these guides use pnpm dlx @spawnkit/cli. Replace that prefix with npx @spawnkit/cli if you prefer npm to launch the CLI. This does not change the generated project's package manager. See Create a game with the CLI for the complete create, install, run, test, and build sequence.

Optional global installation
pnpm add --global @spawnkit/cli
spawn --help
spawn --version

After a global installation, use spawn in place of pnpm dlx @spawnkit/cli. The package is distributed on npm and bundles its own runtime dependencies.

Discover and create

Inspect available components
pnpm dlx @spawnkit/cli templates --json
pnpm dlx @spawnkit/cli addons --json
Preview, then create a standalone game
pnpm dlx @spawnkit/cli init my-game --add phaser,vitest --dry-run
pnpm dlx @spawnkit/cli init my-game --add phaser,vitest
cd my-game
pnpm install
pnpm dev

The destination must not exist, even as an empty folder; its parent must exist. Generation writes files but does not install dependencies. Run pnpm dlx @spawnkit/cli init without a directory in an interactive terminal for guided setup.

OptionBehavior
--add <names>Comma-separated add-ons; repeatable. Use the catalog to check compatibility.
--name <name>Package name; defaults to the directory name.
--dry-runShow the plan without writing files.
--jsonMachine-readable output; interactive prompts are unavailable.

Add modules to an existing game

Review a module addition
pnpm dlx @spawnkit/cli add vitest --directory ./my-game --dry-run
pnpm dlx @spawnkit/cli add vitest --directory ./my-game
OptionBehavior
--directory <path>Existing game folder; defaults to the current directory.
--replace <names>Explicitly replace incompatible add-ons; inspect the proposed changes first.
--yesAccept a resolved plan. It does not permit overwriting conflicting edits.
--dry-run --jsonInspect file changes and unresolved choices without writing.

Read Updating an existing game for ownership records, conflict recovery, and verification. Renderer switching is not supported by pnpm dlx @spawnkit/cli add.

Sign in and select a project

Authorize and verify a project
pnpm dlx @spawnkit/cli login --site https://spawnkit.cloud
pnpm dlx @spawnkit/cli auth status
pnpm dlx @spawnkit/cli link --project YOUR_PROJECT_ID
CommandContract
pnpm dlx @spawnkit/cli login --site <url>Open browser authorization. --no-browser prints the link instead. SPAWN_SITE_URL can supply the site.
pnpm dlx @spawnkit/cli auth statusInspect local credentials only; it does not verify remote access.
pnpm dlx @spawnkit/cli link [--project <id>]Verify access and save the game folder association. Without an ID, interactive mode offers project selection.
pnpm dlx @spawnkit/cli unlinkRemove the local association; hosted projects and releases remain.
pnpm dlx @spawnkit/cli login --remote --email <email> --project <id>Request one hour of access to one existing project. The owner approves a six-digit code in their browser; no localhost callback is needed.
pnpm dlx @spawnkit/cli logoutRevoke a remote-agent grant, then remove local credentials. Local OAuth and browser sessions are separate.

Link and unlink accept --directory <path> and --json. In the dashboard, open your project → Settings → General → Copy project ID. Replace YOUR_PROJECT_ID with that value and DEPLOYMENT_ID with the relevant deployment ID. See Accounts and access for sign-in recovery.

Deployment command surface

CommandPurpose and command-specific flags
pnpm dlx @spawnkit/cli deployUpload source and follow the build. --env sandbox|production, --dry-run, --yes, --no-wait, --request-id <id>.
pnpm dlx @spawnkit/cli releasesList retained releases. --cursor <cursor> paginates results.
pnpm dlx @spawnkit/cli status <deployment-id>Read deployment state. Failed, cancelled, or superseded operations return exit code 1.
pnpm dlx @spawnkit/cli logs <deployment-id>Read build output. --cursor <cursor> resumes pagination; --follow or -f watches until completion.
pnpm dlx @spawnkit/cli promote <release-id>Promote a successful Sandbox release without rebuilding. Supports --dry-run, --yes, --request-id <id>.
pnpm dlx @spawnkit/cli rollback <release-id> --env <environment>Activate retained compatible artifacts. Environment is required. Supports --dry-run, --yes, --request-id <id>.

All deployment commands accept --project <id>, --directory <path>, --json, and --help. The project is otherwise inferred from the nearest game folder. Deploy defaults to Sandbox when enabled, otherwise production; specify the environment explicitly when the target matters.

Inspect before deploying
pnpm dlx @spawnkit/cli deploy --project YOUR_PROJECT_ID --env production --dry-run
pnpm dlx @spawnkit/cli deploy --project YOUR_PROJECT_ID --env production

Ctrl+C stops watching, not the remote deployment. Use pnpm dlx @spawnkit/cli logs DEPLOYMENT_ID --project YOUR_PROJECT_ID --follow to reconnect. Rollback does not undo database migrations.

Machine output and safe retries

Noninteractive plan and deployment
pnpm dlx @spawnkit/cli deploy --project YOUR_PROJECT_ID --env production --dry-run --json
pnpm dlx @spawnkit/cli deploy --project YOUR_PROJECT_ID --env production --yes --json

Successful command results go to stdout. Live deployment logs go to stderr in JSON mode. Login emits newline-delimited authorization and completion records. Check the process exit code and returned status; do not assume that receiving a deployment ID means the build succeeded.

Mutations in noninteractive mode require --yes. For retryable deployment mutations, choose a stable --request-id for that operation and reuse it only when retrying the same operation. Keep deployment IDs separately from release IDs: status/logs use deployment IDs, while promote/rollback use release IDs.

Inspect the installed version's contract
pnpm dlx @spawnkit/cli --help
pnpm dlx @spawnkit/cli deploy --help
pnpm dlx @spawnkit/cli logs --help
pnpm dlx @spawnkit/cli rollback --help

Need a hand? Get support

Explore the guides

Build your first game

Download a standalone game kit, run it locally, and make your first change.

Create and build a game with @spawnkit/cli

Start in a parent folder, generate your game, then run every development command inside the new game folder.

Upload an existing browser game

Upload a self-contained browser build. Your original source, engine, and build tools can stay as they are.

Publish your game

The dashboard accepts a ZIP of your built game. You will need an account to deploy it.

Use the SpawnKit dashboard

The dashboard manages your hosted games. Your editor or AI agent remains where you change and build your game source.

Make a browser game with Codex

Use Codex with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Claude Code

Use Claude Code with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Cursor

Use Cursor with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Extend your game

Find the right files, make a focused change, and check it in a playable build.

A complete publishing example

Follow a small example from editable source to a ZIP with index.html at its root. Use your own game title, description, and artwork.

Add tools to an existing game

Keep a recoverable baseline, inspect the proposed changes, and verify one addition at a time.

Test and debug your game

Combine automated checks with a short playthrough of the production build. A successful build alone does not verify gameplay.

Project structure and configuration

Your downloaded kit is a standalone TypeScript project. Its files belong to you and do not depend on the SpawnKit repository.

SpawnKit CLI reference

A command-by-command reference to the implemented CLI. Local generation works without an account; hosted operations require access to a project.

Accounts and access

Building locally is account-free. Publishing requires an account with access to the target project.

Agents and API resources

Public discovery endpoints are account-free. Use the dashboard or @spawnkit/cli for publishing.

16 guides available