# Rane: agent guide

Rane runs a repository's GitHub Actions jobs in throwaway VMs on the
person's own machines: one fresh VM per job, deleted afterwards. Today that
is Apple silicon Macs (at most 2 VMs per Mac); Linux machines are in
preview (see "macOS and Linux"). Everything is one CLI, `rane`, and the
same as MCP tools with `rane mcp`, talking to https://app.rane.dev (the
default; no `--server` needed). This guide takes you from nothing to a
green job. Follow it literally; every command is safe to rerun.

## 0. Install rane

```sh
curl -fsSL https://rane.dev/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"      # if `rane version` is not found
```

It installs the latest signed `rane` (checksum-verified, no GitHub token
needed) into `~/.local/bin`. Install it where you work:

- **On the machine that will run the VMs**: everything below, run there.
- **On your own computer** (a laptop, a dev box): sign in, look after
  machines, read jobs, change caches, and add other computers over SSH
  (`rane machine add --ssh`, see "Add a machine"). It does not need to be
  a runner itself.

## CLI or MCP

Use whichever your harness has; they are the same commands and answers.

- **CLI**: run `rane … --json` in a shell. Stdout is NDJSON ending in one
  `result` line (§2); the exit code says what to do next.
- **MCP**: `rane mcp` is an MCP server on stdio, built into the CLI and
  signed in with the CLI's own login (`rane login` once, or the `login`
  tool). Each tool runs the matching command and answers with that
  command's result line, `{command, ok, exit, data, error}`, as text and
  as `structuredContent`; `isError` is true when `exit` is not 0. Progress
  arrives as MCP progress notifications.

Add the server (after the install line above):

| agent | how |
| --- | --- |
| Claude Code | `claude mcp add rane -- rane mcp` (add `--scope user` for every project) |
| Codex | `codex mcp add rane -- rane mcp`, or in `~/.codex/config.toml`: `[mcp_servers.rane]` with `command = "rane"`, `args = ["mcp"]`, `tool_timeout_sec = 1800` (Codex stops tools after 60 s by default; a test run takes minutes) |
| Cursor | `~/.cursor/mcp.json`: `{"mcpServers": {"rane": {"command": "rane", "args": ["mcp"]}}}` |
| other MCP clients | a stdio server whose command is `rane mcp`; the same JSON as Cursor works for most |

If the agent cannot find `rane`, give the full path (`command -v rane`,
usually `~/.local/bin/rane`). For a server other than app.rane.dev, set
`RANE_SERVER` in the server's environment (`claude mcp add -e
RANE_SERVER=https://… rane -- rane mcp`).

The tools (`?` = optional argument):

| tool | arguments | CLI it runs |
| --- | --- | --- |
| `login_status` | | `rane login --check` |
| `login` | | `rane login --no-wait` (call again after the person approves) |
| `setup_status` | `repo?`, `machine?` | `rane doctor --remote` |
| `github_connect` | `repo` | `rane github connect --no-wait` |
| `machines_list` | | `rane machine ls` |
| `machine_show` | `machine` | `rane machine show` |
| `machine_add_instructions` | `ssh?`, `name?`, `pairing_code?` | none: returns the commands to add a machine (and, with `pairing_code`, a one-time pairing line) |
| `machine_drain` / `machine_resume` | `machine` | `rane machine drain` / `resume` |
| `machine_remove` | `machine` | `rane machine remove` |
| `machine_tag` | `machine`, `add?`, `remove?` | `rane machine tag --add/--remove` |
| `select` | `query` | `rane select` |
| `jobs_list` | `repo?`, `failed?`, `limit?` | `rane jobs` |
| `job_show` | `job` | `rane logs` |
| `cache_status` | `machine?` | `rane cache` |
| `cache_size` | `machine?`, `size` | `rane cache --size` |
| `cache_dir` | `machine?`, `dir`, `fresh?` | `rane cache --dir` |
| `cache_clear` | `machine?`, `repo?` | `rane cache clear` |
| `images_list` | `account?` | `rane image ls` |
| `image_use` | `image`, `repo` | `rane image use` |
| `image_build` | `name`, `script`, `from?` | `rane image build` (on the computer the server runs on) |
| `billing_status` / `billing_open` | `account?` | `rane billing` / `rane billing --open` |
| `workflow_preview` | `repo_dir` | `rane workflow init --convert --dry-run`: the diff, nothing written |
| `workflow_apply` | `repo_dir`, `convert?` | `rane workflow init --convert --yes`: writes it (no commit) |
| `test_run` | `repo` | `rane test --no-wait` |

