Install xrun on both machines
Public downloads are not available yet, so build from source on each machine. You need Rust (through rustup) and Bun. The built CLI needs no Rust, Node.js or Bun at runtime.
macOS / Linux
git clone https://github.com/xrun-sh/xrun.git
cd xrun
bun install --cwd cloudflare --frozen-lockfile
bun run --cwd cloudflare package
XRUN_CLOUDFLARE_BUNDLE_DIR="$PWD/cloudflare/.wrangler/package" cargo build --locked --releaseWindows · PowerShell
git clone https://github.com/xrun-sh/xrun.git
cd xrun
bun install --cwd cloudflare --frozen-lockfile
bun run --cwd cloudflare package
$env:XRUN_CLOUDFLARE_BUNDLE_DIR = "$PWD\cloudflare\.wrangler\package"
cargo build --locked --releaseIf you only use a self-hosted Linux relay, cargo build --locked --release is enough. The extra Bun steps embed the Cloudflare relay so that xrun relay deploy --provider cloudflare works.
The executable is target/release/xrun (xrun.exe on Windows). Keep it in a fixed directory on your PATH: the background service records its absolute path.
To use the binary from the build directory, add it to PATH in the current terminal:
macOS / Linux
export PATH="$PWD/target/release:$PATH"Windows · PowerShell
$env:Path = "$PWD\target\release;$env:Path"Deploy a relay
Every device connects out to a relay you own. Pick either option; both offer the same features.
Create the network
On macbook
xrun connect '<deployment link>' --name macbookReplace the placeholder with the complete link from the previous step. macbook becomes the manager and starts its background service. Where the relay runs does not decide which device is the manager.
Invite devbox
On macbook
xrun inviteIt prints the relay address and an eight-character access code such as K7M4-P9Q2. Codes are single-use, expire in 10 minutes and allow 5 attempts.
On devbox
xrun connect relay.example.com K7M4-P9Q2 --name devbox --allow-managerUse the address and code that invite printed. --allow-manager lets macbook use devbox and grants nothing else. Joining a network by itself grants no access.
Verify
On macbook
xrun status
xrun devbox -- uname -sstatus should list devbox as relay-connected, and the command should print Linux with exit code 0. On SOURCE_NOT_ALLOWED, run xrun allow-from macbook on devbox. On DEVICE_OFFLINE, check xrun status on devbox and start its service with xrun daemon start.
Run background jobs
start returns as soon as the target accepts the job. Replace K7Q2MX with the ID it prints.
On macbook
xrun devbox start -C /home/dev/app -- cargo test
xrun devbox logs K7Q2MX --tail 40
xrun devbox wait K7Q2MX --timeout 60Accepted jobs keep running when the caller disconnects or sleeps; query them again later. wait --timeout limits only the wait, never the job. Agents and scripts should add --json and a --request-id so that a retry never runs a job twice.
Next steps
xrun help gives a quick reference, and xrun doc reads the full manual offline.