# Bento ## Authentication The bento daemon uses bearer token authentication. Tokens are issued on the server where the daemon runs, then configured on each client machine where your coding agent (Claude Code, Codex, pi) connects from. ### Server side On the machine running the daemon, issue a token: ```bash bento token issue --email you@example.com ``` This outputs a `bento_pat_...` token. Save it — it's only shown once. You can list and revoke tokens: ```bash bento token list bento token revoke ``` ### Client side Each coding agent needs the token configured so it can authenticate with the daemon. The daemon URL will typically be a Tailscale Funnel URL (e.g. `https://.tail.ts.net/mcp`) since the daemon runs on a remote server. For local development where the daemon runs on the same machine, use `http://127.0.0.1:7890/mcp`. #### Claude Code Run from your project directory: ```bash claude mcp add --transport http bento http://127.0.0.1:7890/mcp \ --header "Authorization: Bearer " ``` This writes to `~/.claude.json` under the current project (local scope — the token stays out of any committed file). Pass `--scope user` to share the entry across all projects on this machine. Restart Claude Code (or run `/mcp` and reconnect) to pick up the change. ```json "mcpServers": { "bento": { "type": "streamable-http", "url": "http://127.0.0.1:7890/mcp", "headers": { "Authorization": "Bearer " } } } ``` #### Codex Add to `~/.codex/config.toml`: ```toml [mcp_servers.bento] url = "http://127.0.0.1:7890/mcp" http_headers = { Authorization = "Bearer " } ``` #### pi The `remote-workloads` extension reads `BENTO_TOKEN` from the environment. Add to your project `.envrc`: ```bash export BENTO_DAEMON_URL="http://127.0.0.1:7890" export BENTO_TOKEN="" ``` Then restart pi to pick up the new environment. ## CLI Reference The `bento` CLI manages the daemon lifecycle and provides operational visibility. ### Lifecycle #### `bento daemon start` Start the daemon. Uses the installed user service (launchd on macOS, systemd on Linux) when present; otherwise spawns a detached Bun process. ```bash bento daemon start ``` #### `bento daemon stop` Stop the daemon. Sends SIGTERM and waits up to 10s before escalating to SIGKILL. ```bash bento daemon stop ``` #### `bento daemon restart` Stop then start the daemon. On macOS with a launchd-installed service, the service is reinstalled so the plist is regenerated — `launchctl kickstart` alone would miss edits to env vars, working directory, or `PATH`. ```bash bento daemon restart ``` #### `bento daemon install` Install the daemon as a user service: a launchd agent on macOS, a systemd user unit (`~/.config/systemd/user/bento.service`) on Linux. ```bash bento daemon install ``` #### `bento daemon uninstall` Stop, disable, and remove the user service. ```bash bento daemon uninstall ``` ### Observability #### `bento daemon status` Show daemon process status and probe the local and public-tunnel endpoints for reachability. ```bash bento daemon status ``` ``` daemon: pid=12345 local : reachable (4ms) — bento uptime=3600s tunnel : not configured (no `tunnel:` block in bento.yaml) ``` When a tunnel is configured, the `tunnel` line reports the public URL and its latency — see [Public Access](/public-access). #### `bento daemon logs [target]` Show daemon logs, or logs for a specific agent. ```bash bento daemon logs # daemon logs bento daemon logs reviewer # agent-specific logs bento daemon logs -f # follow mode bento daemon logs -n 100 # last 100 lines ``` | Flag | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------- | | `-f`, `--follow` | Tail logs in real-time | | `-n ` | Number of lines to show (default: 50) | | `--agent` | Tail the most recent agent run's stdout; pass a run ID as the positional `target` to select a specific run | | `--render flat` | Collapse stream-json events to readable per-turn text | | `--render raw` | Raw NDJSON (default) | #### `bento trace ` Print a full lifecycle trace for a trigger — trigger → workload → invocations → agents. ```bash bento trace ``` | Flag | Description | | --------------- | ----------------------------------------------- | | `--json` | Output as JSON (for programmatic consumption) | | `--no-messages` | Skip extracting agent messages from stdout logs | #### `bento queue status` Show the Graphile Worker queue state and job counts. ```bash bento queue status ``` ``` state: active waiting: 2 active: 1 failed: 0 completed: 47 delayed: 0 ``` #### `bento queue resume` Resume processing after a circuit breaker trip. ```bash bento queue resume bento queue resume --token ``` ### Diagnostics #### `bento doctor` Validate infrastructure: config, database, runtimes, sandbox, tunnel, daytona, auth, repos, orchestrator, worktrees, workloads, and queue. Checks are defined in `bento.doctor.yaml`. ```bash bento doctor ``` | Flag | Description | | -------- | ------------------------------------------------------------------------ | | `--fix` | Auto-remediate issues (requires per-check opt-in in `bento.doctor.yaml`) | | `--json` | Output as JSON | #### `bento probe [target]` Run a single sandbox probe through the daemon. ```bash bento probe runtime claude bento probe env ANTHROPIC_API_KEY bento probe gh-auth bento probe ping claude/claude-sonnet-4-6 ``` | Scope | Target | Description | | --------- | ------------------- | ------------------------------------------------------- | | `runtime` | `` | Check a runtime is installed and callable | | `env` | `` | Check an environment variable is visible in the sandbox | | `gh-auth` | — | Check GitHub authentication | | `ping` | `/` | Round-trip a minimal request to a model | #### `bento runtimes` Ping each unique `(runtime, model)` combination referenced by `agents/*/SOUL.md` and `skills/*/SOUL.md`. ```bash bento runtimes ``` | Flag | Description | | ---------------- | ---------------------------------- | | `--timeout ` | Per-combo timeout (default: 60000) | ### Triggers & auth #### `bento trigger inspect ` Show what the runtime would receive for a stored trigger. ```bash bento trigger inspect ``` | Flag | Description | | ----------------- | ------------------------------------------------------------------ | | `--event` | Print the original webhook payload (JSON) | | `--prompt` | Print the rendered user prompt | | `--system-prompt` | Print the assembled system prompt (SOUL.md + skill body + augment) | | `--args` | Print the full argv as JSON | | `--size` | Print prompt + argv size breakdown with token estimates | | `--json` | Print the full inspection result as JSON | | `--pipeline ` | Pick a single pipeline when multiple match | #### `bento replay ` Re-dispatch a stored trigger through the daemon. ```bash bento replay bento replay --payload '{"key":"value"}' ``` | Flag | Description | | ------------------ | -------------------------------------------------- | | `--payload ` | Override the trigger payload | | `--token ` | Management token (or set `BENTO_MANAGEMENT_TOKEN`) | #### `bento trigger schedule ` Fire a scheduled pipeline now, bypassing its cron — the manual equivalent of a cron tick. ```bash bento trigger schedule triage-sweep ``` | Flag | Description | | ----------------- | -------------------------------------------------- | | `--token ` | Management token (or set `BENTO_MANAGEMENT_TOKEN`) | #### `bento token` Manage bearer tokens for authenticated daemon access. ```bash bento token issue --email you@example.com bento token list bento token revoke ``` | Subcommand | Flags | Description | | ------------- | -------------------------------------------------------- | ---------------------------------------------------------------------- | | `issue` | `--email ` (required), `--name