Adding a machine is not a tool: it installs software and a service and
takes minutes, so it runs in a shell (`machine_add_instructions` gives the
exact lines). Call `workflow_apply`, `cache_clear`, `machine_remove` and
`billing_open` only after the person agreed.

## 1. One command

Run this in a checkout of the repository, on the machine that will run the VMs:

```sh
rane setup --repo OWNER/NAME --json
```

It runs `login → github connect → machine add → workflow init → test`, records
progress in `~/.config/rane/setup.json` and resumes at the first
unfinished step when rerun. Without `--no-wait` it waits on human steps by
itself (it polls); run it in the background or with a long timeout and
relay each `human` event to the user as it arrives.

Add `--yes` only after the user has agreed that rane may commit and push
`.github/workflows/rane-test.yml` to the default branch (and apply
`--convert` diffs). Add `--sudo` only if the user agreed to a sudo prompt
for `pmset`. Add `--no-wait` to get exit 2 at the first human step instead
of waiting.

Or step by step (the same, one command each):

```sh
rane login --json                              # prints a URL and a code; the person approves
rane github connect --repo OWNER/REPO --json   # waits until Rane's GitHub App covers the repo
rane machine add --json                        # this machine (or --ssh USER@HOST from elsewhere)
rane doctor --fix --json                       # checks, and fixes what it can
rane test --repo OWNER/REPO --json             # runs .github/workflows/rane-test.yml; --commit once the person agrees
cd <checkout> && rane workflow init --convert --json   # the diff moving macos-* jobs to runs-on: rane (exit 2)
rane workflow init --convert --yes --json      # applies it, after the person agrees; then commit on a branch and open a PR
```

If the person already clicked **Continue with GitHub** on
https://app.rane.dev, the App is on their account and `github connect`
returns at once (or asks them to add the repository).

## Add a machine

**This computer**: `rane machine add --json` (also step 3 of `rane setup`).
It checks the machine, picks a disk, installs the agent, pairs it with
your login, gets the image and starts the service (details under "The
commands").

**Another computer, from here, over SSH**:

```sh
rane machine add --ssh USER@HOST --json          # looks at HOST, prints the plan, exits 2
rane machine add --ssh USER@HOST --yes --json    # after the person agreed: does it
```

- It uses the person's own `ssh` (their `~/.ssh/config`, keys and agent;
  a `Host` alias works) in batch mode: rane never types or stores a
  password.
- First it only looks: OS, chip, version, who is logged in at the screen
  (macOS), KVM and sudo (Linux). Then it prints the commands it will run
  there. Without `--yes` it stops with exit 2 (`ssh.confirm`); ask the
  person, then rerun with `--yes`.
- With `--yes` it makes a one-time pairing code with this computer's
  login, installs rane on HOST with `install.sh`, and runs `rane machine
  add --pair <code>` there (under `sudo -n` on Linux when not root),
  streaming HOST's progress as its own (`remote` names HOST).
