@genex-ai/cli
v0.3.2
Published
Genex CLI — scaffold & live-edit 3D games via Cursor / Claude Code / Codex.
Maintainers
Readme
@genex-ai/cli
Scaffold and live-edit 3D games with AI coding agents (Cursor / Claude Code / Codex / etc.).
Genex pairs a hosted in-browser editor with a local-file project on your disk. The CLI is the bridge: you (or your AI agent) author MonoBehaviour scripts in your IDE; the editor reflects your edits in real time via Yjs CRDT sync. There's nothing to deploy and nothing to host — npm install -g @genex-ai/cli and go.
Quick start
# 1. One-time auth (opens a browser, polls for approval)
npm install -g @genex-ai/cli
genex login
# 2. Scaffold a project (fast, no git by default)
genex create my-game
cd my-game
# 3. Start the file watcher + open the editor
genex devgenex dev prints an Editor: https://... URL — open it in your browser. You should see your scaffolded scene; the badge in the bottom-right reads "Synced · 1 CLI" when everything is connected.
Authoring rules
After genex create, the project directory has AGENTS.md / CLAUDE.md / .cursor/rules/genex.mdc. Your AI agent reads these before writing any code. They cover:
- The M3 script shape:
export default class MyScript extends MonoBehaviour { speed = 5; update(dt) {} } - Entity types:
cube/box/sphere/cylinder/character/terrain/camera - Input via
this.scene.input.key('KeyW')— NEVERwindow.addEventListener - The composite-rig pattern for multi-part vehicles / characters
- Visual composition principles (silhouette, scale-against-human, two-color rule)
If you're authoring by hand, skim AGENTS.md once and you're good.
Commands
| Command | What it does |
| ------------------------ | ---------------------------------------------------------------------------- |
| genex login | Browser-based auth. Stores a gnx_* token at ~/.genex/credentials. |
| genex create <name> | Scaffolds a new project. Adds --git to init a repo. |
| genex dev | Watches scripts/**/*.ts and optional gameDefinition.json; live-syncs to the editor. |
| genex animate <prompt> | Generates an animation clip into assets/animations/. |
| genex model <prompt> | Generates a 3D model into assets/models/. |
| genex splat <prompt> | Generates a Gaussian splat scene into assets/scenes/. |
| genex texture <prompt> | Generates a PBR texture set for primitives into assets/textures/. |
| genex npc <prompt> | Generates an NPC config + model + voice into assets/npcs/. |
| genex weapon <prompt> | Generates a weapon config + model into assets/weapons/. |
| genex outfit <prompt> | Generates a character outfit into assets/outfits/. |
Deployed by default
The CLI ships with the hosted Genex stack baked in — no env vars needed:
- Editor:
https://harness-edit.glotech.world - Server:
https://harness-server.glotech.world - Sync REST + WS:
https://harness-sync.glotech.world - Sync CRDT (Hocuspocus):
wss://harness-sync-crdt.glotech.world
If you're running your own deployment, override per-machine by putting four lines in ~/.genex/env:
GENEX_SYNC_URL=https://your-sync-domain
GENEX_HOCUSPOCUS_WS=wss://your-crdt-domain
GENEX_EDITOR_URL=https://your-editor-domain
GENEX_SERVER_URL=https://your-server-domainShell vars win over the file, so GENEX_EDITOR_URL=https://staging.example.com genex dev is a clean one-off override.
Configuration flags
| Flag / env var | Effect |
| --------------------------------------------- | --------------------------------------------------------- |
| genex create --git | Initialize a git repo + initial commit (off by default). |
| genex create --no-open | Skip opening the browser + IDE. |
| genex create --ide=<cursor\|code\|webstorm> | Open the specified IDE. |
| GENEX_AUTO_COMMIT=on | Enable genex dev's auto-commit-every-5-min loop. |
| GENEX_CRDT=off | Disable Hocuspocus client (LWW only — debugging). |
| GENEX_LWW=on | Re-enable legacy LWW REST push alongside Yjs (debugging). |
Project layout (after genex create my-game)
my-game/
├── .genex.json project metadata (+ link flag in engine-dev mode)
├── .env GENEX_API_KEY + GENEX_PROJECT_ID (gitignored)
├── .gitignore
├── CLAUDE.md your notes + @import of the package agent guide
├── AGENTS.md pointer to the package agent guide (Codex)
├── .cursor/rules/genex.mdc Cursor-format rules (alwaysApply) + guide pointer
├── README.md
├── tsconfig.json references engine types in node_modules/@genex-ai/cli
├── scripts/
│ ├── shared/PlayerController.ts
│ └── client/CameraController.ts
├── assets/
│ ├── animations/ models/ scenes/ textures/ npcs/ weapons/ outfits/
└── .claude/skills/ genex-* skills, placed by postinstall (genex sync-skills)The engine types, the agent guide (GUIDE.md), and the skills are
referenced from node_modules/@genex-ai/cli (not copied), so they update
automatically when the package updates. Run npm install after genex create
to populate them. Engine devs: set GENEX_LOCAL_REPO in .env and npm run
link to repoint at a local checkout.
Troubleshooting
genex login opens but never finishes — make sure you click "Approve" in the browser tab, and that the editor URL printed matches the one in the page.
genex dev can't reach the sync server — confirm your network can reach harness-sync.glotech.world (no VPN blocking it, etc.). If you're on a self-hosted deployment, double-check your ~/.genex/env URLs.
AI generation 401s — your token expired or was revoked. Re-run genex login.
The scaffolded .env carries no URLs — that's by design. The CLI re-resolves them from defaults / ~/.genex/env / shell env every command, so re-deployments don't break old projects.
License
UNLICENSED (proprietary). For demo and evaluation use only.
