Environment and exit codes
Environment variables the 0x CLI reads, where it keeps credentials, its exit codes, and common error messages.
#Environment variables
| Variable | Read by | Meaning |
|---|---|---|
ZEROX_API | login, publish, whoami | The hosting API (default https://api.0x.limo). It overrides the saved login. |
ZEROX_PUBLISH_TOKEN | publish, whoami, deploy-server, server | A publish token (0xpub_…). It overrides the saved login, which is what CI uses. |
ZEROX_BACKEND | submit, issues, source check | The API for listings (default: the saved login's API) |
ZEROX_TOKEN | submit, issues, source check, deploy-server, server | A publish or access token. For deploy-server/server it is checked before ZEROX_PUBLISH_TOKEN. |
ZEROX_HOST_URL | deploy-server, server | The game-server host (default https://api.0x.limo/x1/host) |
ZEROX_CA | deploy-server, server | A PEM file with a private CA (staging) |
ZEROX_LOGIN_FILE | deploy-server, server | Another credentials file instead of ~/.config/0x/0x-cli.json |
XDG_CONFIG_HOME | all | The base of 0x/0x-cli.json (default ~/.config) |
ZEROX_REGISTRY | init | The registry written into a new game's .npmrc (otherwise taken from npm's config) |
ZEROX_MESHTORRENT | dev, publish --to | A built meshtorrent checkout, instead of @x1/meshtorrent |
ZEROX_BYO_URL | paper | The bring-your-own-server service (default https://api.0x.limo/byo/) |
ZEROX_CONFIG_DIR | paper | Where paper.json (management keys) is kept (default ~/.config/0x) |
ZEROX_BYO_CACHE | assets | The asset conversion cache (default ~/.cache/0x/byo) |
NODE_EXTRA_CA_CERTS | all (Node.js) | Trust a private CA for HTTPS calls (staging) |
Old names keep working
Every ZEROX_* variable is also read under its old name, X1_* (for example X1_PUBLISH_TOKEN). When both are set, ZEROX_* wins. Likewise the CLI reads a login saved in the old ~/.config/0x1/x1-cli.json when ~/.config/0x/0x-cli.json doesn't exist yet, and writes to ~/.config/0x/.
Installer variables (ZEROX_HOME, ZEROX_VERSION, ZEROX_NO_MODIFY_PATH, ZEROX_NO_NPMRC) are listed on the CLI page.
#Files
| Path | Contents |
|---|---|
~/.config/0x/0x-cli.json | {api, token, steamid} from 0x login (mode 600) |
~/.config/0x/paper.json | 0x paper management keys (mode 600) |
<game>/.x1/ | 0x dev's staged site and seed key. Git-ignored and never uploaded. |
#Exit codes
| Code | When |
|---|---|
0 | Success. 0x, 0x help and 0x --help also exit with 0. |
1 | Any error. The message is printed on stderr as x1: <message>. |
2 | Unknown command (the usage is printed), or 0x assets import with a recipe that ended mismatch or error |
3 | 0x source check: the rebuilt output does not match the published files |
64 | 0x assets <unknown subcommand> |
#Common errors
| Message | Cause and fix |
|---|---|
not signed in: run \0x login` (or set ZEROX_PUBLISH_TOKEN)` | No saved token and none in the environment |
invalid or expired token (401) | The token was revoked, or the access token expired. Run 0x login again. |
sign in (0x login) to mint a publish token (403) | POST /v1/hosting/tokens was called with a publish token. Use an access token. |
site: 3-40 characters a-z, 0-9 and '-', … (400) | The site name doesn't fit the rule (site names) |
that site name is reserved / is taken (409) | Pick another id, or use --site |
at most 20 sites per developer (403) | Use an existing site for the game |
over your hosting quota (…) (413) | The 2048 MiB quota counts every version you have published |
upload refused (422) + problems | Hidden files, blocked file types, files over 64 MiB, missing index.html, or invalid csp entries |
the site builder refused this version (422) + findings | The content check failed. Each finding names a file. |
id … belongs to another developer (409) | The listing id is taken. Change id. |
at most 10 submissions may wait for review at once (429) | Wait for reviews, or withdraw pending versions |
play.url: the https page players open is required (…) (400) | Pass --site/--site-version or --url |
meshtorrent not found (…) | Reinstall the CLI, or set ZEROX_MESHTORRENT |
unable to get local issuer certificate | The API uses a private CA (staging): export NODE_EXTRA_CA_CERTS=/path/to/ca.crt |
