Skip to main content
The same CLI surface that’s pleasant to type at a prompt is also the primary way external automation drives Breadbox. This page covers three production patterns: same-host agents, remote agents over HTTP, and scheduled jobs / CI. If you’re new to the build flavors, start with Installation.

Pattern 1 — same-host agent

An AI agent or script running on the same machine as breadbox serve. The CLI talks to http://localhost:8080 over loopback; no exposed network surface.
1

Mint a scoped key

From the dashboard or via the CLI, mint a key with the agent actor type so the audit trail shows what the agent did:
The plaintext key is returned once — store it in the agent’s secret manager.
2

Wire the key into the agent

Pass the key as BREADBOX_TOKEN and BREADBOX_HOST on the agent’s environment:
Or save it to the CLI’s host file:
3

Drive Breadbox

Every CLI command “just works”:

Pattern 2 — remote agent (lite CLI)

An agent running on a different machine — a VPS, a phone, a corporate workstation, a cloud function. Use the lite build (breadbox-cli) so there’s no server code on the agent host at all.
1

Build or download the lite binary

Ship breadbox-cli to the agent host (single static binary, no dependencies).
2

Mint a key on the server

From an authenticated session on the Breadbox host:
Or use the device-code flow (no operator copy-paste of secrets):
3

Drive Breadbox from anywhere

Same commands as the full binary — exit codes, output formats, and flags are identical.

Pattern 3 — scheduled jobs and CI

The CLI shines in cron, systemd timers, GitHub Actions, and any other “fire a command on a schedule” surface.

Cron — nightly sync

--quiet suppresses table output. The exit code (0 success, 4 server down, etc.) is still set, so logger only fires on failure.

Systemd — breadbox doctor health check

A non-zero exit makes the unit “failed”, which Prometheus’ node_exporter can scrape.

GitHub Actions — export transactions to a private repo

Pin the secrets in repository settings; never commit them.

Authentication recipes

Add each host once; switch with --host:

Error handling

Branch on exit codes — they’re the cheapest way to distinguish “retry” from “give up”: See Output and exit codes for the full table. breadbox connections link --wait is the canonical way an agent helps a user add a new bank:
The CLI mints a hosted-link session, prints the URL (and emits it to JSON for the agent to surface to the user), then polls every two seconds. Once the user finishes the OAuth flow in the browser, the CLI prints the resulting connection IDs and exits 0. If the agent only needs to mint the URL — letting a separate process handle the polling — omit --wait and call breadbox connections link get <session-id> periodically.

Next steps

Agent automation

Scheduled agents, runs, and the agent SDK smoke test.

Multi-agent reviewer guide

A worked example chaining multiple agents over the same CLI surface.
Last modified on June 25, 2026