World Projects
Hyperfy world projects are normal Node projects that contain only game code and assets. They are synced to a running world via the app-server and can be deployed explicitly for staging/production.
Quick Start
# Scaffold a new project
npx gamedev init
# Install dependencies
npm install
# Start local world + continuous sync
npm run dev
The scaffolded package.json includes gamedev and typescript as devDependencies.
Built-in apps and a default $scene entry are included in apps/ and world.json.
World projects are meant to live in their own repository (no engine source). The CLI syncs your files to a world server:
- If
WORLD_URLpoints at localhost/127.0.0.1,gamedev devstarts a local world server and the app-server. - If
WORLD_URLis remote,gamedev devskips the world server and only runs app-server sync. - Use
.envor.lobby/targets.jsonto point at different worlds.
Project Layout
apps/ App scripts + blueprint JSON (defaults)
assets/ Local assets referenced by blueprints
shared/ Shared script modules (import via @shared/ or shared/)
world.json World layout + per-instance overrides
tsconfig.json TypeScript config (points at `gamedev` types)
.nvmrc Node version for this project
.env Local world/app-server config (gitignored)
.env.example Shareable template for env vars
.lobby/targets.json Local-only deploy targets (gitignored)
.lobby/targets.example.json Shareable template for targets
.claude/skills/ Claude Code skill docs for app scripting
What to Edit
apps/<AppName>/index.jsfor entry scripts.apps/<AppName>/**/*.jsfor module helpers.shared/**/*.jsfor shared modules used by multiple apps.apps/<AppName>/*.jsonfor blueprint defaults (props, model, flags,scriptFormat).world.jsonfor layout and per-instance overrides.assets/for local files referenced by props/blueprints.
What Not to Edit
.lobby/<worldId>/is local runtime state..claude/settings.local.jsonis per-developer.
Claude Code
The scaffold includes .claude/skills/hyperfy-app-scripting/SKILL.md to guide app scripting tasks. Commit the skill folder, and keep local Claude settings in .claude/settings.local.json (gitignored).
Targets and Deploys
- Use
.lobby/targets.jsonfor local targets (dev/staging/prod). - Commit
.lobby/targets.example.jsonas the shareable template. - Use
gamedev devfor continuous sync (dev only). - Use
gamedev app-serverfor sync only (no local world server). - Use
gamedev apps deploy <app>for explicit staging/prod deploys.
Existing Worlds
If you need to pull an existing world into a local project (including scripts):
gamedev world export
#
# Add this for legacy single-file scripts:
gamedev world export --include-built-scripts
Migration Notes
- Bundling is removed. Use
scriptFormatto control how the entry is interpreted. - Tag existing apps with
gamedev scripts migrate --legacy-body(keep classic body scripts) orgamedev scripts migrate --module(convert to ESM default export).
Scripting Reference
Use the scripting docs for runtime APIs and lifecycle:
docs/scripting/README.mddocs/scripting/app/App.mddocs/scripting/world/World.md