- The result is HOST's own `machine add` result, plus `ssh`: `{target,
  host, user, os, arch, version, gui_session, console_user, kvm, sudo}`.
  A human step on HOST comes back as `On HOST: …`, with its commands
  wrapped in `ssh -t USER@HOST '…'`.
- `--name`, `--slots`, `--data-dir`, `--image`, `--release` and `--sudo`
  are passed on.

| id | exit | what it means / what the person does |
| --- | --- | --- |
| `ssh.confirm` | 2 | agrees to the printed plan; you rerun with `--yes` |
| `ssh.auth` | 2 | SSH wants a password: they run `ssh-copy-id USER@HOST` once (or add their key), then you rerun |
| `ssh.host_key` | 2 | HOST's key is unknown or changed: they run `ssh USER@HOST true` and check the fingerprint |
| `ssh.connect` | 3 | HOST did not answer: is it on, with SSH on (Mac: System Settings → General → Sharing → Remote Login)? |
| `ssh.host` | 1 | the name does not resolve: use the IP or a `Host` from `~/.ssh/config` |
| `agent.gui_session` | 2 | (Mac) nobody, or another user, is logged in at HOST's screen: they log in as USER (or Screen Sharing) and turn on automatic login |
| `ssh.sudo` | 2 | (Linux) USER is not root and has no passwordless sudo: connect as root, allow sudo, or run the shown commands on HOST |
| `ssh.install` | 1 or 3 | installing on HOST failed; the message is HOST's last line |

**A person at the other machine** (no SSH): the dashboard's Add a machine
panel, or the `machine_add_instructions` tool with `pairing_code: true`,
gives a one-line command with a single-use code (valid 24 h) to paste in a
terminal there.

## macOS and Linux

| | macOS (Apple silicon, 26.4+) | Linux (preview) |
| --- | --- | --- |
| VMs | Virtualization.framework, at most 2 per Mac | Cloud Hypervisor microVMs on KVM |
| service | a LaunchAgent in the logged-in user's session: someone must be logged in at the screen; turn on automatic login for reboots | a systemd service, started at boot |
| privileges | none to install; `--sudo` only to stop the Mac sleeping (`pmset`) | root (or passwordless sudo) to install the service and use KVM |
| clicks | Local Network **Allow** on the first VM; automatic login (optional) | none |
| status | released | being built; not in a release yet. `rane machine add` on Linux and `--ssh` to Linux work once it ships |

## 2. Reading the output

With `--json`, stdout is NDJSON. Every line has `type` and `time`:

| type | fields | meaning |
| --- | --- | --- |
| `progress` | `step`, `message`, optional `percent`, `phase`, `setup_step` | work in progress |
| `human` | `id`, `human_action`, `url`, `commands`, `waiting` | a person must act; if `waiting` is true the command continues by itself afterwards |
| `timeline` | `step`, `label`, `at`, `job_id` | a job's VM steps (clone, boot, …, deleted) |
| `log` | `text` or `url` | `rane logs`: why a failed job's VM failed (the agent's last lines), then the job's log `url` on GitHub |
| `result` | `command`, `ok`, `exit`, `data`, `error` | always the last line, exactly once |

`error` is `{id, message, hint, human_action, url, commands, exit}`.
Diagnostics go to stderr; never parse stderr.

Exit codes, for every command:

| exit | meaning | what you do |
| --- | --- | --- |
| 0 | done | continue |
| 1 | error | read `error.message` and `error.hint`; fix, then rerun |
| 2 | needs a person | show the user `human_action`, `url` and `commands` (see §4), wait for "done", rerun the same command |
| 3 | transient | rerun the same command (after ~30 s) |

Every command is safe to rerun.

## 3. The commands

| command | does | example `data` |
| --- | --- | --- |
| `rane login [--open] [--no-wait] [--check]` | device-code sign-in; token in `~/.config/rane/credentials.json` (0600). `--no-wait` prints the code and exits 2; rerun it to check once whether it was approved. `--check` only reports who is signed in (exit 2 if nobody) | `{"server","user":{"login"},"accounts":1,"already_signed_in":false}` |
| `rane github connect --repo o/r [--no-wait]` | waits until the GitHub App can use the repo, then ensures its runner set | `{"repo","account","installed":true,"covered":true,"runner_set":{"runs_on":"rane"}}` |
| `rane machine add [--name N] [--slots auto\|1\|2] [--image tahoe-runner] [--data-dir auto\|DIR] [--from-source DIR] [--pair TOKEN] [--sudo]` | preflight, disk pick, agent + signed helper, pairing, agent.yaml, image, launchd service, power | `{"name","machine_id","data_dir","slots":{"count":1,"cpu":4,"memory_mb":4096},"steps":[{"step":"image","status":"done"}],"warnings":[]}` |
| `rane machine add --ssh USER@HOST [--yes] [--name N] …` | adds another computer over SSH (see "Add a machine") | the remote add's `data`, plus `ssh` |
| `rane workflow init [--repo-dir .] [--convert [--yes]] [--dry-run]` | writes `.github/workflows/rane-test.yml`; with `--convert` shows (and with `--yes` applies) the diff moving `runs-on: macos-*` jobs to `runs-on: rane`; `--dry-run` writes nothing and the diff includes the test workflow | `{"test_action":"created","changes":[…],"diff":"…","applied":false,"dry_run":true}` |
| `rane test --repo o/r [--commit]` | makes sure the test workflow is on the default branch, dispatches it, streams the timeline, exits 0 on green | `{"run_url","green":true,"job_id":5,"machine":"mini","timeline":[…]}` |
| `rane doctor [--fix [--sudo]] [--repo o/r]` | local + server readiness checks, each with its fix | `{"ready":false,"checks":[{"id","status","summary","fix","fixable","sudo","human","source"}]}` |
| `rane doctor --remote [--repo o/r] [--machine M]` | only the server's checks (GitHub App, repo, runner set, every machine or one): for an agent on another computer | same |
| `rane status` | this machine's service and every machine's slots | `{"machines":[{"name","status","slots":[…]}],"service":{"running":true}}` |
| `rane machine ls` / `rane machine show [M]` | your machines (name or id; default this machine): what each is and has (`facts`: os, version, arch, chip, cores, memory, GPUs, images, …), `shape`, `tags`, slots, health and recent events | `{"machines":[{"id","name","status","facts","shape","tags","slots":[…]}]}` / `{"id","name","status","facts","shape","tags","host","slots","events"}` |
| `rane machine drain [M] [--wait]` / `rane machine resume [M]` | stop taking jobs (running jobs finish) / take them again; default this machine | `{"id","status":"draining","want_drain":true}` |
| `rane machine remove M` | revokes the machine's credential: it stops reporting and takes no more jobs (owners only) | `{"id","status":"revoked"}` |
| `rane machine tag M fast,ios` / `rane machine tag M --add T --remove T` | sets (or edits) a machine's tags, for `runs-on: rane/tag=fast` | `{"id","name","tags":["fast","ios"]}` |
| `rane select "os=linux gpu=nvidia"` | the `runs-on` label for a selection and which machines match it, with why the others do not; exit 1 when none does (see "Choosing machines") | `{"runs_on":"rane/os=linux/gpu=nvidia","matches":1,"summary":"1 of 2 machines matches","machines":[{"name","match":true,"ready":true,"reasons":[]}]}` |
| `rane queue` | jobs waiting on GitHub for one of your machines, and why | `{"jobs":[{"repo","name","runs_on","state":"unmatched","reason":"no machine with gpu=amd"}]}` |
| `rane cache [--machine M] [--size 100GB\|auto] [--dir D [--fresh]]` | shows, resizes or moves the machine's build cache (see Caching); waits up to 90 s for the agent to apply it | `{"machine","machine_id","cache":{"dir","volume","used_bytes","limit_bytes","entries","hits_7d","misses_7d","saved_bytes_7d","error"},"pending":false}` |
| `rane cache clear [--machine M] [--repo o/r]` | empties the build cache (or one repository's entries) | same as `rane cache` |
| `rane image ls [--account A]` | machine images: the catalogue and the account's own, sizes, which machines have each, which runner sets use it | `{"registry","namespace","catalogue":[{"name","kind","ref","digest","compressed_bytes","size_bytes","used_by","machines":[{"machine","present","current","pulling","last_used"}]}],"images":[…],"quota":{"images","used","storage_bytes","used_bytes"}}` |
| `rane jobs [--repo o/r] [--failed] [--limit 20]` | recent jobs, newest first; `status` is success, failure, cancelled, lost, error (the VM failed before the job), running or waiting; failed ones carry `failure` (why, in words) and `next` | `{"jobs":[{"id","repo","workflow","job","machine_name","status","conclusion","error","url","failure","next":"rane logs 12"}]}` |
| `rane logs <job> [--follow]` | a job's timeline, its log on GitHub (Rane stores no job output) and, for a failed job, the agent's last ~200 lines for its VM | `{"job":{…},"timeline":[…],"log_url":"https://github.com/…","failure_log":"…"}` |
| `rane update [--check]` | updates rane and the agent to the latest release; the agent drains and restarts | `{"from","to","updated":[…]}` |
| `rane mcp` | the MCP server on stdio (see "CLI or MCP"); never takes `--json` | (MCP) |
| `rane agent-guide [--global]` | writes this guide into AGENTS.md and `.claude/skills/rane/SKILL.md` (or `~/.claude/skills`) | `{"written":[…],"unchanged":[…]}` |
| `rane billing [--open] [--account A]` | hosted: the account's plan ($29 per machine per month, 14-day free trial, no card); `--open` adds `open_url`, a one-time Stripe Checkout (or billing portal) link for the person | `{"enabled","entitled":true,"state":"trial","trial_days_left":9,"machines":2,"monthly_cents":5800,"action":"checkout","open_url"}` |
| `rane admin signin-link [--next PATH]` | operator only (env `RANE_ADMIN_TOKEN`): a one-time dashboard sign-in URL for a person, valid 15 min, default `/settings/github` | `{"server","url","next","expires_at"}` |

Common flags: `--json`, `--server URL` (env `RANE_SERVER`). `RANE_TOKEN`
overrides the saved sign-in.

What `rane machine add` decides:

- **Disk**: the APFS volume with the most free space that holds the image
  plus 40 GB; the boot disk is refused below that. A rerun keeps the disk
  chosen first (`--data-dir DIR` moves it).
- **Slots**: under 24 GB RAM, 1 VM with 4 GB; 24 GB and up, 2 VMs with up to
  8 GB each; vCPUs = (cores − 2) / slots, 2 to 4 (8 from 32 GB).
- **Service**: a LaunchAgent (`~/Library/LaunchAgents/dev.rane.agent.plist`)
  in the user's GUI session, because macOS VMs need a logged-in user. It
  starts at login, restarts on any exit, runs at normal priority and logs to
  `<data dir>/logs/agent.log`. For start at boot, turn on automatic login.

## Permissions we need and how we collect them

"Agent" means you do it with a command; "human" means a person clicks.

| permission | why | who | exact step |
| --- | --- | --- | --- |
| GitHub App (once per server): create it | the server acts as an App, not a person | agent, then human | operator agent: `RANE_ADMIN_TOKEN=… rane admin signin-link` prints a one-time URL (15 min, single use) to `/settings/github`; the human opens it, clicks **Continue**, **Create on GitHub**, then **Create GitHub App** on GitHub. Keys are sealed with `RANE_SECRET_KEY` and stored server-side |
| App, repo: Administration write | register runners and scale sets for one repository | human | **Install** on GitHub (next row) grants all App permissions at once |
| App, repo: Actions write | see workflow jobs; dispatch `rane-test.yml` | human | same Install click |
| App, repo: Contents read | read the test workflow and default branch | human | same Install click |
| App, repo: Metadata read | required by GitHub | human | same Install click |
| App, org: Self-hosted runners write | org runners and scale sets | human (org owner) | same Install click on the org |
| App: `workflow_job` webhook | job events for the webhook job source | none | in the App manifest; nothing to click |
| App install on an account | the App sees that account's repos | human | `rane github connect --repo o/r` prints `github.install`: open `url`, pick the repo, **Install** (new permissions: **Review request** → **Accept**) |
| User sign-in (dashboard) | know who you are and which installs you see | human | **Sign in with GitHub** on the dashboard → **Authorize** (also happens right after an install) |
| `rane login` (device flow) | a CLI access token for your account | agent, then human | `rane login` prints `auth.device`: open `url`, check the code, **Approve** |
| macOS automatic login | macOS VMs need a logged-in GUI session, also after reboots | human | System Settings → Users & Groups → Automatically log in as (needs FileVault off) |
| Local Network (rane-agent) | the agent reaches its VMs on the local network | human | click **Allow** on the macOS prompt; if missed: System Settings → Privacy & Security → Local Network → rane-agent on |
| Virtualization entitlement | `rane-vmhelper` runs the VMs (`com.apple.security.virtualization`) | agent | `rane machine add` installs it signed; `rane doctor --fix` re-signs |
| Disk | image + 40 GB free on an APFS volume | agent (human if short) | `rane machine add` picks the volume; if `disk.free`, the human frees space or attaches a disk |
| Never sleep | a sleeping Mac takes no jobs | agent with sudo, or human | `rane doctor --fix --sudo`, or the human runs `sudo pmset -a sleep 0 autorestart 1` |

## 4. Human steps: how to present them

Show one block per step, with the exact words from `human_action`, the
`url` as a link and any `commands` verbatim. Do not paraphrase codes or
URLs. Then say you will continue on your own and keep waiting (or rerun
when the user says done). The steps that can come up:

| id | what the person does |
| --- | --- |
| `auth.device` | opens the URL, signs in with GitHub, checks the code, clicks **Approve** |
| `github.install` | installs the GitHub App on the owner, picks the repository, clicks **Install** (or adds the repo / accepts new permissions) |
| `power.sleep` | runs `sudo pmset -a sleep 0 autorestart 1` in a terminal on the Mac (password prompt), or allows you to rerun with `--sudo` |
| `workflow.confirm` | reviews the `--convert` diff and agrees; then rerun with `--yes` |
| `workflow.missing` | agrees that rane commits the test workflow (rerun `rane test --commit`), or commits the shown files themselves |
| `workflow.push` | the default branch is protected: merges a PR adding the test workflow |
| `agent.gui_session` | logs in at the Mac's screen (or Screen Sharing); ideally turns on automatic login |
| `macos.version` | updates macOS to 26.4 or later |
| `disk.free` | frees space or attaches an APFS disk |
| `xcode.beta` | runs `sudo xcode-select -s /Applications/Xcode.app` |
| `ssh.confirm`, `ssh.auth`, `ssh.host_key`, `ssh.sudo` | see "Add a machine" |
| first VM on a Mac | clicks **Allow** on the macOS "find devices on your local network" prompt for rane-agent (the screen must be unlocked; missed it: System Settings → Privacy & Security → Local Network → rane-agent on) |
| `billing_open` / `rane billing --open` | opens `open_url` and subscribes or updates the card; paying is theirs |
| server `app_not_installed`, `repo_not_covered`, `permission_missing`, `no_machine` | does what `human_action` says at `url` |

Ask the person before: committing or pushing anything, opening a PR,
`--yes` (applying `--convert` diffs, `--ssh` installs), `--sudo`,
clearing a cache, removing a machine, or opening billing.

## 5. Errors and recovery

| id | exit | recovery |
| --- | --- | --- |
| `auth.login` | 2 | `rane login` |
| `auth.expired` | 3 | `rane login` (new code) |
| `auth.denied` | 1 | the user declined; ask, then `rane login` |
| `server.unreachable`, `timeout`, `interrupted`, `git.remote`, `binaries.download`, `image.build`, `image.import`, `update.github` | 3 | rerun the same command |
| `usage` | 1 | fix the flags |
| `preflight.os`, `preflight.arch` | 1 | run `rane machine add` on an Apple silicon Mac |
| `ssh.confirm`, `ssh.auth`, `ssh.host_key`, `ssh.sudo` | 2 | see "Add a machine" |
| `ssh.connect` | 3 | rerun once HOST answers SSH |
| `ssh.host`, `ssh.missing`, `ssh.probe` | 1 | fix the host name / install ssh / run `ssh USER@HOST uname -a` to see why |
| `ssh.install`, `ssh.remote` | 1 or 3 | read the message (HOST's last line); 3: rerun |
| `binaries` | 1 | no release reachable: retry; else set `GITHUB_TOKEN`, or `rane machine add --from-source <rane checkout>` |
| `image.tart_missing` | 1 | `brew install cirruslabs/cli/tart`, rerun (only until prebuilt images ship) |
| `pair.enroll` | 1 | pairing token used or expired: rerun `rane machine add` (it asks for a new one) |
| `workflow.not_repo` | 1 | pass `--repo-dir` pointing at a checkout of the repo |
| `test.failed` | 1 | `rane logs <job_id>`; open `run_url` |
| `machine.unknown` | 1 | `rane machine ls` lists machines; name one |
| `update.release`, `update.replace` | 1 | reinstall: `curl -fsSL https://rane.dev/install.sh \| sh` |
| `doctor.failed` | 1 | apply each failing check's fix (below); `rane doctor --fix` for the fixable ones |
| `doctor.human` | 2 | show the failing checks' fixes to the user |
| `doctor.server` | 3 | rerun `rane doctor` |

