@onceworlds/cli 0.9.2 → 0.9.4
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 +20 -10
- package/dist/cli.js +1056 -271
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,11 +83,14 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
83
83
|
|
|
84
84
|
## Commands
|
|
85
85
|
|
|
86
|
-
- `onceworlds new [folder]
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
- `onceworlds new [folder]` starts a game: a blank engine project (`--space 3d` for 3D) with nothing that decides the game, only
|
|
87
|
+
the wiring: a `game.config.js` with a camera and an empty action map, a test that plays it through a reloaded host and a dropped
|
|
88
|
+
player, an `onceworlds.json` for your game (`--name`, `--slug`, `--description`; the folder's name by default), the engine guide
|
|
89
|
+
as `AGENTS.md` and `CLAUDE.md`, and a `DESIGN.md` to fill in first (the hook and signature mechanic, an originality pass, the first
|
|
90
|
+
minute, the art direction, the feel, the UI and a pre-build check). `--kit <name>` starts from a kit instead: a complete game of
|
|
91
|
+
one kind (`--list` shows them), a reference for its plumbing (rooms, netcode, Flow, bots, tests) whose idea, look and screens are
|
|
92
|
+
never yours. A kit adds its own notes as `KIT.md` and its fingerprints as `.onceworlds/kit.json`, so `check` can note what is
|
|
93
|
+
still the kit's. `--template party` or `starter` starts a small game on the SDK alone.
|
|
91
94
|
- `onceworlds check [dir]` is what to run before a deploy: doctor's findings and, for an engine game, the game's own tests
|
|
92
95
|
(`npm test`) and simulated matches played with no browser, with a reloaded host, a dropped player, the host changing (also while
|
|
93
96
|
paused), a late joiner and garbage messages. A failing test or a match with errors exits with an error. The game's config is
|
|
@@ -102,7 +105,7 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
102
105
|
- `onceworlds init [dir]` sets a game folder up, with the files the dashboard's import commits. It writes
|
|
103
106
|
`onceworlds.json` (the link and name come from `package.json`'s name or the folder's; `dir` is your build's
|
|
104
107
|
output folder when `package.json` has a build script, else `.` or the folder with your `index.html`),
|
|
105
|
-
`.github/workflows/onceworlds.yml`, a `.gitignore` (`node_modules/` and the pictures `shot`
|
|
108
|
+
`.github/workflows/onceworlds.yml`, a `.gitignore` (`node_modules/` and the pictures `shot` and `shot --story` save; to one you have it adds only
|
|
106
109
|
those lines, once), and the guide for AI coding tools as `AGENTS.md` with a `CLAUDE.md` that
|
|
107
110
|
imports it (next to a `AGENTS.md` of your own it writes `ONCEWORLDS.md` and adds a pointer to yours). It never
|
|
108
111
|
overwrites a file you have: `--force` replaces only what init writes, never your own `AGENTS.md`, `CLAUDE.md` or `.gitignore`.
|
|
@@ -110,6 +113,11 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
110
113
|
Then commit, push, and import the repo at https://onceworlds.com/create?new=github.
|
|
111
114
|
- `onceworlds deploy [dir]` uploads only the files that changed and publishes the game
|
|
112
115
|
(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.
|
|
116
|
+
- `onceworlds serve [dir]` plays the game in your own browser on this computer, offline and with no login: it serves the folder
|
|
117
|
+
(onceworlds.json's `dir`) with the import map the platform adds for the engine (the installed package's files, else the hosted
|
|
118
|
+
copy of the engine this CLI ships with). With no platform around it the engine's stand-in is the platform: you alone in a room
|
|
119
|
+
of your own, the lobby's Start button (engine 1.3.2 on; older ones start a match with `?autoplay`), saves in memory, and
|
|
120
|
+
`--bots 3` (the default) bots beside you in a game whose roster gives bots a body. `--port` picks the port (default 8788).
|
|
113
121
|
- `onceworlds dev [dir]` deploys to a local Onceworlds platform (for platform development)
|
|
114
122
|
and redeploys on every save. `--players 3` also prints links for players 2 and 3 (`?player=N`): on a
|
|
115
123
|
local platform each is another player, so one person can fill a lobby.
|
|
@@ -122,8 +130,10 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
122
130
|
from the source text (`Input.axis2d`, `Input.button`) and may differ. It checks `onceworlds.json` by every rule a deploy applies
|
|
123
131
|
(lengths, genres, badges, How to play, the pictures it names), in the deploy's words and with the fix, and fails as the deploy
|
|
124
132
|
would; the rest only suggests (`--strict` exits with an error on likely bugs, for CI). `check` does the same. For an engine
|
|
125
|
-
game
|
|
126
|
-
|
|
133
|
+
game it also says when `DESIGN.md` is missing or has parts left empty (the originality pass included), and notes a game still
|
|
134
|
+
close to the kit it started from (scripts unchanged, the kit's numbers, its screens). For a game on Flow it says what still
|
|
135
|
+
looks like a kit (Flow's placeholder screens, the default theme), a 3-2-1 of the game's own beside Flow's, and a first round
|
|
136
|
+
no different from the rest. Taste is the game's: these are warnings and notes, never a failure.
|
|
127
137
|
|
|
128
138
|
- `onceworlds api <name or words>` looks the engine up in a few lines instead of the whole reference: a signature, what it
|
|
129
139
|
does, a component's fields or an options object's keys, and an example (`api Shape2D`, `api feel.shake`, `api "camera follow"`;
|
|
@@ -140,8 +150,8 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
140
150
|
`store/story/` and lays them out on one contact sheet, `store/story.png`, with the questions to ask of it.
|
|
141
151
|
|
|
142
152
|
Running `onceworlds mcp` gives an AI tool the same as tools: `api_lookup`, `recipe`, `read_guide`, `search_assets` (the engine's
|
|
143
|
-
asset library), `check`, `screenshot` (the picture comes back to the model), `
|
|
144
|
-
`game_status`.
|
|
153
|
+
asset library), `check`, `screenshot` (the picture comes back to the model), `serve` (an address for the user to play it at),
|
|
154
|
+
`new_game`, `deploy_preview`, `playtest` and `game_status`.
|
|
145
155
|
|
|
146
156
|
Games talk to the platform through the injected `window.onceworlds` SDK. The
|
|
147
157
|
starter template's `AGENTS.md` documents it for AI coding tools.
|