Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI

The engine repository includes a local Node CLI. Run it from the repository root:

Use the npm wrapper:

npm run cli -- <command>

Common package scripts wrap frequently used commands:

npm run build
npm run verify
npm test

Package scripts

Run package scripts from the repository root with npm run <script>:

  • setup: initialize and update submodules.
  • verify: run verify project.
  • build: build scripts, configs, UI, translations, and resources.
  • pack:mod: build a mod package.
  • pack:game: build a game package.
  • watch:scripts: rebuild scripts when TypeScript sources change.
  • typecheck: run TypeScriptToLua type checking without emitting files.
  • typecheck:tests: type-check test sources with TypeScript.
  • lint: run ESLint with the full repository rule set.
  • test: run Jest.
  • test:coverage: run Jest coverage.
  • format: rewrite Markdown, TypeScript, and LTX files using the configured formatters.
  • help: print CLI help.

Commands

The CLI builds and packages the project, manages resources and engine binaries, links a local game, and handles common format, spawn, particle, and verification tasks. Each command has its own page:

CommandPurpose
buildBuild target/gamedata.
cloneClone configured additional resource repositories.
compressCompress built gamedata into archives.
engineInspect, switch, list, or roll back bundled engines.
formatFormat LTX files.
spritesPack and unpack the equipment sprite and description sprites.
linkManage project links to the local game installation.
lintRun repository lint checks.
logsPrint the last lines from the linked game log.
openOpen configured game and project folders.
packCreate mod or game packages.
particlesPack or unpack particles.xr.
parseParse directory trees or game externals.
spawnUnpack ALife spawn files.
startStart the configured game executable.
testRun the project test suites.
verifyRun project, gamedata, LTX, particle, and translation verification.

Use npm run cli -- <command> --help for current command-specific options.

Paths and output

Run commands from the repository root unless a page says otherwise. Most defaults are repository-relative and come from cli/config.json.

Generated output belongs under target/: built gamedata, parsed helper files, coverage, packed archives, and package output. Source edits belong under src/engine, src/resources, cli, or the relevant external resource repository.

Installed command

package.json exposes the binary name xrf, but local development should prefer npm run cli -- ... so the command uses the repository version and local dependencies.

If the package is installed globally, the equivalent shape is:

xrf build
xrf verify project

Configuration

Most CLI defaults live in cli/config.json: locale, resource roots, build source paths, target paths, compression tools, package roots, and game executable settings.

When a command cannot find the game, resources, or generated output, check the command page first and then inspect the matching config key in cli/config.json. See CLI Configuration.