## 6. Doctor checks

`rane doctor --json` lists checks with `status` ok / warn / fail. `fixable`
means `rane doctor --fix` applies it (`sudo: true` also needs `--sudo`);
`human: true` means only a person can.

| id | fails when | fix |
| --- | --- | --- |
| `host.arch` | not Apple silicon | use an M1 or later Mac |
| `macos.version` | macOS < 26.4 | Software Update (human) |
| `agent.config` | agent.yaml missing or invalid | `rane machine add` |
| `disk.free` | < 20 GB or < 10% free on the VM disk (warn < 40 GB) | free space, or `rane machine add --data-dir <bigger volume>` |
| `power.sleep` | the Mac sleeps (warn: no restart after power loss) | `--fix --sudo`, or the user runs `sudo pmset -a sleep 0 autorestart 1` |
| `login.autologin` | warn: no automatic login, so nothing runs after a reboot until someone logs in | System Settings → Users & Groups → Automatically log in as (human) |
| `filevault` | warn: FileVault on, so automatic login is impossible | accept, or turn FileVault off (human decision) |
| `vmhelper.entitlement` | rane-vmhelper missing or unsigned | `--fix` re-signs; if missing, `rane machine add` |
| `agent.service` | LaunchAgent not installed / not loaded / not running / no GUI session | `--fix` loads or starts it; not installed: `rane machine add`; no GUI session: log in (human) |
| `agent.enrolled` | not paired, or the credential file is readable by others | `rane machine add` (or `chmod 600` the file) |
| `server.reachable` | the agent's server does not answer `/healthz` | check the network; retry |
| `image.present` | golden image missing, or changed since hashed (warn: digest not computed yet) | `rane machine add`; for a changed image delete it and rerun `rane machine add`; for warn wait and rerun |
| `vm.slots` | warn: fewer warm slots than configured | wait a minute; then read the agent log |
| `network.local` | the agent log shows "no route to host" to its VMs | System Settings → Privacy & Security → Local Network → allow rane-agent (human) |
| `memory.swap` | warn: heavy swap use | close apps, or `rane machine add --slots 1` |
| `cache.volume` | warn: the build cache's disk is not mounted, or is a network volume; jobs still run, uncached | attach the disk, or `rane cache --dir <folder on a local disk>` |
| `auth.login` | warn: not signed in, server checks skipped | `rane login` |
| `server.readiness` | the server's readiness could not be read | rerun |
| server checks (`source: "server"`) | GitHub App, runner set, Mac online, image on the server's side | follow `fix` / `url`; `fix_command` when given |

