@opengamehq/cli 0.4.0 → 0.7.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/AGENTS.md CHANGED
@@ -56,7 +56,7 @@ An error has `"type": "error"`, `"ok": false`, a `code`, a `message`, an `exitCo
56
56
  | 4 | An allowance is used up | Wait `retryAfterSeconds`, then run the same command. |
57
57
  | 5 | Our side or the network | Leave the game as it is. Run `next` when the error has one; otherwise wait and retry, at most a few times. |
58
58
  | 6 | The CLI is too old | Run `opengame upgrade --json`, then the npm command in `data.command`. |
59
- | 7 | OpenGame is not launched | Stop. Tell the creator their account cannot use OpenGame until launch. |
59
+ | 7 | OpenGame is not open to creators yet | Stop. Tell the creator the CLI and uploads open on 18 November. |
60
60
 
61
61
  ## Sign in with the creator
62
62
 
@@ -121,6 +121,7 @@ opengame deploy . --json
121
121
  | `data.done` | `true` once the server has finished. |
122
122
  | `data.releaseId` | The release. Keep it for `submit`. |
123
123
  | `data.previewUrl` | The private preview link, once `state` is `ready`. It can be `null` on a ready release the server will not play; the deploy's page says why. |
124
+ | `data.gameOrigin` | The origin the published game runs at, such as `https://k3v9q2m7x4ab.opengame.gg`. Give it to the creator when the game talks to their own servers. `null` when the server sent none, or sent one this CLI cannot read. |
124
125
 
125
126
  To follow the checks, run `status --watch`, which follows the deploy for up to 5 minutes. Set `--timeout <seconds>` for a short tool call; when it runs out the command exits 5 with `checks_pending` and the checks carry on.
126
127
 
@@ -179,6 +180,8 @@ OpenGame hosts static browser exports. The build needs `index.html` at the root
179
180
 
180
181
  At runtime the game may call its own origin, `https://api.opengame.gg`, and any other `https:` or `wss:` host. Each call comes from the player's browser, so that host sees the player's IP address. Keep API keys on the creator's server, never in the bundle: players can read every file in it. The review sandbox has no internet, so the game must draw its first frame without its server.
181
182
 
