0xDocs 0x.limo

Docs / 0x CLI

Environment and exit codes

Environment variables the 0x CLI reads, where it keeps credentials, its exit codes, and common error messages.

#Environment variables

VariableRead byMeaning
ZEROX_APIlogin, publish, whoamiThe hosting API (default https://api.0x.limo). It overrides the saved login.
ZEROX_PUBLISH_TOKENpublish, whoami, deploy-server, serverA publish token (0xpub_…). It overrides the saved login, which is what CI uses.
ZEROX_BACKENDsubmit, issues, source checkThe API for listings (default: the saved login's API)
ZEROX_TOKENsubmit, issues, source check, deploy-server, serverA publish or access token. For deploy-server/server it is checked before ZEROX_PUBLISH_TOKEN.
ZEROX_HOST_URLdeploy-server, serverThe game-server host (default https://api.0x.limo/x1/host)
ZEROX_CAdeploy-server, serverA PEM file with a private CA (staging)
ZEROX_LOGIN_FILEdeploy-server, serverAnother credentials file instead of ~/.config/0x/0x-cli.json
XDG_CONFIG_HOMEallThe base of 0x/0x-cli.json (default ~/.config)
ZEROX_REGISTRYinitThe registry written into a new game's .npmrc (otherwise taken from npm's config)
ZEROX_MESHTORRENTdev, publish --toA built meshtorrent checkout, instead of @x1/meshtorrent
ZEROX_BYO_URLpaperThe bring-your-own-server service (default https://api.0x.limo/byo/)
ZEROX_CONFIG_DIRpaperWhere paper.json (management keys) is kept (default ~/.config/0x)
ZEROX_BYO_CACHEassetsThe asset conversion cache (default ~/.cache/0x/byo)
NODE_EXTRA_CA_CERTSall (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

PathContents
~/.config/0x/0x-cli.json{api, token, steamid} from 0x login (mode 600)
~/.config/0x/paper.json0x paper management keys (mode 600)
<game>/.x1/0x dev's staged site and seed key. Git-ignored and never uploaded.

#Exit codes

CodeWhen
0Success. 0x, 0x help and 0x --help also exit with 0.
1Any error. The message is printed on stderr as x1: <message>.
2Unknown command (the usage is printed), or 0x assets import with a recipe that ended mismatch or error
30x source check: the rebuilt output does not match the published files
640x assets <unknown subcommand>

#Common errors

MessageCause 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) + problemsHidden files, blocked file types, files over 64 MiB, missing index.html, or invalid csp entries
the site builder refused this version (422) + findingsThe 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 certificateThe API uses a private CA (staging): export NODE_EXTRA_CA_CERTS=/path/to/ca.crt