CLI commands
Every disko command and flag, exit codes, error codes and environment variables.
The disko command ships in @disko-game/cli (Node.js 22 or later). Every
command accepts --json and never prompts: a missing value fails with exit
code 2 and names the flag. Commands, flags, exit codes and error codes below
are generated from the CLI's own definitions.
Commands
disko dev
Run the game in a test room, reloading it on every edit.
| Flag | Description |
|---|---|
--project <dir> | the game project directory (default: the current directory) |
--json | print one JSON event per line on stdout; progress stays on stderr |
--no-open | print the sign-in URL and the room link without opening them |
--profile <production|local> | endpoint defaults (DISKO_PROFILE; default production) |
--api <url> | disko-master API base URL (DISKO_API_URL) |
--registry <url> | registry base URL (DISKO_REGISTRY_URL) |
--help | show this help |
disko publish
Build, check and upload a game release.
| Flag | Description |
|---|---|
--project <dir> | the game project directory (default: the current directory) |
--dry-run | build and check only: no credentials, no network, nothing uploaded |
--out <file> | also write the archive to this file (overwritten if it exists) |
--visibility <public|unlisted|private> | release visibility: required for public games, private by default for private games |
--json | print one JSON object on stdout; progress stays on stderr |
--no-open | print the browser sign-in URL without opening it |
--profile <production|local> | endpoint defaults (DISKO_PROFILE; default production) |
--api <url> | disko-master API base URL (DISKO_API_URL) |
--registry <url> | registry base URL (DISKO_REGISTRY_URL) |
--help | show this help |
disko login
Sign in with the browser, or store a CLI token read from stdin.
| Flag | Description |
|---|---|
--with-token | read a CLI token (dpt_…) from stdin and store it |
--json | print one JSON object on stdout; progress stays on stderr |
--no-open | print the browser sign-in URL without opening it |
--profile <production|local> | endpoint defaults (DISKO_PROFILE; default production) |
--api <url> | disko-master API base URL (DISKO_API_URL) |
--registry <url> | registry base URL (DISKO_REGISTRY_URL) |
--help | show this help |
disko logout
Delete the stored credential.
| Flag | Description |
|---|---|
--json | print one JSON object on stdout; progress stays on stderr |
--profile <production|local> | endpoint defaults (DISKO_PROFILE; default production) |
--api <url> | disko-master API base URL (DISKO_API_URL) |
--registry <url> | registry base URL (DISKO_REGISTRY_URL) |
--help | show this help |
disko dev events
With --json, disko dev writes one JSON event per line (NDJSON) on stdout;
progress stays on stderr. stopped is always the last event.
sign_in_requiredroom_readyreloadruntime_errorhost_restartedstopped
Event fields
Combine --json with --no-open and DISKO_TOKEN to run without
a browser:
| Event | Fields |
|---|---|
sign_in_required | url |
room_ready | room_id, link, expires_at (Unix seconds) |
reload | status ("ok" or "failed"), and digest or problems |
runtime_error | phase ("load", "start", "event", or "host" for the host file), message, stack |
host_restarted | reason, for example "server.js changed" |
stopped | reason; after a failure also error, docs and any problems |
stopped is always the last event. After Ctrl-C its reason is
"interrupted" ("terminated" for SIGTERM); after a failure the exit code
follows the exit-code table.
disko dev host file
A game decides how a match plays. The room decides everything around it:
who may join, what happens to chat, which game is loaded. disko dev provides a simple room for you, and you can replace it with your
own.
Without a host file, disko dev uses a built-in host: it shows every chat
message, and runs the start-game, stop-game, pause-game and
resume-game game events as room.start(), room.stop(), room.pause()
and room.resume(). A game that starts itself with game.start(), as the
scaffold does, needs nothing more.
To try your own room behavior, add a server.js to the game project that
default-exports a host function, like a room project's room.js:
disko devcalls it with the test room'sidandtoken, the project asgame({ path }), a loopbacklistenaddress and theendpoints. It must pass them through toRoom.launchand resolve to the room it launched. SeeHostOptions.It imports
@disko-game/room; install it in the game project (npm install @disko-game/room) so the import resolves.It runs in its own Node process. An edit to
server.jscloses the room and runs the newserver.jsin a fresh process with the same test room; players reconnect.server.jsis not part of the game and is never published.A TypeScript project may use
server.tsinstead, which Node 22.18 or later runs directly (type stripping, so only erasable syntax).server.jswins when both exist.If the host function throws or its process fails, the error is reported with the phase
host, and the next edit of any file tries again.
disko dev limits
A test room expires ten minutes after its last lease renewal, which
disko dev renews while it runs. Each session creates a new test room, and
an account can run at most two at a time; a third fails with
quota_exceeded. A test room counts only while its
host holds a lease: a session you stop frees its slot within seconds, and one
that was killed frees it when its lease runs out (about 30 seconds).
Exit codes
| Code | Name | Meaning |
|---|---|---|
| 0 | ok | Success. |
| 1 | problems | Build or validation problems (problems present). |
| 2 | usage | Usage error: a bad or missing flag. |
| 3 | auth | Authentication or authorization failure. |
| 4 | unavailable | disko-master or the registry is unreachable or unavailable. |
| 5 | conflict | Conflict (for example version_exists) or quota exceeded. |
Error codes
With --json, a failure prints {"ok": false, "command": …, "error": <code>, …}
on stdout (for disko dev, the final stopped event carries error). An
exit code 1 always comes with problems; an unexpected failure is reported as
the problem internal_error. Each code has a page.
Environment variables
Flags win over variables, which win over the profile.
| Variable | Meaning |
|---|---|
DISKO_TOKEN | A CLI token (dpt_…). Takes precedence over stored credentials; for CI and agents. |
DISKO_PROFILE | Endpoint defaults: production (the default) or local. Same as --profile. |
DISKO_API_URL | The API base URL. Same as --api. |
DISKO_REGISTRY_URL | The registry base URL. Same as --registry. |
DISKO_AUTH_ISSUER | The OpenID issuer used for browser sign-in. |
DISKO_PLAY_URL | The web client used for room links. |
URLs must use https, except on localhost. Stored credentials are kept per
API host, so a local credential is never sent to production.
Credentials
Signed-in commands use, in order: DISKO_TOKEN; a token stored by
disko login --with-token; a stored browser sign-in; otherwise a browser
sign-in, which prints the URL (and opens it unless --no-open is given) and
waits up to five minutes. Credentials are stored only in the OS credential
store. See CLI tokens & CI.