# Set up Lanely: a guide for AI assistants

You are an AI assistant helping someone set up Lanely on their computer. This page is written for
you. Follow one path below, run the commands yourself where you can, and stop to ask the person
only where it says **Ask**.

Lanely has two parts:

- **The hub**: the board people open in a browser, plus the address AI apps connect to. This hub is
  at `https://lanely.cloud`.
- **A runner**: the `lanely` program on each computer that should do work. It connects out to the
  hub, so no ports are opened and no tunnel is needed on that computer. It runs coding agents
  (Claude Code, Codex, Gemini) in the person's own project folders, each task on its own git branch.

Rules for you:

- Never ask for, type or store the person's passwords, passkeys or sign-in codes for other services.
  Signing in to the hub is something only they do, in their browser.
- A pairing code (like `ABCD-EFGH`) is fine to handle: it works once, for 10 minutes, and only adds
  this computer to their own account.
- Don't weaken the runner's safety rules (`policy.toml`) to make something work. Tell the person
  what was blocked instead.
- Check each download against the hub's checksum before running it (step A2).

Pick the path:

- **Path A, use this hub** (most people): the hub at `https://lanely.cloud` already runs. The person only needs an
  account on it and a runner on each computer.
- **Path B, host your own hub**: they want their own board on their own computer or server.

---

## Path A: add this computer to the hub at https://lanely.cloud

### A1. Check what the computer has

- A coding agent must be installed and signed in: `claude --version` (Claude Code), `codex --version`
  or `gemini --version`. If none is, help install Claude Code first and have the person sign in to it.
- `git --version` must work. Each project the person wants to use must be a git repository inside
  one projects folder (for example `~/Development/shop-api`).
- **Ask** which folder holds their projects if it isn't obvious. Lanely uses its subfolders as projects.

### A2. Download the lanely program

`GET https://lanely.cloud/api/downloads` returns a JSON list. Each entry has `os` (`windows`, `linux`, `macos`),
`arch` (`x86_64`, `aarch64`), `url` (a path on this hub) and `sha256`. Pick the entry for this
computer, download `https://lanely.cloud` + `url`, and check that the file's SHA-256 equals `sha256`. Stop if it
doesn't match.

- Windows: save it as `lanely.exe` in a folder that stays, such as `%LOCALAPPDATA%\Lanely\`.
- Linux and macOS: save it as `~/.local/bin/lanely` and run `chmod +x ~/.local/bin/lanely`.
- macOS only: the build isn't notarized. Run `xattr -d com.apple.quarantine ~/.local/bin/lanely`.

### A3. Get a pairing code

**Ask** the person to:

1. Open `https://lanely.cloud/signin` and sign in, or make an account (a passkey, GitHub or Google).
2. Go to **Machines > Add a machine** and give you the code it shows (`ABCD-EFGH`).

The code works once and for 10 minutes. If it has expired, ask for a new one.

### A4. Join

```
lanely join https://lanely.cloud ABCD-EFGH --name <a short name for this computer> --projects <the projects folder>
```

It pairs, then keeps running; that running program is the runner. Run it in the background or in
its own terminal, not in a way that blocks you. The name may use letters, numbers, `-` and `_`.
Without `--name` it uses the computer's name; without `--projects` it looks for `~/Development`,
`~/dev`, `~/code`, `~/projects`, `~/src` or `~/repos`.

Check it worked: the output says `connected to the hub`, and the machine shows as online under
Machines on the board.

### A5. Keep it running after a restart

The command to start it again is `lanely runner` (no code needed; the pairing is saved).

- Windows: create a scheduled task that runs `lanely.exe runner` at sign-in.
- Linux: a systemd user service with `ExecStart=%h/.local/bin/lanely runner` and `Restart=always`,
  then `systemctl --user enable --now lanely` and `loginctl enable-linger $USER`.
- macOS: a LaunchAgent in `~/Library/LaunchAgents` that runs `lanely runner` with `KeepAlive`.

**Ask** before creating any of these: say what it does and that it starts with the computer.

### A6. Connect the person's AI app (optional)

The address for AI apps is `https://lanely.cloud/mcp`. In Claude, ChatGPT, Cursor or another app that speaks MCP,
the person adds it as a connector (custom MCP server). The app opens a Lanely page:

- In a browser that is signed in to the hub, it asks **Allow / Deny**.
- Otherwise it shows a code. The person types that code under **Settings > AI apps** on their board.
  They should only type a code from a page they opened themselves.

### A7. Try it

On the board: **New task**, pick a project and write something small ("add a line to the README").
The task appears under In progress, then Ready for review, where the person reads the diff and
accepts it. Risky steps wait for their OK on the board or their phone.

Safety limits on this computer are in `runner.toml` next to the pairing (`max_usd_per_turn`,
`max_usd_per_day`) and `policy.toml`. By default agents can't pay for things, use cloud CLIs that
bill, run `git push`, read secrets or open a browser, and nobody can approve those remotely.

---

## Path B: host your own hub

### B1. On one computer (simplest)

Get the `lanely` program for the computer (from a Lanely hub's Machines page, or build it from
source with `cargo build --release -p lanely`), then:

```
lanely up
```

It asks three things: who can open the board (only this PC, the home network, or online), the
projects folder, and a name for this computer. Then it starts the hub and this computer's runner
together. Without questions:

```
lanely up --yes --reach local --projects <folder> --name <name>
```

`--reach` is `local` (this PC only, no sign-in), `network` (devices on the same Wi-Fi sign in with a
QR code) or `online` (an https address through Tailscale Funnel or a Cloudflare quick tunnel; needed
for phone notifications and for Claude.ai or ChatGPT). With their own domain:
`lanely up --reach online --public-url https://lanely.example.com`.

Other computers then join with Path A, using this hub's address.

### B2. On a server, in a container

For a hub that stays up while the PCs sleep, or one that several people share. The repository has a
`Dockerfile`:

```
docker build -t lanely-hub .
docker run -d --name lanely --restart unless-stopped -p 7420:7420 -v lanely-data:/data \
  -e LANELY_PUBLIC_URL=https://lanely.example.com lanely-hub
```

- `/data` must be a persistent volume: it holds the database.
- Put HTTPS in front (Cloudflare, Caddy, a load balancer) and pass everything through, including
  WebSockets on `/runner/ws`. Don't put a login wall such as Cloudflare Access in front; the hub
  signs people in itself.
- It starts with several accounts and sign-up by invitation. Make the first account and its sign-in
  link with `docker exec lanely lanely hub account create "<name>"`.
- Settings are environment variables: `LANELY_SIGNUP=open` lets anyone make an account,
  `LANELY_GITHUB_ID` + `LANELY_GITHUB_SECRET` and `LANELY_GOOGLE_ID` + `LANELY_GOOGLE_SECRET` turn on
  those sign-in buttons, `LANELY_OPERATOR` names who runs the hub on its privacy page.

A hosted hub runs no agents. Each person adds their own computers with Path A.

---

## If something goes wrong

- `pairing code is wrong or expired`: codes work once, for 10 minutes. Ask for a new one. After 10
  wrong codes the hub refuses that address for 10 minutes.
- The machine shows offline: the runner isn't running, or the computer can't reach `https://lanely.cloud`. Start
  `lanely runner` and read what it prints.
- A project is missing on the board: it must be a folder directly inside the projects folder.
- The agent doesn't start: run `lanely runner facts` to see which agents and versions the runner found.
- To remove a computer: Machines on the board, then Remove. Its key stops working at once.
