# Capy Dock recipe

URL: https://briq.cloud/cookbook/capy-dock

> A dedicated Capy device with interactive pairing and a saved home for threads.

Tags: agents, sandbox

Guide:

- [Run Capy Dock on Briq](https://briq.cloud/docs/guides/run-capy-dock.md): Pair a dedicated Briq sandbox with your Capy account and run threads on its saved home.

## Run it

CLI:

```bash
briq run capy-dock
```

MCP:

```ts
briq_run({ recipe: "capy-dock", wait: true })
```

REST:

```bash
curl -X POST https://api.briq.cloud/v1/briqs \
  -H "Authorization: Bearer $BRIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipe": "capy-dock",
    "wait": true
  }'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "HOME": "…" }, … }

# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
  -H "Authorization: Bearer $BRIQ_API_KEY"
```

briq.yaml:

```yaml
stack: app
services:
  dock:
    recipe: capy-dock
    # its defaults, each a field you can set:
    # image: ghcr.io/briq-cloud/sandbox:latest
    # size: small
    # volume: { gb: 5 }
```

## Fields

Set them beside `recipe`, in briq_run or a briq.yaml service, as a GitHub Actions service.

| Name | Type | Options | Default | What it does |
| --- | --- | --- | --- | --- |
| `image` | string | — | "ghcr.io/briq-cloud/sandbox:latest" | A compatible Ubuntu sandbox image with Python 3, useradd, runuser, su, flock, curl and git |
| `size` | enum | pico, micro, nano, small, medium, large, xlarge | "small" | Compute shared by this device’s threads |
| `volume` | object | { gb? } | {"gb":5} | The uncopied home at /home/capy: install, identity, repositories and worktrees |
| `egress` | object | { hosts } | — | Restrict outbound HTTPS on port 443 to these exact hostnames. An empty hosts list denies all. Standalone sandboxes only; requires a supporting runtime |

## Outputs

Returned by `briq_run` once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

| Output | Value |
| --- | --- |
| `HOME` | `/home/capy` |
| `WORKTREES` | `/home/capy/.capy/worktrees` |

## What it runs

| Briq | Image | Ports | Size | Volume |
| --- | --- | --- | --- | --- |
| dock | `ghcr.io/briq-cloud/sandbox:latest` | — | small | 5 GB at /home/capy |

## When to use it

* Run Capy threads on a Briq sandbox instead of your laptop.
* Keep one device identity, repository clones and worktrees through restarts.
* Share one sandbox's compute across trusted Capy threads.

## Tips

* **Pair it yourself**: follow [Run Capy Dock](https://briq.cloud/docs/guides/run-capy-dock) in your own interactive terminal.
* **Expect an offline device first**: recipe readiness means the supervisor is ready, not that Dock is paired.
* **Keep the home**: `/home/capy` holds the install, identity, repositories and `~/.capy/worktrees`.
* **Trust both audiences**: Briq team credentials and Capy device access can reach the saved identity and files.
* **Push work off the Briq**: this volume cannot be forked or backed up. Destroying the Briq deletes local commits too.
* **Choose a sleep policy**: Capy's outbound traffic does not keep a Briq awake. Always-on requires an eligible plan.
* **Use no public endpoint**: Dock connects outbound. This recipe exposes no port.
