> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crucihil.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a Rig to the Dashboard

> Register a rig, start the local agent, and watch test results stream into the cloud dashboard live

The [Quickstart](https://docs.crucihil.io/quickstart.md) runs everything locally. This guide connects that
same setup to the cloud control plane, so you can trigger runs from the web
dashboard and see results stream in live — still with no hardware required.

## What you need

* **A CruciHiL account.** On the hosted platform, create one at
  [app.crucihil.io/signup](https://app.crucihil.io/signup) (you'll verify your
  email, then land in the dashboard). On a self-hosted deployment, use your
  instance's dashboard — see [Self-hosting](https://docs.crucihil.io/guides/self-hosting.md) to stand one up.
* **CruciHiL installed locally** ([Installation](https://docs.crucihil.io/installation.md)) and the
  `hello_world` example from the [Quickstart](https://docs.crucihil.io/quickstart.md) — or any rig TOML of
  your own.

## Step 1 — Register the rig in the dashboard

In the dashboard, go to **Rigs → Register Rig**, give the rig a name
(e.g. `dev-bench-01`), and register it.

The response shows the rig's **API key once** — copy it now. It is stored
server-side only as a SHA-256 hash and cannot be recovered later (you'd
delete the rig and register again).

> [!NOTE]
>
> On the hosted platform, the free plan includes **1 rig** per organisation —
> the Rigs page shows your usage (e.g. "1 of 1 rigs used"). Registering beyond
> your plan's limit returns a clear error with the upgrade path. Self-hosted
> deployments have no rig limits.

> [!NOTE]
>
> Rig registration on the hosted platform requires a signed-in org admin. The
> static `REGISTRATION_TOKEN` self-registration flow described in
> [`crucihil agent`](https://docs.crucihil.io/cli/agent) applies to **self-hosted** deployments only.

## Step 2 — Give the agent its credentials

The agent needs two things: where the control plane is, and the rig's API key.
Environment variables are the simplest way (they take precedence over any
`[rig.cloud]` section in the TOML):

```bash theme={null}
export CRUCIHIL_BASE_URL=https://crucihil-server.fly.dev   # hosted platform
export CRUCIHIL_API_KEY=crucihil-rig-...                   # the key from Step 1
```

For a self-hosted control plane, point `CRUCIHIL_BASE_URL` at your own server.

Alternatively, put the connection in the rig TOML:

```toml theme={null}
[rig.cloud]
url     = "https://crucihil-server.fly.dev"
api_key = "crucihil-rig-..."
```

## Step 3 — Start the agent

From the directory that contains your suites (e.g. `examples/hello_world/`):

```bash theme={null}
cd examples/hello_world
crucihil agent --rig rigs/virtual.toml -v
```

The agent connects **outbound** over WebSocket — no inbound ports, no firewall
changes on the bench. Within a few seconds the Rigs page shows the rig
**online**.

## Step 4 — Trigger a run from the dashboard

Go to **Runs → Run Suite**, pick your rig, and enter the suite path:

```
suites/hello.yaml
```

> [!WARNING]
>
> The suite path is resolved **relative to the agent's working directory** —
> the directory you started `crucihil agent` from, not the dashboard.

The run appears as `queued → running`, and each test result streams into the
run detail page live as it completes. If the agent loses connectivity
mid-run, results are cached in local SQLite and synced when it reconnects —
nothing is lost.

## Troubleshooting

| Symptom | Likely cause |
| - | - |
| Agent exits with `401` | Wrong or revoked API key — re-check `CRUCIHIL_API_KEY` |
| Rig never shows online | `CRUCIHIL_BASE_URL` wrong, or outbound HTTPS/WSS blocked on the bench |
| Registration returns `403` with a rig-limit message | Your plan's rig quota is reached — the message names the upgrade path |
| Run fails immediately with a missing-suite error | Suite path isn't relative to the agent's working directory |

## Production benches

For a bench that should survive reboots, install the agent as a `systemd`
service with `scripts/install-agent.sh` — see
[Self-hosting → Bench agents](https://docs.crucihil.io/guides/self-hosting.md). For the credential model
behind rig keys, user JWTs, and viewer keys, see
[Authentication & access](https://docs.crucihil.io/guides/authentication.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.