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.
curl -fsSL https://0x.limo/sdk/install.sh | shThe installer:
- installs
@0xlimo/cliinto~/.0xas a local npm install (nonpm -g, no sudo) and links~/.0x/bin/0x; - runs
npm config set @0xlimo:registry https://0x.limo/npm/and the same for@x1:registry, sonpm installin your games finds@0xlimo/*and the packages that keep the old scope (@x1/script,@x1/meshtorrent); - adds
~/.0x/bintoPATHin~/.bashrc,~/.zshrcand~/.profile(whichever exist).
| Installer variable | Default | Meaning |
|---|---|---|
ZEROX_HOME | ~/.0x | Install directory |
ZEROX_REGISTRY | https://0x.limo/npm/ | The npm registry for @0xlimo/* |
ZEROX_VERSION | latest | The @0xlimo/cli version to install |
ZEROX_NO_MODIFY_PATH=1 | Leave shell rc files alone | |
ZEROX_NO_NPMRC=1 | Don'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:
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:
| Package | Version |
|---|---|
@0xlimo/cli | 0.1.4 |
@0xlimo/net | 0.1.2 |
@0xlimo/platform | 0.1.1 |
@0xlimo/swarm-sw | 0.1.1 |
@x1/meshtorrent | 0.2.0 |
@0xlimo/iap | 0.1.0 |
@0xlimo/byo-assets | 0.1.1 |
@0xlimo/host | 0.1.1 |
curl -s https://0x.limo/npm/@0xlimo/cli0x 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
| Command | What it does |
|---|---|
0x init / 0x new | Creates a starter game from a template |
0x dev | Serves the game locally with a swarm and a dev broadcast service |
0x login / logout / whoami | Signs in to 0x hosting |
0x publish | Uploads to 0x hosting and prints the play URL, or self-hosts with --to |
0x deploy-server | Hosts the game's Node.js server on 0x |
0x server | Shows the hosted server's status and logs, and stops or starts it |
0x submit | Submits the store listing for review, and shows its status |
0x issues | Shows review issues and lets you answer them |
0x source check | Runs the reviewers' source scan and reproducible build locally |
0x assets | Bring-your-own-assets conversion (@0xlimo/byo-assets) |
0x paper | Bring 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.
