@onceworlds/cli 0.7.0 → 0.9.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 +26 -7
- package/dist/cli.js +4436 -621
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,15 +85,18 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
85
85
|
|
|
86
86
|
- `onceworlds new [folder] --kit <name>` starts a game from a kit: a complete game on the engine, one per kind of game
|
|
87
87
|
(`--list` shows them). It writes the kit with an `onceworlds.json` for your game (`--name`, `--slug`, `--description`;
|
|
88
|
-
the folder's name by default)
|
|
89
|
-
small game on the SDK alone.
|
|
88
|
+
the folder's name by default), the engine guide as `AGENTS.md` and `CLAUDE.md`, and the kit's own notes (what each file
|
|
89
|
+
does, what to change, its tests) as `KIT.md`. `--template party` or `starter` starts a small game on the SDK alone.
|
|
90
90
|
- `onceworlds check [dir]` is what to run before a deploy: doctor's findings and, for an engine game, the game's own tests
|
|
91
91
|
(`npm test`) and simulated matches played with no browser, with a reloaded host, a dropped player, the host changing (also while
|
|
92
92
|
paused), a late joiner and garbage messages. A failing test or a match with errors exits with an error. The game's config is
|
|
93
93
|
read from `game.config.js` (or `src/game.config.js`, or `--config <file>`): `export const config = {...}`, and `export const actions`
|
|
94
|
-
lets check compare "How to play" with the action map exactly. Needs `npm install` in the game folder.
|
|
94
|
+
lets check compare "How to play" with the action map exactly. Needs `npm install` in the game folder. Simulated players only ready
|
|
95
|
+
up, so a game with long rounds or turn timers may not reach its results in the time check has: `export const quick = ...` from
|
|
96
|
+
the same file (the game with one short round and short timers) and check plays that. A process that outlives its time limit
|
|
97
|
+
is killed with everything it started.
|
|
95
98
|
- `onceworlds posters [dir]` draws each `game.poster()` scene of your latest draft (`?poster=<name>`) in a browser on this
|
|
96
|
-
computer and saves the pictures into `store
|
|
99
|
+
computer and saves the pictures into `store/` (a poster name is letters, digits, dashes, underscores and dots, as in the engine), naming them in `onceworlds.json` when it has no icon or thumbnails.
|
|
97
100
|
`--only cover,icon` picks some.
|
|
98
101
|
- `onceworlds init [dir]` sets a game folder up, with the files the dashboard's import commits. It writes
|
|
99
102
|
`onceworlds.json` (the link and name come from `package.json`'s name or the folder's; `dir` is your build's
|
|
@@ -103,7 +106,7 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
103
106
|
overwrites a file you have: `--force` replaces only what init writes, never your own `AGENTS.md` or `CLAUDE.md`.
|
|
104
107
|
Then commit, push, and import the repo at https://onceworlds.com/dashboard/new.
|
|
105
108
|
- `onceworlds deploy [dir]` uploads only the files that changed and publishes the game
|
|
106
|
-
(the workflow runs it). It lists every file it skipped because Onceworlds can't serve it.
|
|
109
|
+
(the workflow runs it). It lists every file it skipped because Onceworlds can't serve it. A game's tests never go up: `*.test.js`, `vitest.config.*` and the `test/` folder at the top of the game.
|
|
107
110
|
- `onceworlds dev [dir]` deploys to a local Onceworlds platform (for platform development)
|
|
108
111
|
and redeploys on every save. `--players 3` also prints links for players 2 and 3 (`?player=N`): on a
|
|
109
112
|
local platform each is another player, so one person can fill a lobby.
|
|
@@ -111,8 +114,24 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
111
114
|
tag, text fields under 16px (Safari zooms the page when one is focused), `confirm()` and other dialogs
|
|
112
115
|
(blocked in the game frame), localStorage (gone on reload), and, for games with rooms, `Date.now()` for
|
|
113
116
|
shared time and no use of the platform's lobby. For an engine game it also reads the action map
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
and offers the `controls` it implies: `--fix` writes them into `onceworlds.json` when it has none. For an installed engine
|
|
118
|
+
game the list is the engine's own (`controlsFromActions` on the `actions` that `game.config.js` exports); otherwise it is read
|
|
119
|
+
from the source text (`Input.axis2d`, `Input.button`) and may differ. It only suggests: nothing in it stops a deploy (`--strict` exits with an error on likely bugs, for CI).
|
|
120
|
+
|
|
121
|
+
- `onceworlds api <name or words>` looks the engine up in a few lines instead of the whole reference: a signature, what it
|
|
122
|
+
does, a component's fields or an options object's keys, and an example (`api Shape2D`, `api feel.shake`, `api "camera follow"`;
|
|
123
|
+
`--full` for every field with its doc). `onceworlds recipe [name]` prints short, tested code for a kind of game or a feature
|
|
124
|
+
(tycoon, survival, racing, platformer, shooter, party, rpg, idle, sandbox, chase-ai, inventory, shop, dialogue, day-night), and
|
|
125
|
+
`onceworlds guide [topic]` the engine guide's topics or any heading of the guide or the reference. They read the index of the
|
|
126
|
+
engine installed in the game's `node_modules` (its own version), else the platform's.
|
|
127
|
+
- `onceworlds shot [dir]` saves a picture of the game to look at: the first player's screen a few seconds into a simulated match
|
|
128
|
+
with bots (`--at 20`), or a poster (`--poster cover`), at `--size 1280x720` by default. A 2D game is drawn with no browser, from
|
|
129
|
+
the frame the engine draws, in the engine's font; a 3D game (or `--browser`) is drawn by Chrome, Chromium or Edge from a local
|
|
130
|
+
copy of the game. `--out` picks the file (default `store/shot.png`).
|
|
131
|
+
|
|
132
|
+
Running `onceworlds mcp` gives an AI tool the same as tools: `api_lookup`, `recipe`, `read_guide`, `search_assets` (the engine's
|
|
133
|
+
asset library), `check`, `screenshot` (the picture comes back to the model), `new_game`, `deploy_preview`, `playtest` and
|
|
134
|
+
`game_status`.
|
|
116
135
|
|
|
117
136
|
Games talk to the platform through the injected `window.onceworlds` SDK. The
|
|
118
137
|
starter template's `AGENTS.md` documents it for AI coding tools.
|