Skip to content
Docs
Reference

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.

sh
FlagDescription
--project <dir>the game project directory (default: the current directory)
--jsonprint one JSON event per line on stdout; progress stays on stderr
--no-openprint 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)
--helpshow this help

disko publish

Build, check and upload a game release.

sh
FlagDescription
--project <dir>the game project directory (default: the current directory)
--dry-runbuild 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
--jsonprint one JSON object on stdout; progress stays on stderr
--no-openprint 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)
--helpshow this help

disko login

Sign in with the browser, or store a CLI token read from stdin.

sh
FlagDescription
--with-tokenread a CLI token (dpt_…) from stdin and store it
--jsonprint one JSON object on stdout; progress stays on stderr
--no-openprint 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)
--helpshow this help

disko logout

Delete the stored credential.

sh
FlagDescription
--jsonprint 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)
--helpshow 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_required

  • room_ready

  • reload

  • runtime_error

  • host_restarted

  • stopped

Event fields

Combine --json with --no-open and DISKO_TOKEN to run without a browser:

sh
EventFields
sign_in_requiredurl
room_readyroom_id, link, expires_at (Unix seconds)
reloadstatus ("ok" or "failed"), and digest or problems
runtime_errorphase ("load", "start", "event", or "host" for the host file), message, stack
host_restartedreason, for example "server.js changed"
stoppedreason; after a failure also error, docs and any problems
json

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:

server.js
  • disko dev calls it with the test room's id and token, the project as game ({ path }), a loopback listen address and the endpoints. It must pass them through to Room.launch and resolve to the room it launched. See HostOptions.

  • 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.js closes the room and runs the new server.js in a fresh process with the same test room; players reconnect. server.js is not part of the game and is never published.

  • A TypeScript project may use server.ts instead, which Node 22.18 or later runs directly (type stripping, so only erasable syntax). server.js wins 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

CodeNameMeaning
0okSuccess.
1problemsBuild or validation problems (problems present).
2usageUsage error: a bad or missing flag.
3authAuthentication or authorization failure.
4unavailabledisko-master or the registry is unreachable or unavailable.
5conflictConflict (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.

VariableMeaning
DISKO_TOKENA CLI token (dpt_…). Takes precedence over stored credentials; for CI and agents.
DISKO_PROFILEEndpoint defaults: production (the default) or local. Same as --profile.
DISKO_API_URLThe API base URL. Same as --api.
DISKO_REGISTRY_URLThe registry base URL. Same as --registry.
DISKO_AUTH_ISSUERThe OpenID issuer used for browser sign-in.
DISKO_PLAY_URLThe 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.