## Choosing machines

`runs-on: rane` sends a job to any of the account's machines. Add
`/key=value` parts to pick some. It is one label: lower case, no spaces
or commas (GitHub does not match them), at most 255 characters.

```yaml
runs-on: rane                              # any of your machines
runs-on: rane/os=macos                     # any Mac
runs-on: rane/os=macos/macos=26/image=ios  # macOS 26 with your "ios" image
runs-on: rane/os=linux/gpu=nvidia/vram=16+ # Linux, an NVIDIA GPU with at least 16 GB
runs-on: rane/mem=32+/tag=fast             # at least 32 GB of memory, your tag "fast"
```

| key | value | example |
| --- | --- | --- |
| `os` | macos or linux | `os=linux` |
| `macos` | macOS version | `macos=26`, `macos=26.4+` |
| `linux` | distro and/or version | `linux=ubuntu-24.04`, `linux=22.04+` |
| `arch` | arm64 or x64 | `arch=arm64` |
| `chip` | words of the chip or CPU model | `chip=m4-pro`, `chip=epyc` |
| `cpu` | cores | `cpu=8+` |
| `mem` | memory in GB (or `512m`, `1t`) | `mem=32+` |
| `disk` | free disk in GB | `disk=100+` |
| `gpu` | vendor: nvidia, amd, intel, apple or any | `gpu=nvidia` |
| `gpu_model` | words of the GPU model | `gpu_model=rtx-5080` |
| `vram` | GPU memory in GB | `vram=24+` |
| `image` | an image the machine has, or can fetch | `image=ios` |
| `tag` | a tag you gave machines; repeat for several | `tag=fast/tag=xcode16` |
| `machine` | one machine, by name or id | `machine=studio` |
| `isolation` | vm, microvm, sandbox or container | `isolation=microvm+` |
| `pool`, `provider`, `burst` | for cloud compute: accepted now; today jobs run on your own machines only | `pool=owned` |

