@genex-ai/cli-demo 0.76.0-dev.195 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/index.js +30 -15
- package/package.json +1 -1
- package/templates/skills/genex-ai-skybox/SKILL.md +1 -1
- package/templates/skills/genex-ai-texture/SKILL.md +1 -1
- package/templates/skills/genex-ai-video/SKILL.md +1 -1
- package/templates/skills/genex-getting-started/SKILL.md +2 -2
- package/templates/skills/genex-threejs-game-content/SKILL.md +0 -15
- package/templates/skills/genex-threejs-skill-router/references/routing-map.md +1 -11
- package/templates/skills/genex-updates/SKILL.md +1 -1
- package/templates/skills/genex-explore/SKILL.md +0 -106
package/README.md
CHANGED
|
@@ -27,7 +27,6 @@ genex controller <type> # character|car|drone|touch|networked-physics → src
|
|
|
27
27
|
genex controller character --character <id> # install the Meshy-native adapter + manifest
|
|
28
28
|
genex controller anims <sel…> # download extra character animation clips (by tag or name) → public/assets/anims/
|
|
29
29
|
genex ui <tool> # local pixel toolbox for generated UI art: extract | masks | text-color | trim
|
|
30
|
-
genex explore ["<query>"] # search the curated community gallery (no query lists the whole catalog)
|
|
31
30
|
```
|
|
32
31
|
|
|
33
32
|
> **Invoking it.** First-time setup runs via `npx @genex-ai/cli-demo@latest init`.
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import fs from "fs";
|
|
|
8
8
|
import os from "os";
|
|
9
9
|
import path from "path";
|
|
10
10
|
import { fileURLToPath } from "url";
|
|
11
|
-
var RAW_CHANNEL = "
|
|
11
|
+
var RAW_CHANNEL = "latest";
|
|
12
12
|
var CLI_CHANNEL = RAW_CHANNEL === "dev" ? "dev" : "latest";
|
|
13
13
|
var STANDS = {
|
|
14
14
|
prod: { api: "https://api.genex.games", dashboard: "https://genex.games" },
|
|
@@ -287,13 +287,37 @@ async function hasGenexSkills(skillsDir) {
|
|
|
287
287
|
return false;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
|
|
290
|
+
var REMOVED_SKILLS = ["genex-explore"];
|
|
291
|
+
async function pruneRemovedSkills(skillsDir, log) {
|
|
292
|
+
const removed = [];
|
|
293
|
+
for (const name of REMOVED_SKILLS) {
|
|
294
|
+
const target = path3.join(skillsDir, name);
|
|
295
|
+
try {
|
|
296
|
+
await fs3.access(target);
|
|
297
|
+
} catch {
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
try {
|
|
301
|
+
await fs3.rm(target, { recursive: true });
|
|
302
|
+
removed.push(name);
|
|
303
|
+
} catch {
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (removed.length > 0) {
|
|
307
|
+
log?.plain(
|
|
308
|
+
`\u{1F9F9} Removed retired Genex skill${removed.length > 1 ? "s" : ""}: ${removed.join(", ")}`
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
return removed.length > 0;
|
|
312
|
+
}
|
|
313
|
+
async function syncSkillsForTarget(target, templatesDir = getTemplatesDir(), version = getCliVersion(), log) {
|
|
291
314
|
const skillsDir = path3.join(target.baseDir, "skills");
|
|
292
315
|
if (!await hasGenexSkills(skillsDir)) return false;
|
|
293
316
|
if (await readSkillsMarker(skillsDir) === version) return false;
|
|
294
317
|
const src = target.full ? templatesDir : path3.join(templatesDir, "skills");
|
|
295
318
|
const dest = target.full ? target.baseDir : skillsDir;
|
|
296
319
|
await copyTemplates(src, dest, { exclude: ["controllers"] });
|
|
320
|
+
await pruneRemovedSkills(skillsDir, log);
|
|
297
321
|
await writeSkillsMarker(skillsDir, version);
|
|
298
322
|
return true;
|
|
299
323
|
}
|
|
@@ -349,7 +373,7 @@ async function syncSkills(log) {
|
|
|
349
373
|
let refreshed = false;
|
|
350
374
|
for (const target of resolveAgentTargets()) {
|
|
351
375
|
try {
|
|
352
|
-
refreshed = await syncSkillsForTarget(target, templatesDir, version) || refreshed;
|
|
376
|
+
refreshed = await syncSkillsForTarget(target, templatesDir, version, log) || refreshed;
|
|
353
377
|
} catch {
|
|
354
378
|
}
|
|
355
379
|
}
|
|
@@ -1193,6 +1217,7 @@ async function runInit(opts) {
|
|
|
1193
1217
|
force: opts.force,
|
|
1194
1218
|
exclude: ["controllers"]
|
|
1195
1219
|
});
|
|
1220
|
+
await pruneRemovedSkills(path8.join(t.baseDir, "skills"), log);
|
|
1196
1221
|
await writeSkillsMarker(path8.join(t.baseDir, "skills"));
|
|
1197
1222
|
const added = copied.length - updated.length;
|
|
1198
1223
|
totalNew += added;
|
|
@@ -3963,7 +3988,7 @@ async function exploreReuseNudge(log, meta, cwd = process.cwd()) {
|
|
|
3963
3988
|
if (!meta.exploreRanAt || meta.reuseNudgedAt) return;
|
|
3964
3989
|
if (await borrowEvidence(meta, cwd)) return;
|
|
3965
3990
|
log.warn(
|
|
3966
|
-
"This project browsed the curated catalog (genex explore) but no borrowed catalog project is visible in the game. If the plan mapped systems to the catalog \u2014 grass, terrain, water, vehicles \u2014 land those borrows or cancel each in one plain line to the user: a planned borrow that silently becomes hand-rolled code is a scope cut.
|
|
3991
|
+
"This project browsed the curated catalog (genex explore) but no borrowed catalog project is visible in the game. If the plan mapped systems to the catalog \u2014 grass, terrain, water, vehicles \u2014 land those borrows or cancel each in one plain line to the user: a planned borrow that silently becomes hand-rolled code is a scope cut."
|
|
3967
3992
|
);
|
|
3968
3993
|
meta.reuseNudgedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
3969
3994
|
try {
|
|
@@ -15322,7 +15347,7 @@ async function runExplore(opts) {
|
|
|
15322
15347
|
}
|
|
15323
15348
|
log.plain("");
|
|
15324
15349
|
log.plain(
|
|
15325
|
-
`To use one: clone it as a starting template, or borrow parts into your current game
|
|
15350
|
+
`To use one: clone it as a starting template, or borrow parts into your current game. Keep the credits.`
|
|
15326
15351
|
);
|
|
15327
15352
|
}
|
|
15328
15353
|
function rank(items, query) {
|
|
@@ -15390,9 +15415,6 @@ ${c.bold("Usage")}
|
|
|
15390
15415
|
genex controller anims <sel \u2026> Install legacy VRM + UAL animation clips by tag/name
|
|
15391
15416
|
into public/assets/anims/. --list shows the catalog;
|
|
15392
15417
|
--reset forgets the previous selection first.
|
|
15393
|
-
genex explore ["<query>"] [options] Search the curated community gallery \u2014 proven
|
|
15394
|
-
Three.js systems you can clone or borrow parts
|
|
15395
|
-
from. No query lists the whole catalog.
|
|
15396
15418
|
genex ui <tool> [options] Local pixel toolbox for generated UI art \u2014
|
|
15397
15419
|
extract | masks | text-color | trim | audit.
|
|
15398
15420
|
Pure local work (no API); the PNG tools read
|
|
@@ -15468,11 +15490,6 @@ ${c.bold("Options for `preview` / `publish`")}
|
|
|
15468
15490
|
--api-url <url> (publish) Override the API base URL.
|
|
15469
15491
|
--env <path> Token env file (default: ~/.genex/env).
|
|
15470
15492
|
|
|
15471
|
-
${c.bold("Options for `explore`")}
|
|
15472
|
-
--json Print the matches as JSON (for tools/agents).
|
|
15473
|
-
--api-url <url> Override the API base URL.
|
|
15474
|
-
(No query at all lists the entire curated catalog.)
|
|
15475
|
-
|
|
15476
15493
|
${c.bold("Options for `list`")}
|
|
15477
15494
|
--json Print your games as JSON (all fields, incl. play/clone URLs).
|
|
15478
15495
|
--api-url <url> Override the API base URL.
|
|
@@ -15552,8 +15569,6 @@ ${c.bold("Examples")}
|
|
|
15552
15569
|
genex controller anims sword pistol
|
|
15553
15570
|
genex controller touch
|
|
15554
15571
|
genex controller networked-physics
|
|
15555
|
-
genex explore "grass"
|
|
15556
|
-
genex explore
|
|
15557
15572
|
`;
|
|
15558
15573
|
function parseArgs(argv) {
|
|
15559
15574
|
const parsed = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/cli-demo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0",
|
|
4
4
|
"description": "Set up your project's agent workspace (.claude/.codex/.cursor in the game folder), authorize, create a game project, generate AI assets, and publish (genex CLI).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -87,7 +87,7 @@ scene.background = texture; // keep the raw texture for the visible sky
|
|
|
87
87
|
|
|
88
88
|
## Troubleshooting
|
|
89
89
|
|
|
90
|
-
- **"Not authorized"** — run `npx @genex-ai/cli-demo@
|
|
90
|
+
- **"Not authorized"** — run `npx @genex-ai/cli-demo@latest init` first (it writes your `GENEX_TOKEN`).
|
|
91
91
|
- **"Out of credits" (`insufficient_credits`)** — the account has no credits left for
|
|
92
92
|
this skybox generation. Tell the user the facts the CLI printed: their balance, this
|
|
93
93
|
generation's cost, and when their credits refill. Then offer to continue the build
|
|
@@ -225,7 +225,7 @@ first one is the one a screenshot of the whole arena will not show you.
|
|
|
225
225
|
|
|
226
226
|
## Troubleshooting
|
|
227
227
|
|
|
228
|
-
- **"Not authorized"** — run `npx @genex-ai/cli-demo@
|
|
228
|
+
- **"Not authorized"** — run `npx @genex-ai/cli-demo@latest init` first (it writes your `GENEX_TOKEN`).
|
|
229
229
|
- **"Out of credits" (`insufficient_credits`)** — the account has no credits left for
|
|
230
230
|
this texture generation. Tell the user the facts the CLI printed: their balance,
|
|
231
231
|
this generation's cost, and when their credits refill. Then offer to continue the
|
|
@@ -145,7 +145,7 @@ set belongs to `$genex-ai-hud` — both build on `npx genex image`/`video`.
|
|
|
145
145
|
|
|
146
146
|
## Troubleshooting
|
|
147
147
|
|
|
148
|
-
- **"Not authorized"** — run `npx @genex-ai/cli-demo@
|
|
148
|
+
- **"Not authorized"** — run `npx @genex-ai/cli-demo@latest init` first (it writes your `GENEX_TOKEN`).
|
|
149
149
|
- **"Prompt rejected"** — the provider's content-safety filter blocked the prompt.
|
|
150
150
|
This is non-retryable; retrying the same wording fails again. Rewrite the prompt.
|
|
151
151
|
- **Nothing plays / black surface** — the first `video.play()` must run inside a user
|
|
@@ -130,7 +130,7 @@ and re-link the clone to the same live game:
|
|
|
130
130
|
```bash
|
|
131
131
|
git clone <the game's repo url> my-game && cd my-game
|
|
132
132
|
npm install
|
|
133
|
-
npx @genex-ai/cli-demo@
|
|
133
|
+
npx @genex-ai/cli-demo@latest link <slug> # slug = the name in the play URL
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
Don't know the slug? **`npx genex list`** prints every game on your account —
|
|
@@ -157,7 +157,7 @@ Safe to run any time — genex-owned skills are refreshed to the latest version,
|
|
|
157
157
|
and your own files are never touched:
|
|
158
158
|
|
|
159
159
|
```bash
|
|
160
|
-
npx @genex-ai/cli-demo@
|
|
160
|
+
npx @genex-ai/cli-demo@latest init
|
|
161
161
|
```
|
|
162
162
|
|
|
163
163
|
Use `--force` only if you intentionally want your own existing files overwritten
|
|
@@ -56,18 +56,6 @@ Rules that make the contract real:
|
|
|
56
56
|
- **Minute ten is the design test.** If the honest answer is "the same sixty
|
|
57
57
|
seconds, again", the contract needs another beat (a new area unlocks, a
|
|
58
58
|
quest chain escalates, a build comes online) before any polish work.
|
|
59
|
-
- **Close it with the reuse sweep.** Run `npx genex explore` once (no query)
|
|
60
|
-
and map the contract's systems against the curated catalog — proven ports
|
|
61
|
-
of terrain, grass, water, vehicles, combat feel, buildings, dungeons exist
|
|
62
|
-
there to clone or borrow with credits (`$genex-explore` has the steps). One
|
|
63
|
-
reuse line per matched system; an empty catalog is a one-line note.
|
|
64
|
-
- **The sweep binds at build time, not just plan time.** Every clone/borrow
|
|
65
|
-
line stays an open item until it is either landed or cancelled out loud:
|
|
66
|
-
when that system comes up for real work — in v0 or any upgrade round — load
|
|
67
|
-
`$genex-explore` and follow its borrow steps, or tell the user in one line
|
|
68
|
-
why you're now building it fresh after all. A planned borrow that silently
|
|
69
|
-
turns into hand-rolled primitives is a scope cut like any other. (A "build
|
|
70
|
-
fresh, because X" line was decided at plan time — no re-announcement.)
|
|
71
59
|
- **The `ground:` line is a decision, not a default.** Flat is fine when
|
|
72
60
|
DECIDED — but the concept frame the user approved is a promise: if it shows
|
|
73
61
|
rolling hills or a shoreline and the game ships a flat plane, that visible
|
|
@@ -207,8 +195,5 @@ owns the authority rules.
|
|
|
207
195
|
- The contract posted, then quietly abandoned when the first slice previewed
|
|
208
196
|
well — the slice is a milestone, not the destination.
|
|
209
197
|
- Contract lines silently shrunk without a structured question to the user.
|
|
210
|
-
- A reuse line from the sweep ("borrow the grass system from the catalog")
|
|
211
|
-
silently replaced by hand-rolled primitives — landed or cancelled out loud,
|
|
212
|
-
never quietly dropped.
|
|
213
198
|
- The approved concept frame shows rolling hills or water; the game ships one
|
|
214
199
|
flat plane and nobody said so.
|
|
@@ -34,17 +34,7 @@ Three.js release or branch, and do not blindly copy demo architecture.
|
|
|
34
34
|
`AskUserQuestion`; Codex: `request_user_input`; if none, e.g. Cursor, a
|
|
35
35
|
short numbered list in chat) — a
|
|
36
36
|
"vertical slice first" is a build order, never a license to shrink the
|
|
37
|
-
destination silently.
|
|
38
|
-
`npx genex explore` once (no query) and map the plan's systems against the
|
|
39
|
-
curated catalog — proven ports of terrain, grass, water, vehicles, combat
|
|
40
|
-
feel, buildings, dungeons exist there to clone or borrow (credits carried,
|
|
41
|
-
`$genex-explore` has the integration steps). One reuse line per matched
|
|
42
|
-
system in the plan (clone as base / borrow parts / build fresh because X);
|
|
43
|
-
hand-building a system the catalog already proves is the waste this sweep
|
|
44
|
-
exists to prevent. An empty catalog is a one-line note, not a blocker.
|
|
45
|
-
Clone/borrow lines bind at build time too: each is landed or cancelled out
|
|
46
|
-
loud when its system gets built — never silently swapped for hand-rolled
|
|
47
|
-
primitives (build-fresh lines are already decided).
|
|
37
|
+
destination silently.
|
|
48
38
|
2. Wire player identity before any boot code: `$genex-threejs-embed-auth` is
|
|
49
39
|
mandatory for every game (`initEmbed(...)` + the `waitForPlayer()` gate) —
|
|
50
40
|
saves, leaderboards, and multiplayer auth all come from it.
|
|
@@ -38,7 +38,7 @@ update, so update immediately.)
|
|
|
38
38
|
Run exactly the command the nudge printed, from the game project root:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
npm i -D @genex-ai/cli-demo@
|
|
41
|
+
npm i -D @genex-ai/cli-demo@latest # the genex CLI (a dev dependency)
|
|
42
42
|
npm i @genex-ai/embed-sdk@latest # identity/saves SDK (ships inside the game)
|
|
43
43
|
npm i @genex-ai/multiplayer@latest # multiplayer SDK (only if the game uses it)
|
|
44
44
|
```
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: genex-explore
|
|
3
|
-
description: Search the curated Genex community gallery with `npx genex explore` — once at the planning stage (the plan sweep, browse the catalog against the game plan and state reuse decisions) and again before hand-writing any hard system. Use when planning a new game, or when it needs terrain, grass, water, vehicles, buildings, dungeons, flocking, or advanced shaders — proven open-source Three.js implementations to clone or borrow from, credits included.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Genex Explore — proven building blocks from the community gallery
|
|
7
|
-
|
|
8
|
-
Some systems are notoriously hard to get right from scratch: believable grass,
|
|
9
|
-
vehicle physics, procedural buildings and dungeons, fish/boid flocking, water,
|
|
10
|
-
advanced shader effects. The curated community gallery holds **faithful ports of
|
|
11
|
-
proven open-source Three.js projects** — playable, cloneable, and licensed for
|
|
12
|
-
reuse. Search it before hand-writing one of those systems.
|
|
13
|
-
|
|
14
|
-
## The plan sweep — once per game, right after the plan is written
|
|
15
|
-
|
|
16
|
-
The moment the game contract (and the content contract, when there is one) is
|
|
17
|
-
on the table, run the catalog against it ONCE:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npx genex explore
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
No query — the catalog is small and every entry is proven, so one browse
|
|
24
|
-
covers the whole plan at once. Then walk the plan's systems (terrain, grass,
|
|
25
|
-
water, vehicles, combat feel, buildings, dungeons…) and for each one that a
|
|
26
|
-
catalog entry serves, state a reuse decision in the plan, one line each:
|
|
27
|
-
**clone as the base** / **borrow parts** (see below) / **build fresh, because
|
|
28
|
-
X**. Not deciding is the failure — a session that hand-builds a grass field
|
|
29
|
-
while a proven grass system sits in the catalog wasted its minutes on a
|
|
30
|
-
solved problem. If the catalog comes back empty on this stand, say so in one
|
|
31
|
-
line and move on — the sweep costs one command either way.
|
|
32
|
-
|
|
33
|
-
The clone/borrow lines bind at BUILD time too: each stays an open item until
|
|
34
|
-
the borrow lands or you cancel it in one plain line to the user ("build
|
|
35
|
-
fresh, because X" lines are already decided — nothing to re-announce). A
|
|
36
|
-
"borrow the grass system" that quietly ships as hand-rolled cones never went
|
|
37
|
-
through anyone's decision — it's a scope cut. (`genex preview` reminds you
|
|
38
|
-
once if it sees a browsed catalog and zero visible borrows.)
|
|
39
|
-
|
|
40
|
-
## When to use again — before any hard system
|
|
41
|
-
|
|
42
|
-
Later in the build, before hand-writing a hard visual/physics system the plan
|
|
43
|
-
didn't foresee, run:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx genex explore "<what you need>"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Examples: `npx genex explore "grass"`, `npx genex explore "vehicle physics"`,
|
|
50
|
-
`npx genex explore "procedural building"`. No sign-in needed — this works even
|
|
51
|
-
before `genex init`.
|
|
52
|
-
|
|
53
|
-
**Not sure what exists?** Run it with no arguments to browse the whole curated
|
|
54
|
-
catalog first — it's small and every entry is proven:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npx genex explore
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Each result prints everything you need to act on it:
|
|
61
|
-
|
|
62
|
-
- `play:` — open it in the browser to judge whether it fits.
|
|
63
|
-
- `clone:` — the public repo with **editable source on `main`**.
|
|
64
|
-
- `upstream:` — the original source repo, with its author and license.
|
|
65
|
-
|
|
66
|
-
Add `--json` for machine-readable output.
|
|
67
|
-
|
|
68
|
-
## How to integrate a result
|
|
69
|
-
|
|
70
|
-
**As a NEW game (start from the whole project):**
|
|
71
|
-
|
|
72
|
-
1. `git clone <clone URL from the output> <name>` — pick a short one-word name.
|
|
73
|
-
2. `cd <name>`, then run init on the SAME CLI channel your current project
|
|
74
|
-
uses: `npx @genex-ai/cli-demo@dev init <name>` — or `@dev` when you're
|
|
75
|
-
on the dev stand (unsure? `dashboardOrigins` in your current project's
|
|
76
|
-
`.genex/project.json` says which). Never use `--force`. This creates your
|
|
77
|
-
own project; the original is untouched.
|
|
78
|
-
3. `npm install`, keep `base: './'` in `vite.config`, then build your changes
|
|
79
|
-
and ship with `npx genex preview`.
|
|
80
|
-
|
|
81
|
-
**To BORROW parts into the current project:**
|
|
82
|
-
|
|
83
|
-
1. Clone the result somewhere temporary, separate from your project
|
|
84
|
-
(e.g. `/tmp/genex-explore-src`).
|
|
85
|
-
2. Study how it implements the part you need, then bring **just that** over —
|
|
86
|
-
real code and assets, adapted to your file paths. Don't wholesale-overwrite
|
|
87
|
-
your game.
|
|
88
|
-
3. Reused assets must live under `public/assets/` to ship. New assets are
|
|
89
|
-
generated as usual with `$genex-ai-model`, `$genex-ai-skybox`,
|
|
90
|
-
`$genex-ai-sfx`, or `$genex-ai-texture`.
|
|
91
|
-
|
|
92
|
-
## Credits rule (non-negotiable)
|
|
93
|
-
|
|
94
|
-
Every curated result carries an upstream link, author, and license — that
|
|
95
|
-
credit is part of the deal that makes these projects reusable. Whatever you
|
|
96
|
-
build from one:
|
|
97
|
-
|
|
98
|
-
- keep the attribution block in the README (upstream source repo URL, author,
|
|
99
|
-
license) exactly as the port carries it;
|
|
100
|
-
- keep any in-game credits screens or notices in place;
|
|
101
|
-
- carry the credit into anything you publish or remix from it.
|
|
102
|
-
|
|
103
|
-
If nothing matches your query, run `npx genex explore` with no arguments to
|
|
104
|
-
see everything available, or try a broader term (terrain, grass, vehicle,
|
|
105
|
-
water, building, dungeon, fish, shader) — or build it with the regular
|
|
106
|
-
`genex-threejs-*` skills instead.
|