@onceworlds/cli 0.8.0 → 0.9.1
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 +25 -5
- package/dist/cli.js +4287 -548
- 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.
|
|
@@ -101,10 +101,12 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
101
101
|
- `onceworlds init [dir]` sets a game folder up, with the files the dashboard's import commits. It writes
|
|
102
102
|
`onceworlds.json` (the link and name come from `package.json`'s name or the folder's; `dir` is your build's
|
|
103
103
|
output folder when `package.json` has a build script, else `.` or the folder with your `index.html`),
|
|
104
|
-
`.github/workflows/onceworlds.yml`, and the
|
|
104
|
+
`.github/workflows/onceworlds.yml`, a `.gitignore` (`node_modules/` and the pictures `shot` saves; to one you have it adds only
|
|
105
|
+
those lines, once), and the guide for AI coding tools as `AGENTS.md` with a `CLAUDE.md` that
|
|
105
106
|
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
|
-
|
|
107
|
+
overwrites a file you have: `--force` replaces only what init writes, never your own `AGENTS.md`, `CLAUDE.md` or `.gitignore`.
|
|
108
|
+
`onceworlds new` writes the same workflow and `.gitignore` into every game it makes.
|
|
109
|
+
Then commit, push, and import the repo at https://onceworlds.com/create?new=github.
|
|
108
110
|
- `onceworlds deploy [dir]` uploads only the files that changed and publishes the game
|
|
109
111
|
(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
112
|
- `onceworlds dev [dir]` deploys to a local Onceworlds platform (for platform development)
|
|
@@ -116,7 +118,25 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
116
118
|
shared time and no use of the platform's lobby. For an engine game it also reads the action map
|
|
117
119
|
and offers the `controls` it implies: `--fix` writes them into `onceworlds.json` when it has none. For an installed engine
|
|
118
120
|
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
|
|
121
|
+
from the source text (`Input.axis2d`, `Input.button`) and may differ. It checks `onceworlds.json` by every rule a deploy applies
|
|
122
|
+
(lengths, genres, badges, How to play, the pictures it names), in the deploy's words and with the fix, and fails as the deploy
|
|
123
|
+
would; the rest only suggests (`--strict` exits with an error on likely bugs, for CI). `check` does the same.
|
|
124
|
+
|
|
125
|
+
- `onceworlds api <name or words>` looks the engine up in a few lines instead of the whole reference: a signature, what it
|
|
126
|
+
does, a component's fields or an options object's keys, and an example (`api Shape2D`, `api feel.shake`, `api "camera follow"`;
|
|
127
|
+
`--full` for every field with its doc). `onceworlds recipe [name]` prints short, tested code for a kind of game or a feature
|
|
128
|
+
(tycoon, survival, racing, platformer, shooter, party, rpg, idle, sandbox, chase-ai, inventory, shop, dialogue, day-night), and
|
|
129
|
+
`onceworlds guide [topic]` the engine guide's topics or any heading of the guide or the reference. They read the index of the
|
|
130
|
+
engine installed in the game's `node_modules` (its own version), else the platform's.
|
|
131
|
+
- `onceworlds shot [dir]` saves a picture of the game to look at: the first player's screen a few seconds into a simulated match
|
|
132
|
+
with bots (`--at 20`), the title screen (`--phase title`) or the lobby (`--phase lobby`), or a poster (`--poster cover`), at
|
|
133
|
+
`--size 1280x720` by default. A 2D game is drawn with no browser, from
|
|
134
|
+
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
|
|
135
|
+
copy of the game. `--out` picks the file (default `store/shot.png`).
|
|
136
|
+
|
|
137
|
+
Running `onceworlds mcp` gives an AI tool the same as tools: `api_lookup`, `recipe`, `read_guide`, `search_assets` (the engine's
|
|
138
|
+
asset library), `check`, `screenshot` (the picture comes back to the model), `new_game`, `deploy_preview`, `playtest` and
|
|
139
|
+
`game_status`.
|
|
120
140
|
|
|
121
141
|
Games talk to the platform through the injected `window.onceworlds` SDK. The
|
|
122
142
|
starter template's `AGENTS.md` documents it for AI coding tools.
|