Skip to content

Getting started

A first session with lab, end to end: install, log in, add a credential and a repository, run an interactive agent instance, then let an unattended AFK run resolve an issue. Deployment details (reverse proxy, secrets, backup) live in ops.md; the vocabulary used here (instance, AFK run, claim, change request, …) is defined in CONTEXT.md.

1. Install and start

Pick one:

  • NixOS: import nixosModules.lab from the flake and set services.lab.enable = true; — see the README quickstart and the full option table in ops.md § Deployment. The module provisions everything the container runner needs (rootless podman, subuid ranges, lingering) out of the box.
  • Download a release binary: grab lab-linux-amd64/lab-linux-arm64 (and labctl-linux-… for host-runner sessions) from the latest release, verify against checksums.txt, chmod +x, and put it on PATH (~/.local/bin or /usr/local/bin); git, tmux, ssh, and prlimit still have to be there too. Then run lab. See the README's Download a release binary section.
  • Build from source: build bin/lab and bin/labctl with make lab labctl (or nix build .#lab), make sure git, tmux, ssh, and prlimit are on PATH, and run ./bin/lab. Defaults: listen on :8080, state in ~/.local/state/lab, SQLite. A systemd unit template is in ops.md § Bare metal.

On first start lab applies its database migrations and auto-generates the vault master key (master.key, 0600) in the state directory. Nothing else to prepare.

2. Log in

Open the web UI. With no users in the database, lab shows a first-run setup page — pick the operator username and password (≥ 8 characters) and you're in.

Declarative deployments can skip the wizard and seed the operator account from config instead (--seed-user + a password hash from lab hash-password); see ops.md § Seeding the initial operator user.

The UI is a PWA — add it to your phone's home screen; that's the intended way to drive lab day to day. (More → Install app offers it when your browser can; installed, the app icon shows how many runs are waiting for you where your device supports badges.)

Getting around. Lab opens on Runs, your live runs grouped as Needs you, Working and Idle; tap one to open its chat. On a phone a tab bar runs along the bottom: Runs (with a count when runs need you), New (start a run), Repos, and More (Credentials, Tokens, Settings, Install app, and Log out). The bar steps aside while you are in a chat or the schedule editor, and slides away while the keyboard is open on New run; the chat's back arrow returns to where you came from, or to Runs. On a wide screen the same places are a side rail instead — the grouped runs, + New run, and links to Runs, Repos, Credentials, Tokens and Settings (Ctrl/Cmd+B collapses it) — and the browser tab reads (N) lab while N runs need you. Finished runs are under Runs → Ended; each one's chat stays readable for 30 days after it ends (Settings → General → Transcripts changes how long, 0 keeps none).

3. Log in the agent provider

Lab spawns agent CLIs (Claude Code, Codex) on your behalf, so the provider needs to be authenticated once, machine-level. The UI surfaces each provider's auth status (on Credentials; a dot on the phone's More tab and a banner on the More page warn you when the default agent is logged out) and drives its login flow (for Claude Code: start login → open the OAuth URL → paste the code back). On a container-runner host the login itself also runs containerized — no provider CLI needed on the host at all.

4. Add a credential

Git access is done with credentials you add in the UI, encrypted at rest in lab's vault. Three kinds:

  • SSH key — for ssh:// remotes (with optional passphrase).
  • HTTPS token — for https:// remotes.
  • Forge token — a Forgejo or GitHub API token, used only for tracker REST calls (issues, labels, PRs), never for git push/pull. Only needed for repos whose tracker binding is forge; scopes and API-host format are in ops.md § Forge credentials.

Secrets are never displayed back after saving, and a credential can't be deleted while a repository still references it.

5. Add a repository