183
+ The published game runs at `https://<label>.opengame.gg`, one origin per game, and `opengame deploy` returns it as `data.gameOrigin`. While an experiment runs, players load each version taking part from a `v-` origin instead. If the creator's servers check `Origin` (WebSocket) or send CORS headers (HTTP), they reject the game's requests until that exact origin is on their list, and online play fails with a closed socket, a 401 or 403 on the upgrade, or a CORS error in the console. Tell the creator to add it, and to add a version's `v-` origin before starting an experiment with it. Never suggest allowing `*.opengame.gg`, `null` or any pattern on `opengame.gg`, because other people's games are served there too and a pattern lets them call the creator's server. Use a token in a header or the first socket message, not a cookie. A private preview runs on a temporary `p-` origin, not the game's. That address is a private link, so keep it out of committed config and logs. [Games that talk to your own servers](https://docs.opengame.io/guides/packaging#games-that-talk-to-your-own-servers) has server examples.
184
+
182
185
  A game may not take payments, use crypto, make players create an account or give an email address, show ads, or carry ad pixels or session recording. [Packaging](https://docs.opengame.io/guides/packaging) has every rule and every check.
183
186
 
184
187
  ## Engines
@@ -203,17 +206,26 @@ Play the private preview before you tell the creator the game works.
203
206
  | `opengame check [dir] [options]` | Find local build and asset problems before uploading. |
204
207
  | `opengame dev [dir] [options]` | Serve a local export with game-runtime headers. Under a contract that adds the SDK, pages also get the host runtime and SDK, as they do when hosted. If the contract supports opting out, sdk.inject: false leaves out the SDK. |
205
208
  | `opengame login [options]` | Sign in through your browser. |
206
- | `opengame deploy [dir] [options]` | Build, check and upload a release, then return with the address of its deployment page, where the checks run and the private preview plays once they pass. Add --wait to stay until they finish. Once the preview is ready, the achievements opengame.json declares are saved by deploy --wait or by the next opengame status in this folder. Removing an achievement from opengame.json does not switch it off. To retire one, send PUT /api/v1/games/{id}/achievements with achievementId, title, description and active: false. Unlocks are never deleted. |
207
- | `opengame status [dir] [options]` | Show the most recent deploy for this folder, with its findings. Finishes saving its declared achievements if the deploy could not. Removing an achievement from opengame.json does not switch it off. To retire one, send PUT /api/v1/games/{id}/achievements with achievementId, title, description and active: false. Unlocks are never deleted. |
209
+ | `opengame deploy [dir] [options]` | Build, check and upload a release, then return with the address of its deployment page, where the checks run and the private preview plays once they pass. Add --wait to stay until they finish. Once the preview is ready, the achievements opengame.json declares are saved by deploy --wait or by the next opengame status in this folder. Removing an achievement from opengame.json does not switch it off. To retire one, run opengame achievements retire <id>. Unlocks are never deleted. |
210
+ | `opengame status [dir] [options]` | Show the most recent deploy for this folder, with its findings. Finishes saving its declared achievements if the deploy could not. Removing an achievement from opengame.json does not switch it off. To retire one, run opengame achievements retire <id>. Unlocks are never deleted. |
208
211
  | `opengame deployments [dir] [options]` | List the linked game's deploys, newest first: status, when, size, who started each one, why any stopped, and each one's page or preview. |
209
212
  | `opengame open [dir] [options]` | Open the linked game's private page in your browser. |
210
213
  | `opengame submit [dir] [options]` | Send one release to review, and enter it in a jam. |
211
214
  | `opengame jams [slug] [options]` | List open jams, or show one jam's tracks and flags. |
215
+ | `opengame jam <withdraw\|reenter> [options]` | Withdraw the linked game's jam entry, freeing its place, or put a withdrawn one back while the jam is open, as your jam entries page does. Needs a token with submit; opengame login has it. |
216
+ | `opengame releases [dir] [options]` | List the linked game's releases, newest first, as the Releases tab on its page does: which one is live, which were live before, which are drafts and which were cleaned up, and which can be made live again. |
217
+ | `opengame rollback <release> [options]` | Make a release that was live before live again, as Make live again does on the game's page. The game must be live, and the release must still have its files. Players get it from their next load. Run again on the live release to rewrite its address after a failed one. Needs a token with read or deploy, and submit; opengame login has all three. |
218
+ | `opengame unpublish [dir] [options]` | Take the linked game off the gallery and stop serving it, as Unpublish does on Your games. Your build, uploads and review record are kept, and opengame restore puts it back. Needs a token with read or deploy, and submit; opengame login has all three. |
219
+ | `opengame restore [dir] [options]` | Put a game you unpublished back on the gallery, serving the version it was on, as Put it back does on Your games. Refused for a game we took down, one with an open report or a hold, and one under a copyright notice. Needs a token with read or deploy, and submit; opengame login has all three. |
220
+ | `opengame delete [dir] [options]` | Delete the linked game for good, as Delete for good does on its page: it comes off the gallery, stops being served and cannot be put back. You type its title to confirm. Refused while it is under a legal hold, with a reviewer, or in a jam being scored. Only the opengame login token can do this, not a token made in settings. |
221
+ | `opengame details [dir] [options]` | Print the linked game's title, tagline and description as the website shows them, or change any of them, as the Details tab on its page does. A field you leave out stays as it is. On a published game players see the change at once. Printing needs a token with read or deploy, and saving needs submit too; opengame login has all three. |
222
+ | `opengame achievements [retire <id>] [options]` | List the linked game's achievements, active and retired, or retire one, as the achievements step on the website does. Players keep what they unlocked, and the game can no longer award a retired one. Retiring needs a token with deploy and submit; opengame login has them. |
212
223
  | `opengame games [options]` | List your games and their latest deploy. |
213
224
  | `opengame link [dir] [options]` | Connect this folder to an existing game. |
214
225
  | `opengame pull [dir] [options]` | Bring website metadata into this folder. |
215
226
  | `opengame stats [game\|dir] [options]` | Read analytics for a game you own, or this folder's linked game, for one complete ISO week, Monday to Sunday in UTC. Average playtime is total playtime divided by distinct players in the week. |
216
227
  | `opengame whoami [options]` | Show the account and permissions for this token. |
228
+ | `opengame handle <name> [options]` | Rename your handle, as Settings does. Your old handle keeps pointing at you and is never given to anybody else, and renames are limited per day. Only the opengame login token can do this, not a token made in settings. |
217
229
  | `opengame token create\|list\|revoke [options]` | Create, list or revoke tokens in your browser. |
218
230
  | `opengame logout [options]` | Revoke this device's token and remove it locally. |
219
231
  | `opengame limits [options]` | Show bundle limits and your remaining account allowance. |
@@ -231,5 +243,5 @@ Play the private preview before you tell the creator the game works.
231
243
  | 4 | `rateLimited` | An allowance is used. Wait retryAfterSeconds when the error has it, then run the same command. |
232
244
  | 5 | `server` | Our side or the network, and the game is fine. Run the error's next command when it has one. With retry after-fix or never, waiting will not help; read the message. Otherwise wait (retryAfterSeconds when given) and run the same command. |
233
245
  | 6 | `upgrade` | This CLI is too old. Run opengame upgrade. |
234
- | 7 | `notLaunched` | OpenGame is not launched yet, so nothing ran. Nothing about the game, the command or the login is wrong. Retrying will not help before launch. |
246
+ | 7 | `notLaunched` | OpenGame is not open to creators yet, so nothing ran. The message names the day the CLI and uploads open. Nothing about the game, the command or the login is wrong. Retrying will not help before then. |
235
247
  <!-- /generated:commands -->
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ - `opengame unpublish` takes a game off the gallery and stops serving it, and `opengame
6
+ restore` puts a game you unpublished back, through the same checks and audit as
7
+ Unpublish and Put it back on Your games. A person is asked first; an agent or a script
8
+ passes `--yes`. Both need a token with the `submit` permission, which `opengame login`
9
+ gives.
10
+ - `opengame details` prints a game's title, tagline and description as the website shows
11
+ them, and `--title`, `--tagline` and `--description` change them, through the same
12
+ checks as the Details tab on the game's page. It needs the `submit` permission.
13
+ - `opengame handle <name>` renames your handle, through the same limits and checks as
14
+ Settings. A person is asked first; an agent passes `--yes`. Only the `opengame login`
15
+ token can do it.
16
+ - `opengame jam withdraw` takes the linked game's jam entry out of the jam and frees its
17
+ place, and `opengame jam reenter` puts a withdrawn one back while the jam is open, as
18
+ the jam entries page does. Withdrawing asks first; an agent passes `--yes`.
19
+ - `opengame delete` deletes a game for good, through the same checks as Delete for good
20
+ on its page. You type its title to confirm; an agent passes `--title` and `--yes`. Only
21
+ the `opengame login` token can delete.
22
+ - `opengame achievements` lists a game's achievements, and `opengame achievements retire
23
+ <id>` retires one, as the website's achievements step does. Retiring now needs the
24
+ `submit` permission as well as `deploy`, from the CLI and the API alike; a deploy's own
25
+ save of its declared achievements still needs only `deploy`.
26
+ - `opengame stats --csv <file>` writes the week's figures as the CSV the Stats tab
27
+ downloads, from the same export. It never writes over an existing file.
28
+ - Ships the skills from `@opengamehq/skills` 1.3.0.
29
+
30
+ ## 0.6.0
31
+
32
+ - `opengame releases` lists a game's releases, newest first, as the Releases tab on its
33
+ page does: which one is live, which were live before, which are drafts or in review,
34
+ which were cleaned up, and which can be made live again.
35
+ - `opengame rollback <release>` makes a release that was live before live again, through
36
+ the same check and audit as Make live again on the website. A person is asked first; an
37
+ agent or a script passes `--yes`. It needs a token with the `submit` permission, which
38
+ `opengame login` gives.
39
+ - Ships the skills from `@opengamehq/skills` 1.2.0.
40
+
41
+ ## 0.5.0
42
+
43
+ - Before OpenGame opens for creators, a refused command names the day it opens ("OpenGame
44
+ opens for creators on 18 November") rather than saying it is not launched.
45
+ - `opengame deploy` returns `gameOrigin`, the origin the published game runs at, and says
46
+ to allow that exact origin when the game's own servers check `Origin` or send CORS
47
+ headers.
48
+ - `opengame pull` names the website setting opengame.json cannot hold, such as a player
49
+ count it has no room for, and the way past it, rather than a general manifest error.
50
+ - `--help --json` no longer carries `internal: true`, and the local checker's failure no
51
+ longer tells you to reinstall an internal CLI.
52
+ - Ships the skills from `@opengamehq/skills` 1.1.0.
53
+
3
54
  ## 0.4.0
4
55
 
5
56
  - First release on npm. This version is published by hand and has no npm provenance
package/README.md CHANGED
@@ -24,8 +24,9 @@ Allow access. The CLI keeps the token in the macOS Keychain, and elsewhere in a
24
24
  file under `~/.config/opengame`. In CI, pass a token through `OPENGAME_TOKEN` or
25
25
  `--token-stdin`, never as a command argument.
26
26
 
27
- When OpenGame has not opened for your account, a command that needs the platform prints
28
- `OpenGame is not launched.` and exits with code 7. Signing in works either way.
27
+ When OpenGame has not opened to creators for your account, a command that needs the
28
+ platform prints `OpenGame opens for creators on` the day the CLI and uploads open, and exits
29
+ with code 7. Signing in works either way.
29
30
 
30
31
  ## Deploy a game
31
32
 
@@ -86,17 +87,26 @@ OpenCode, so a coding agent can do all of the above for you.
86
87
  | `opengame check [dir] [options]` | Find local build and asset problems before uploading. |
87
88
  | `opengame dev [dir] [options]` | Serve a local export with game-runtime headers. Under a contract that adds the SDK, pages also get the host runtime and SDK, as they do when hosted. If the contract supports opting out, sdk.inject: false leaves out the SDK. |
88
89
  | `opengame login [options]` | Sign in through your browser. |
89
- | `opengame deploy [dir] [options]` | Build, check and upload a release, then return with the address of its deployment page, where the checks run and the private preview plays once they pass. Add --wait to stay until they finish. Once the preview is ready, the achievements opengame.json declares are saved by deploy --wait or by the next opengame status in this folder. Removing an achievement from opengame.json does not switch it off. To retire one, send PUT /api/v1/games/{id}/achievements with achievementId, title, description and active: false. Unlocks are never deleted. |
90
- | `opengame status [dir] [options]` | Show the most recent deploy for this folder, with its findings. Finishes saving its declared achievements if the deploy could not. Removing an achievement from opengame.json does not switch it off. To retire one, send PUT /api/v1/games/{id}/achievements with achievementId, title, description and active: false. Unlocks are never deleted. |
90
+ | `opengame deploy [dir] [options]` | Build, check and upload a release, then return with the address of its deployment page, where the checks run and the private preview plays once they pass. Add --wait to stay until they finish. Once the preview is ready, the achievements opengame.json declares are saved by deploy --wait or by the next opengame status in this folder. Removing an achievement from opengame.json does not switch it off. To retire one, run opengame achievements retire <id>. Unlocks are never deleted. |
91
+ | `opengame status [dir] [options]` | Show the most recent deploy for this folder, with its findings. Finishes saving its declared achievements if the deploy could not. Removing an achievement from opengame.json does not switch it off. To retire one, run opengame achievements retire <id>. Unlocks are never deleted. |
91
92
  | `opengame deployments [dir] [options]` | List the linked game's deploys, newest first: status, when, size, who started each one, why any stopped, and each one's page or preview. |
92
93
  | `opengame open [dir] [options]` | Open the linked game's private page in your browser. |
93
94
  | `opengame submit [dir] [options]` | Send one release to review, and enter it in a jam. |
94
95
  | `opengame jams [slug] [options]` | List open jams, or show one jam's tracks and flags. |
96
+ | `opengame jam <withdraw\|reenter> [options]` | Withdraw the linked game's jam entry, freeing its place, or put a withdrawn one back while the jam is open, as your jam entries page does. Needs a token with submit; opengame login has it. |
97
+ | `opengame releases [dir] [options]` | List the linked game's releases, newest first, as the Releases tab on its page does: which one is live, which were live before, which are drafts and which were cleaned up, and which can be made live again. |
98
+ | `opengame rollback <release> [options]` | Make a release that was live before live again, as Make live again does on the game's page. The game must be live, and the release must still have its files. Players get it from their next load. Run again on the live release to rewrite its address after a failed one. Needs a token with read or deploy, and submit; opengame login has all three. |
99
+ | `opengame unpublish [dir] [options]` | Take the linked game off the gallery and stop serving it, as Unpublish does on Your games. Your build, uploads and review record are kept, and opengame restore puts it back. Needs a token with read or deploy, and submit; opengame login has all three. |
100
+ | `opengame restore [dir] [options]` | Put a game you unpublished back on the gallery, serving the version it was on, as Put it back does on Your games. Refused for a game we took down, one with an open report or a hold, and one under a copyright notice. Needs a token with read or deploy, and submit; opengame login has all three. |
101
+ | `opengame delete [dir] [options]` | Delete the linked game for good, as Delete for good does on its page: it comes off the gallery, stops being served and cannot be put back. You type its title to confirm. Refused while it is under a legal hold, with a reviewer, or in a jam being scored. Only the opengame login token can do this, not a token made in settings. |
102
+ | `opengame details [dir] [options]` | Print the linked game's title, tagline and description as the website shows them, or change any of them, as the Details tab on its page does. A field you leave out stays as it is. On a published game players see the change at once. Printing needs a token with read or deploy, and saving needs submit too; opengame login has all three. |
103
+ | `opengame achievements [retire <id>] [options]` | List the linked game's achievements, active and retired, or retire one, as the achievements step on the website does. Players keep what they unlocked, and the game can no longer award a retired one. Retiring needs a token with deploy and submit; opengame login has them. |
95
104
  | `opengame games [options]` | List your games and their latest deploy. |
96
105
  | `opengame link [dir] [options]` | Connect this folder to an existing game. |
97
106
  | `opengame pull [dir] [options]` | Bring website metadata into this folder. |
98
107
  | `opengame stats [game\|dir] [options]` | Read analytics for a game you own, or this folder's linked game, for one complete ISO week, Monday to Sunday in UTC. Average playtime is total playtime divided by distinct players in the week. |
99
108
  | `opengame whoami [options]` | Show the account and permissions for this token. |
109
+ | `opengame handle <name> [options]` | Rename your handle, as Settings does. Your old handle keeps pointing at you and is never given to anybody else, and renames are limited per day. Only the opengame login token can do this, not a token made in settings. |
100
110
  | `opengame token create\|list\|revoke [options]` | Create, list or revoke tokens in your browser. |
101
111
  | `opengame logout [options]` | Revoke this device's token and remove it locally. |
102
112
  | `opengame limits [options]` | Show bundle limits and your remaining account allowance. |
@@ -114,7 +124,7 @@ OpenCode, so a coding agent can do all of the above for you.
114
124
  | 4 | `rateLimited` | An allowance is used. Wait retryAfterSeconds when the error has it, then run the same command. |
115
125
  | 5 | `server` | Our side or the network, and the game is fine. Run the error's next command when it has one. With retry after-fix or never, waiting will not help; read the message. Otherwise wait (retryAfterSeconds when given) and run the same command. |
116
126
  | 6 | `upgrade` | This CLI is too old. Run opengame upgrade. |
117
- | 7 | `notLaunched` | OpenGame is not launched yet, so nothing ran. Nothing about the game, the command or the login is wrong. Retrying will not help before launch. |
127
+ | 7 | `notLaunched` | OpenGame is not open to creators yet, so nothing ran. The message names the day the CLI and uploads open. Nothing about the game, the command or the login is wrong. Retrying will not help before then. |
118
128
  <!-- /generated:commands -->
119
129
 
120
130
  `opengame <command> --help` prints that command's flags and examples.