CLI reference
Install the 0.9.0 release with Node.js 22.13 or later:
npm install -g https://docs.threetopia.com/downloads/threetopia-cli-0.9.0.tgz
Analyze an existing scene
threetopia analyze [dir] [--json] inventories source and proposes extraction candidates offline, without changing or executing files. Read the conversion workflow before refactoring.
Shared world
| Command | Purpose |
|---|---|
| `create dir --shared --kind asset | world |
audit source --json --out conversion.json |
Inventory source; unknown behavior exits with code 1 |
compile dir --policy world-policy.ts |
Compile exact installed packages without executing source |
candidate dir [--policy-hash HASH] |
Build a private candidate with current neighbors |
candidates --json |
Read conflicts and review states |
policy [world-policy.ts] |
Read policy; reviewers can save a proposal |
accept ID --revision HASH --note TEXT |
Review and accept one exact candidate |
world --json |
Read the canonical world revision |
source bind dir --repository URL --branch main --subpath path |
Bind a package to a public GitHub source |
source reconcile |
Check tracked branches for missed updates |
sources --json |
Read exact source commits and build errors |
check validates schema 2 definitions and evidence. preview shows local contract
status or an explicit asset preview. Use a candidate preview to inspect a region
with its actual neighbors. A shared world cannot use direct publish.
Account
| Command | Purpose |
|---|---|
threetopia login |
Browser approval and secure local CLI token |
threetopia login --no-open |
Print the URL without opening a browser |
threetopia whoami |
Show the authenticated account |
threetopia logout |
Revoke the current CLI token |
Legacy tiles and project creation
| Command | Purpose |
|---|---|
threetopia tiles [--json] |
List the current grid and tile variants |
threetopia reserve q,r --variant bay-coast --rotation 0 |
Reserve a free coordinate sharing an edge with a published world |
threetopia create dir --kind world --tile ID |
Create a world for your existing reservation |
threetopia create dir --kind asset |
Create a reusable asset package |
threetopia create dir --kind asset --from local-package |
Validate and register prepared local assets into a new directory |
threetopia create dir --kind world --tile ID --from local-world |
Register a prepared world only when its immutable tile matches the reservation |
threetopia clone @creator/package [dir] |
Clone one of your own packages and its fixed tile |
Creation accepts --name @your-handle/package and --title "My title". Without these, the directory supplies the name. Existing directories are never overwritten. Use Tiles → Explore in Threetopia Creators for a visual selection.
Development and release
| Command | Purpose |
|---|---|
threetopia check [dir] |
Validate files, code syntax/imports, actual geometry, budgets and tile integrity |
threetopia preview [dir] [--port 5195] |
Interactive loopback preview; refresh after editing |
threetopia build [dir] |
Export a portable preview to dist-threetopia/ |
threetopia push [dir] |
Upload and independently validate a private version |
threetopia publish [dir] |
Release a version that is already ready |
Checking, previewing and building an existing local project work offline. Registry operations require login. Push does not publish automatically.
Package page sections
Use CLI 0.9.0 for fixed package sections. create adds package-docs.json.
clone downloads the selected version’s page. check validates local fields
when the file exists. push saves the page after package validation.
| Command | Purpose |
|---|---|
threetopia docs init [dir] |
Create an empty page file without overwriting |
threetopia docs check [dir] |
Check all fixed fields offline |
threetopia docs pull [dir] |
Download the current page and revision |
threetopia docs pull [dir] --force |
Replace the local page file |
threetopia docs push [dir] |
Save a page revision with conflict detection |
Fill all fields before release. See Package page sections.
Reuse
threetopia search rocks
threetopia install @creator/package@1.2.0
threetopia use @creator/package --export model --as map
threetopia uninstall @creator/package
Run install, use and uninstall in the project directory. use accepts --as world, --as map or --as overview; it copies a GLB after checking it against that role’s bounds and budget. Installation without a version resolves the highest published numeric version and then locks it.
Registry and files
All commands accept --registry ORIGIN. THREETOPIA_REGISTRY sets the default; production is https://creators.threetopia.com. Only HTTPS or HTTP loopback origins are accepted. A project cannot silently switch registries.
threetopia.json contains editable metadata, file paths and package/project IDs. Legacy tile.lock.json contains an immutable host tile. Schema 2 uses definition.ts and conversion.json. threetopia-lock.json records installed files and versions. threetopia_modules/ contains downloaded reusable packages.
Run threetopia help for the installed command list. The previous local-only image/scene CLI is an internal legacy tool and is not the creator registry workflow.
Agent diagnostics
analyze --json and check --json emit one JSON object with schemaVersion: 1, command, valid, and diagnostics. Diagnostics include code, severity, message, and a file/line when available. Errors exit with status 1; warnings are review signals. Check reports geometry per file under files, and confirms code.executed: false. No source code or installation scripts run during analysis, checking or installation.
Standalone source scenes
preview and build support full playable scene runtimes as well as GLBs. After installing a published scene, run threetopia use @creator/scene --export scene --as scene to attach all its verified code, assets and credits. check verifies the runtime bundle and coverage, while browser tests verify behavior. See complete scenes and Tidewater.
Namespaces and prepared projects
threetopia namespaces lists your own scope and any operator-assigned scopes. create --from prepared-directory preserves the prepared manifest name unless --name overrides it. A managed namespace changes the published name without changing the signed-in account or its ownership checks. Every prepared package should include a README with usage and composition examples and a preview with applicable settings.