xspec binary available on your system PATH. This page covers the prerequisites, the build steps, and the two ways to invoke the CLI once it is built.
Prerequisites
You need Node.js version 22 or later. xspec uses native TypeScript execution features and ESM patterns that require a modern Node.js runtime. Check your current version:v22.0.0, install a newer release from nodejs.org or through a version manager such as nvm or fnm before continuing.
Clone and build
Run the following commands to fetch the source, install dependencies, and compile the project:npm ci installs the exact dependency tree recorded in package-lock.json. npm run build compiles the TypeScript source to the dist/ directory and produces the CLI entry point.
Put xspec on your PATH
You have two options for invoking xspec after building it.Option 1 — npm link (recommended)
npm link creates a global symlink from your system’s node binaries directory to the xspec executable inside the repository. After running it, you can invoke xspec from any directory on your machine:
npm unlink xspec from the repository directory.
Option 2 — Direct path invocation
If you prefer not to modify your global npm bin directory, invoke the compiled entry point directly usingnode:
/path/to/xspec with the absolute path to the directory where you cloned the repository. You can add a shell alias to your .bashrc or .zshrc to avoid typing the full path every time:
Both invocation methods are functionally identical. The
npm link approach is more convenient for day-to-day use; the direct path approach is useful in restricted environments where global npm operations are not permitted.Project-level setup
xspec does not need to be listed as a dependency in your project’spackage.json. The defineConfig helper you import in xspec.config.ts is resolved through the globally linked binary, not through your project’s node_modules.
Create xspec.config.ts at the root of the workspace you want to instrument:
Keeping xspec up to date
Because you installed from a Git checkout, updating is a standardgit pull followed by a rebuild:
npm link, the existing symlink continues to point at the rebuilt output automatically — no need to re-run npm link.