@onceworlds/cli 0.9.0 → 0.9.2
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 +21 -11
- package/dist/cli.js +1176 -317
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ players) with no server code.
|
|
|
7
7
|
## Deploy from GitHub Actions
|
|
8
8
|
|
|
9
9
|
Deploys run from GitHub Actions: GitHub vouches for the repo, so there are no API
|
|
10
|
-
keys. The easiest setup is to import the repo at https://onceworlds.com/
|
|
10
|
+
keys. The easiest setup is to import the repo at https://onceworlds.com/create?new=github,
|
|
11
11
|
which adds `onceworlds.json` and `.github/workflows/onceworlds.yml` for you (that
|
|
12
12
|
workflow also builds with npm, pnpm, yarn or bun when there's a build script). To write
|
|
13
13
|
the same files into a folder before it is on GitHub, run `npx @onceworlds/cli init` there.
|
|
@@ -83,10 +83,11 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
83
83
|
|
|
84
84
|
## Commands
|
|
85
85
|
|
|
86
|
-
- `onceworlds new [folder] --kit <name>` starts a game from a kit: a
|
|
87
|
-
(`--list` shows them)
|
|
88
|
-
|
|
89
|
-
does, what to change, its tests) as `KIT.md
|
|
86
|
+
- `onceworlds new [folder] --kit <name>` starts a game from a kit: a working skeleton on the engine (rules, netcode, Flow,
|
|
87
|
+
bots and tests), one per kind of game (`--list` shows them); its look and screens are placeholders to replace. It writes the
|
|
88
|
+
kit with an `onceworlds.json` for your game (`--name`, `--slug`, `--description`; the folder's name by default), the engine
|
|
89
|
+
guide as `AGENTS.md` and `CLAUDE.md`, the kit's own notes (what each file does, what to change, its tests) as `KIT.md`, and
|
|
90
|
+
a `DESIGN.md` to fill in first (the hook, the first minute, the art direction, the UI and a pre-build check). `--template party` or `starter` starts a small game on the SDK alone.
|
|
90
91
|
- `onceworlds check [dir]` is what to run before a deploy: doctor's findings and, for an engine game, the game's own tests
|
|
91
92
|
(`npm test`) and simulated matches played with no browser, with a reloaded host, a dropped player, the host changing (also while
|
|
92
93
|
paused), a late joiner and garbage messages. A failing test or a match with errors exits with an error. The game's config is
|
|
@@ -101,10 +102,12 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
101
102
|
- `onceworlds init [dir]` sets a game folder up, with the files the dashboard's import commits. It writes
|
|
102
103
|
`onceworlds.json` (the link and name come from `package.json`'s name or the folder's; `dir` is your build's
|
|
103
104
|
output folder when `package.json` has a build script, else `.` or the folder with your `index.html`),
|
|
104
|
-
`.github/workflows/onceworlds.yml`, and the
|
|
105
|
+
`.github/workflows/onceworlds.yml`, a `.gitignore` (`node_modules/` and the pictures `shot` saves; to one you have it adds only
|
|
106
|
+
those lines, once), and the guide for AI coding tools as `AGENTS.md` with a `CLAUDE.md` that
|
|
105
107
|
imports it (next to a `AGENTS.md` of your own it writes `ONCEWORLDS.md` and adds a pointer to yours). It never
|
|
106
|
-
overwrites a file you have: `--force` replaces only what init writes, never your own `AGENTS.md
|
|
107
|
-
|
|
108
|
+
overwrites a file you have: `--force` replaces only what init writes, never your own `AGENTS.md`, `CLAUDE.md` or `.gitignore`.
|
|
109
|
+
`onceworlds new` writes the same workflow and `.gitignore` into every game it makes.
|
|
110
|
+
Then commit, push, and import the repo at https://onceworlds.com/create?new=github.
|
|
108
111
|
- `onceworlds deploy [dir]` uploads only the files that changed and publishes the game
|
|
109
112
|
(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.
|
|
110
113
|
- `onceworlds dev [dir]` deploys to a local Onceworlds platform (for platform development)
|
|
@@ -116,7 +119,11 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
116
119
|
shared time and no use of the platform's lobby. For an engine game it also reads the action map
|
|
117
120
|
and offers the `controls` it implies: `--fix` writes them into `onceworlds.json` when it has none. For an installed engine
|
|
118
121
|
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
|
|
122
|
+
from the source text (`Input.axis2d`, `Input.button`) and may differ. It checks `onceworlds.json` by every rule a deploy applies
|
|
123
|
+
(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
|
+
would; the rest only suggests (`--strict` exits with an error on likely bugs, for CI). `check` does the same. For an engine
|
|
125
|
+
game on Flow it also says what still looks like a kit (Flow's placeholder screens, the default theme), a 3-2-1 of the game's
|
|
126
|
+
own beside Flow's, a `DESIGN.md` left empty, and a first round no different from the rest.
|
|
120
127
|
|
|
121
128
|
- `onceworlds api <name or words>` looks the engine up in a few lines instead of the whole reference: a signature, what it
|
|
122
129
|
does, a component's fields or an options object's keys, and an example (`api Shape2D`, `api feel.shake`, `api "camera follow"`;
|
|
@@ -125,9 +132,12 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
125
132
|
`onceworlds guide [topic]` the engine guide's topics or any heading of the guide or the reference. They read the index of the
|
|
126
133
|
engine installed in the game's `node_modules` (its own version), else the platform's.
|
|
127
134
|
- `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`),
|
|
135
|
+
with bots (`--at 20`), the title screen (`--phase title`) or the lobby (`--phase lobby`), or a poster (`--poster cover`), at
|
|
136
|
+
`--size 1280x720` by default. A 2D game is drawn with no browser, from
|
|
129
137
|
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`).
|
|
138
|
+
copy of the game. `--out` picks the file (default `store/shot.png`). `--story` plays the first minute as a new player lives it
|
|
139
|
+
(the title, the lobby, the countdown, the round's goal, play at +1, +5 and +12 s, the first result), saves each frame into
|
|
140
|
+
`store/story/` and lays them out on one contact sheet, `store/story.png`, with the questions to ask of it.
|
|
131
141
|
|
|
132
142
|
Running `onceworlds mcp` gives an AI tool the same as tools: `api_lookup`, `recipe`, `read_guide`, `search_assets` (the engine's
|
|
133
143
|
asset library), `check`, `screenshot` (the picture comes back to the model), `new_game`, `deploy_preview`, `playtest` and
|