@onceworlds/cli 0.9.3 → 0.9.5

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.
Files changed (3) hide show
  1. package/README.md +15 -8
  2. package/dist/cli.js +1414 -238
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -105,7 +105,7 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
105
105
  - `onceworlds init [dir]` sets a game folder up, with the files the dashboard's import commits. It writes
106
106
  `onceworlds.json` (the link and name come from `package.json`'s name or the folder's; `dir` is your build's
107
107
  output folder when `package.json` has a build script, else `.` or the folder with your `index.html`),
108
- `.github/workflows/onceworlds.yml`, a `.gitignore` (`node_modules/` and the pictures `shot` saves; to one you have it adds only
108
+ `.github/workflows/onceworlds.yml`, a `.gitignore` (`node_modules/` and the pictures `shot` and `shot --story` save; to one you have it adds only
109
109
  those lines, once), and the guide for AI coding tools as `AGENTS.md` with a `CLAUDE.md` that
110
110
  imports it (next to a `AGENTS.md` of your own it writes `ONCEWORLDS.md` and adds a pointer to yours). It never
111
111
  overwrites a file you have: `--force` replaces only what init writes, never your own `AGENTS.md`, `CLAUDE.md` or `.gitignore`.
@@ -113,6 +113,11 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
113
113
  Then commit, push, and import the repo at https://onceworlds.com/create?new=github.
114
114
  - `onceworlds deploy [dir]` uploads only the files that changed and publishes the game
115
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).
116
121
  - `onceworlds dev [dir]` deploys to a local Onceworlds platform (for platform development)
117
122
  and redeploys on every save. `--players 3` also prints links for players 2 and 3 (`?player=N`): on a
118
123
  local platform each is another player, so one person can fill a lobby.
@@ -138,15 +143,17 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
138
143
  engine installed in the game's `node_modules` (its own version), else the platform's.
139
144
  - `onceworlds shot [dir]` saves a picture of the game to look at: the first player's screen a few seconds into a simulated match
140
145
  with bots (`--at 20`), the title screen (`--phase title`) or the lobby (`--phase lobby`), or a poster (`--poster cover`), at
141
- `--size 1280x720` by default. A 2D game is drawn with no browser, from
142
- 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
143
- copy of the game. `--out` picks the file (default `store/shot.png`). `--story` plays the first minute as a new player lives it
144
- (the title, the lobby, the countdown, the round's goal, play at +1, +5 and +12 s, the first result), saves each frame into
145
- `store/story/` and lays them out on one contact sheet, `store/story.png`, with the questions to ask of it.
146
+ `--size 1280x720` by default. A 2D game is drawn with no browser, from the frame the engine draws, with its text in the fonts
147
+ the game's files name (its own font files, or Google Fonts, downloaded once and kept) and Sora for the rest; the caption says
148
+ which it couldn't have, and that the HTML overlay (`ui.overlay`) needs `--browser`. A 3D game (or `--browser`) is drawn by
149
+ Chrome, Chromium or Edge from a local copy of the game. `--out` picks the file (default `store/shot.png`). `--story` plays the
150
+ first minute as a new player lives it (the title, the lobby, the countdown, the round's goal, play at +1, +5 and +12 s, the first
151
+ result), saves each frame into `store/story/` and lays them out on one contact sheet, `store/story.png`, with the questions to
152
+ ask of it.
146
153
 
147
154
  Running `onceworlds mcp` gives an AI tool the same as tools: `api_lookup`, `recipe`, `read_guide`, `search_assets` (the engine's
148
- asset library), `check`, `screenshot` (the picture comes back to the model), `new_game`, `deploy_preview`, `playtest` and
149
- `game_status`.
155
+ asset library), `check`, `screenshot` (the picture comes back to the model), `serve` (an address for the user to play it at),
156
+ `new_game`, `deploy_preview`, `playtest` and `game_status`.
150
157
 
151
158
  Games talk to the platform through the injected `window.onceworlds` SDK. The
152
159
  starter template's `AGENTS.md` documents it for AI coding tools.