A `+` means "at least" (for `isolation`, that strong or stronger); without
it a value must match. Sizes allow 5% because machines report a little
less than they have.

Before you commit a label, `rane select "os=linux gpu=nvidia"` prints the
`runs_on` to write and every machine with `match`, `ready` and `reasons`
(exit 1 when none matches). `rane machine tag M fast,ios` sets tags. A job
no machine can run stays queued on GitHub; `rane queue` says why
(`"state": "unmatched"`, e.g. "no machine with gpu=amd"), and it starts
once the label or the machines change. `runs-on: rane-NAME` still reaches
the runner set `rane image use NAME --repo o/r` made (see "Machine
images").

## 7. Day two

- Use the runners: `runs-on: rane`.
- Before macOS updates or desk use: `rane machine drain --wait`, then `rane machine resume`.
- What failed and why: `rane jobs --failed --json` (each has `failure`
  and `next`), then `rane logs <job id>` for the VM's own log and the
  job's log link on GitHub.
- Jobs never start and `rane billing --json` says `"entitled": false`: the
  trial ended or a payment failed. Run `rane billing --open` and give the
  person `open_url` to subscribe or update the card. Macs stay paired.
- Anything odd: `rane doctor --json`, apply fixes, rerun.

## Machine images

Machines boot job VMs from a golden image. Besides the one `rane machine
add` installs, the server hosts images (details: `docs/images.md`):

- The catalogue (`macos-26`: macOS 26 with the Actions runner) and the
  account's own images, built with `rane image build`. `rane image ls`.
- A runner set names its image; `rane image use my-ios --repo o/r` makes
  the set `rane-my-ios`, and jobs say `runs-on: rane-my-ios`. Every machine
  of the account then pulls the image by itself, and jobs start there once
  it has.
- Each machine keeps the images its runner sets use and evicts unused
  ones, least recently used first, when the disk runs low or they pass
  `image_budget_gb` in agent.yaml (default: no cap). An evicted image is
  pulled again when needed.
- `rane image build` needs one of the machine's two VM slots free
  (`rane machine drain --wait` first on a busy machine). Plans keep 3
  private images on the trial, 10 when paid.
- Linux container images live in the same registry for `docker pull` and
  cloud providers: `rane image token` makes the read-only password.

## Caching

Each Mac runs a build cache that `actions/cache` (v4+) and the `setup-*`
actions' `cache:` option use with no workflow changes: saves and restores
stay on the Mac's disk. VMs stay clean; only cache entries persist.
Entries are scoped like GitHub's: per repository, a job saves to its own
ref and restores from its own ref, its PR's base branch and the default
branch. Details: `docs/caching.md`.

- Size: `rane cache --size 100GB` (default: the smaller of 50 GB and 15%
  of free space; `--size auto` goes back to it). Least recently used
  entries are evicted.
- Place: `cache_dir` in agent.yaml, default `cache/` on the Rane data
  volume. `rane cache --dir /Volumes/Disk/rane-cache` moves it (copies the
  entries when they fit; `--fresh` starts empty). It must be an absolute
  path on a local, writable volume with room for the limit.
- `rane cache` settings live in `<state dir>/cache.json` and win over
  agent.yaml's `cache_gb` / `cache_dir`; `cache: false` turns it off.
- `rane cache clear [--repo o/r]` empties it. The dashboard's Mac page
  shows "Cache: used / limit on volume" with Change and Clear.
- If the cache's disk is unplugged, `rane doctor` warns (`cache.volume`)
  and jobs run without it until the disk is back.
