0xDocs 0x.limo

Docs / 0x CLI

0x CLI

Install @0xlimo/cli, the 0x command line for web games (init, dev, publish, deploy-server, submit, issues, source check), and how it finds its registry and credentials.

0x is the command line for building, running, publishing and listing web games on 0x. The current version is @0xlimo/cli 0.1.4. Its source is in the x1-sdk repository, packages/cli.

The command used to be called x1 (package @x1/cli). x1 still works as an alias of 0x, so existing scripts and CI keep running unchanged.

#Install

You need Node.js 20 or newer with npm.

bash
curl -fsSL https://0x.limo/sdk/install.sh | sh

The installer:

  • installs @0xlimo/cli into ~/.0x as a local npm install (no npm -g, no sudo) and links ~/.0x/bin/0x;
  • runs npm config set @0xlimo:registry https://0x.limo/npm/ and the same for @x1:registry, so npm install in your games finds @0xlimo/* and the packages that keep the old scope (@x1/script, @x1/meshtorrent);
  • adds ~/.0x/bin to PATH in ~/.bashrc, ~/.zshrc and ~/.profile (whichever exist).
Installer variableDefaultMeaning
ZEROX_HOME~/.0xInstall directory
ZEROX_REGISTRYhttps://0x.limo/npm/The npm registry for @0xlimo/*
ZEROX_VERSIONlatestThe @0xlimo/cli version to install
ZEROX_NO_MODIFY_PATH=1Leave shell rc files alone
ZEROX_NO_NPMRC=1Don't add @0xlimo:registry to ~/.npmrc

An existing ~/.x1 install (from before the rename to 0x) is updated in place instead. To update, run the installer again. To uninstall, rm -rf ~/.0x and remove the PATH line from your shell rc file.

Without installing:

bash
npx --registry https://0x.limo/npm/ 0x init

#The 0x registry

@0xlimo/* packages are published only on the 0x registry at https://0x.limo/npm/, not on npmjs.org. Any other package name requested there is passed through to npmjs.org, read-only. The registry currently serves:

PackageVersion
@0xlimo/cli0.1.4
@0xlimo/net0.1.2
@0xlimo/platform0.1.1
@0xlimo/swarm-sw0.1.1
@x1/meshtorrent0.2.0
@0xlimo/iap0.1.0
@0xlimo/byo-assets0.1.1
@0xlimo/host0.1.1
bashtested
curl -s https://0x.limo/npm/@0xlimo/cli

0x init writes an .npmrc with @0xlimo:registry=<registry> and @x1:registry=<registry> into each new game, unless the registry is npmjs.org.

#Commands at a glance

CommandWhat it does
0x init / 0x newCreates a starter game from a template
0x devServes the game locally with a swarm and a dev broadcast service
0x login / logout / whoamiSigns in to 0x hosting
0x publishUploads to 0x hosting and prints the play URL, or self-hosts with --to
0x deploy-serverHosts the game's Node.js server on 0x
0x serverShows the hosted server's status and logs, and stops or starts it
0x submitSubmits the store listing for review, and shows its status
0x issuesShows review issues and lets you answer them
0x source checkRuns the reviewers' source scan and reproducible build locally
0x assetsBring-your-own-assets conversion (@0xlimo/byo-assets)
0x paperBring your own Minecraft server (not available on 0x.limo yet)

0x, 0x help and 0x --help print the usage and exit with 0. An unknown command prints the usage and exits with 2. See Environment and exit codes.

#Credentials

0x login saves {api, token, steamid} to $XDG_CONFIG_HOME/0x/0x-cli.json (default ~/.config/0x/0x-cli.json, mode 600). A login saved before the rename to 0x, in ~/.config/0x1/x1-cli.json, is still read. Every command that talks to 0x reads it. Environment variables override it, which is how CI works (see Accounts, tokens in CI).

#Project file

Each game folder has a 0x.config.json: id, name, store listing, server, and site security policy. See 0x.config.json.