On Repositories, tap Add, paste the repo's remote URL (the name fills in from it and stays editable) and pick the git credential for it. Lab clones it asynchronously into a lab-owned bare reference repo and detects the forge from the remote:

  • Tracker binding — with Auto (the default), a repo on a recognized forge (Forgejo, GitHub — with a matching forge-token credential) binds to that forge's issues and PRs, and any other repo gets lab's built-in tracker: issues, labels, comments, and lab-internal change requests instead of PRs. Pick Forge or Built-in to choose yourself. Either way, agents see the exact same surface.
  • Runner — sessions run on the host (provider CLI directly on the host — unsandboxed) or in a container (rootless podman; your chosen dev image with lab's agent tools injected). A new repo inherits the global runner default, set in Settings → Runner (host out of the box): change the default there to move every inheriting repo, or pin one repo in its own settings → Runner. Pick the dev image per repo, or rely on the global default dev image in the same Settings section (left blank, it uses the deployed image); ghcr.io/cloonar/dev-image:full is a ready-made one with language toolchains, a browser and databases (ops.md § The full dev image). A repo whose development setup is a container stack (ddev, docker compose) turns on Nested containers in the same section, off by default (ops.md § Nested containers). Details: ops.md § Container runner.
  • Agent — a new repo inherits the global default agent (provider), like every other default it does not set itself; pick another one later in the repo's Settings tab → Agents.
  • Triage labels — lab seeds the five canonical triage labels (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix) on the repo's tracker; ready-for-agent is the one the AFK engine watches.

After Add, lab opens the new repo's home. Its first block, Readiness, shows the clone's progress and then answers whether a run can start in this repo right now: one line, Ready to run, when every check passes; otherwise each problem in one sentence with the one action that fixes it — retry the clone, or jump straight to the settings field at fault. The checks are the clone, the git credential, the tracker, the agent login, the dev image (container runner only) and any read-only imports. They are built from what lab already saw while working — the last fetch, the last tracker read, the last login check — and never call the forge when you open the page, so a check lab has no evidence for yet (right after a restart, say) is left out rather than shown as passing. ops.md § Repository readiness lists what each check looks at.

Where things live. Repositories lists every repo with its live runs (and how many wait for you), claimable issues, AFK state and Autoland, latest run first; type in the filter to narrow it by name or remote. Above the list, Needs you collects what needs your hand: a failed clone (Retry), an AFK loop paused after three failures (Reset), a failing readiness check (Fix). Tap a repo for its home, whose tabs are Overview (Readiness, the live runs with Stop all, the AFK card with Run one, Auto and Reset, and the repo's parked work), Issues, CRs (built-in-tracker repos only) and Settings.

Settings is one page. Its sections are grouped by how often you touch them — Runs (Agents, Runner), Automation (Autoland, Schedules), Access (Secrets, Imports), Setup (General, Integrations, Branches), then Danger zone — and a row of section chips (an outline on a wide screen) jumps between them. Change fields in as many sections as you like: a save bar counts the changes and names their sections, Save sends them all at once, and Discard throws them away with a few seconds to Undo. A problem shows under its field, and Save takes you to it. Every field that can inherit says so at its label: inherited, with the value it resolves to as the first pick (Inherited · …) or as the placeholder, or set here, with a Default: line naming what it would otherwise inherit and Reset to inherit again. Fields that do not apply give way to a note saying why, and keep their values: the dev image, container limits and Nested containers on a host-runner repo (Show anyway brings them back, to stage a value before switching), the forge credential on a built-in-tracker repo, Autoland's switch there too (with Change in Integrations to switch the binding), and Autoland's options while it is off. Schedules, Secrets and Imports are marked applies immediately: their rows act at once and never wait for the save bar. Leaving the repo with unsaved changes asks in the page: Keep editing, Discard, or Save and leave.

The global Settings (More on a phone, the rail on a wide screen) work the same way, on one page of their own. Its sections are grouped Runs (Agents, Runner), Setup (General) and This device (Notifications), with the same chips or outline, and /settings/runner and the other section URLs open the page scrolled to that section. The same save bar counts changes across sections, Save sends them in one go, and a problem (a capacity field that is not a whole number, say) shows under its field, whether the browser or the server found it. In Agents, the AFK and lander overrides say inherited with Inherited · … (the value they take from the defaults above them, following your edit as you type) or set here with Reset. Runner always shows the dev image, container limits, the Nested containers default and the nested image cache, because repos pinned to a container read them even while the default is host. Switching the runner default to host opens a dialog that says how many repos inherit it before anything is saved. Notifications is marked applies immediately: enabling this device, sending a test and removing a device act at once. Leaving with unsaved changes asks in the page, like the repo's. General ends with the read-only Credential gateway and SSH bastion status. Credentials and Tokens stay their own pages.

Deleting a repository lives at the end of Settings, in Danger zone. The dialog lists what goes with the repo — live runs it stops, a clone in progress, parked branches (their worktree folders stay on disk), Schedules and secrets — says the remote is not touched, and enables Delete repository once you type the repo's name. A repo that other repos import cannot be deleted: the dialog names them and links to the first one's Imports.

6. Give the repo secrets (optional)

Skip this on a first pass — nothing else depends on it. When an agent needs API keys (a deploy token, a third-party service), the repo's Settings tab → Secrets offers two ways in, and neither ever displays a value back:

  • Credential gateway — with the OneCLI sidecar wired up, this card lists every secret and connection in your OneCLI pool as per-repo toggles. Grant one and the repo's runs get it at the network layer: the run's outbound HTTPS goes through the gateway, which injects the real credential on the way out — the agent just calls the service's API, and its environment never holds the value. Creating and rotating values happens in OneCLI's own dashboard; lab's card only picks which repo may use what.
  • Secrets — write-only per-repo values stored in lab's vault, for when you're not running the gateway. In a session the agent runs labctl secret exec NAME -- <cmd> to execute one command with the value injected as $NAME (output redacted), and labctl secret scan checks an outgoing diff for leaked values.

The same page's SSH targets card is the SSH counterpart: with the Warpgate SSH bastion wired up, it lists the SSH hosts defined in Warpgate, and assigning one lets the repo's runs reach it as plain ssh <name> without ever holding its key or password. Without the bastion the card just says it's off.

7. Start a manual instance

Open New run (the New tab on a phone, + New run in the side rail on a wide screen). Pick the repository from the pills: your recently used repos, the last one preselected, each with a readiness dot (green when it can run, red when a check fails); All N opens a searchable picker of every repo. On a phone the pills sit at the bottom, right above the box, and the page header names the repo you picked; while you type, the box and the pills stay right above the keyboard and the Issues card scrolls in the space left. On a wide screen they sit above the box at the top of the page. Describe the task in the box and send (Enter with a mouse or trackpad, Cmd/Ctrl+Enter everywhere; an empty box starts a plain session). Lab starts an instance (an interactive agent session in its own fresh git worktree on its own branch, forked from the repo's default branch) and opens its chat.

The chips in the box's bottom bar apply to this run only. Model and Effort open their picker on the first tap, with the inherited default marked default (defaults are configurable globally and per repo; recommendations in model-selection.md); a chip you changed is outlined. ⋯ (More options) holds the agent (only with two or more providers set up), the remote-control switch, an optional label, and a line naming the Runner the run will use, linked to the repo's Runner settings. The page keeps what you have typed and picked until the run starts, so leaving and coming back (or a reload) does not lose it; only a successful start clears it.

To start a run about an issue, use the Issues card (above the docked box on a phone, below the box on a wide screen): the repo's newest open issues with their triage label, and All N open issues for a list you can search by number or title and filter by label. Tap an issue and choose Triage (runs /triage on it), Implement (a run with the issue as its brief) or Discuss (a chat with the issue as context); the one that fits its label is marked Suggested. An issue with an open PR shows a PR #61 chip, and its sheet adds Land (runs /land-pr 61: the agent validates the PR, resolves conflicts and merges once you confirm in the chat), marked Suggested ahead of the others. The Land row names the PR's branch and warns you when landing by hand could collide: Autoland is on for this repo, or A lander run is live on this PR; it stays tappable either way. The choice attaches to the box as a chip (Triage #47 · …), which you can remove; add a note if you like, then send. The run's first message is that instruction, and its label defaults to the action and issue number (triage-47, land-56) unless you type one. Implement starts a manual run, not an AFK claim.

What stops a run shows as a banner right above the box, with its fix: a clone in progress, a failed clone (Retry), or the agent logged out (Reconnect) disable the box until it is resolved; a failing tracker check (Fix) leaves it enabled, since a manual run can still start. A repo whose Runner is the host also shows "Runs on the host, unsandboxed, with full host access."

Drive the session from lab's chat: the rendered conversation with the agent — reply, answer questions and permission dialogs, interrupt, use slash commands (the / button beside the box opens the list). Text you have typed but not sent stays in the box, kept per run in your browser, so you can leave to answer another run and come back to it; sending it, emptying the box or the run ending clears it. A run of tool calls collapses to a summary by kind, like "Edited 4 files, ran 3 commands, read 5 files". The header shows the model and a context meter; tap the meter for Run details — model, effort, tokens used, the run's branch, and how far it is behind the base, with a Pull base button when it is. While the run is live, a status line above the composer reads Working (with the running tool call and a one-tap Interrupt), Waiting for you (with the agent's own reason when it gives one, like Waiting for you · permission prompt; the Runs page dot's tooltip shows it too), or Idle. A run that ended its turn but is still waiting on background agents reads Working until they finish, and sends no notification before then. The ••• menu keeps Interrupt within reach too. When the agent asks a question, it is answered in a panel docked above the composer: pick an option or type your own answer in the box, then press Answer (a multi-question dialog steps through one question at a time and ends on a review). Chat about this is one tap when you would rather talk about a question first: it sends no message, and the agent asks what you want to know. On a dialog with several questions it applies to the question on screen, and the answers you gave to the earlier ones are entered first. For providers with a web surface (Claude Code), lab also captures a deep link into the provider's own app as an escape hatch.

Inside the session, the agent has labctl on PATH with a run token scoped to this one repo — it can read and file issues, apply labels, and open a PR/CR against the repo's tracker, and nothing else.

When previews are on (ops.md § Previews), the agent can also show you what it is serving: labctl expose web 5173 & in the run prints a URL like https://web.lab.internal, and the chat header shows a Preview chip that opens it in a new tab. Run details lists every preview with its URL and whether it is live. The first time, trust lab's preview CA on your device (Settings → Previews has the download and the steps) so the browser stops warning.

When you Stop an instance, the guarded teardown rule applies: a clean, merged worktree is removed; anything dirty or unmerged is kept and listed under Parked work on the repo's Overview, where discarding is an explicit per-entry human action that asks you to confirm in place. Lab never destroys uncommitted work on its own.

8. Run an issue AFK

The unattended loop:

  1. Write an issue on the repo's tracker that fully specifies one self-contained change — an AFK run gets no follow-up questions, so the issue is the whole brief. Open an issue from the repo's Issues tab: its body and comments render as markdown (headings, lists, code blocks with a copy button, tables that scroll sideways, task lists as read-only checkboxes), and #N links to issue N — inside lab on a built-in-tracker repo, on the forge in a new tab on a forge-bound one (plain text if lab can't work out the forge URL). Copy markdown under the body copies the raw text. The Edit form and the comment box have Write and Preview tabs, so you can check the rendering before you save or post. A comment headed Agent Brief carries an Agent brief tag.
  2. Label it ready-for-agent.
  3. Start an AFK run with Run one on the repo's Overview or on the AFK line of the Issues card on New run (or switch Auto on in either place, and the scheduler starts runs by itself). The engine claims the lowest ready issue by creating the run's branch, spawns a session with a seed prompt pointing at the issue, and walks away.
  4. The done-signal is a PR (or change request on built-in-tracker repos) whose head branch is the run's branch, with Closes #N in the body. Session death without a PR counts as a failure; each run also has a budget clock (default 2 h). Three consecutive failures pause AFK on that repo until you press Reset — on the repo's Overview, on the Issues card's AFK line on New run, or in the Needs you block on Repositories.
  5. Review and merge — a forge PR on your forge, or a change request right in lab's UI with a live diff and one-tap merge; merging a CR closes the linked issue. A merge made through lab (the CR merge, or labctl pr merge when an agent lands a PR) also deletes the head branch on origin; the setting merge_delete_head turns that off.

Everything is observable from the phone throughout: the Runs page shows each instance's live conversational state (the side rail on a wide screen shows the same list), Runs → Ended records every outcome, the Runs tab and the browser tab title count the runs waiting for you, and Web Push can notify you when a session needs input.

9. Schedule recurring runs (optional)

A Schedule starts a scheduled run on a cadence — say, a weekly look at dependency updates that files issues for the AFK loop to pick up. In the repo's Settings tab → Schedules, tap New schedule and fill in a name; a cadence (daily, weekly or monthly at a time, or a raw cron expression), with a preview of the next runs; a prompt (the Examples pick fills in a starter); and optionally flows — the autolander flow files ready-for-agent issues for the AFK loop, the human-triage flow files needs-triage ones for you. Then Save schedule. The editor has its own URL (full screen on a phone, a side panel on a wide screen; Back closes it), and closing it with unsaved edits asks first. Each row in the list shows the cadence in words with its flows, then the next run and how the last one went, and carries a switch that turns the cadence on or off at once; Delete schedule lives at the end of the editor and asks in place.

A scheduled run is set up like an AFK run but has no issue: it works until its budget clock runs out (30 minutes unless the Schedule sets its own), and that is its normal end. A run that dies before then counts against its Schedule only; three in a row pause the Schedule — its row shows paused — until you press Re-enable. A firing that comes due while the Schedule's previous run is still live is skipped, and slots missed while lab was down are not caught up.

Run now, in the Schedule's editor, starts one scheduled run at once from the saved Schedule — the way to try a prompt before you switch the cadence on, since it works on a switched-off Schedule too. It is disabled while the editor holds unsaved edits ("Run now uses the saved version."), and the confirmation after Save schedule offers it too. When a run cannot start, Run now shows the reason next to the button and nothing starts later in its place: the Schedule is paused, its previous run is still live, the repo is at its instance cap, or it already started a run this minute. Run now does not move the cadence, with one interaction to know about: a cadence slot that comes due while a Run now run is still live is skipped, like any overlap.

10. Where to go next

  • ops.md — reverse proxy / SSO, secrets management, backup & restore, metrics, the container runner, incogni mode.
  • model-selection.md — which model/effort to use at which stage of the workflow.
  • ../CONTEXT.md — the full domain glossary; useful as a map of what every screen and term means.
  • adr/ — why the system is shaped the way it is.