<!--
Sitemap:
- [Installation](/installation): Install the Bento daemon on macOS or Linux, then write your first pipeline to run a coding agent on a GitHub, Linear, or schedule event.
- [Upgrading](/upgrading): Version-specific steps for upgrading an existing Bento install.
- [Concepts](/concepts)
- [Build your first pipeline](/tutorials/pipeline-args)
- [Target a specific issue or PR from a URL](/tutorials/url-targeting)
- [Keep state across runs](/tutorials/pipeline-state)
- [Fire a pipeline on a schedule or on demand](/tutorials/schedule-and-fire)
- [Deploy a box to Railway](/tutorials/deploy-to-railway)
- [Operate a hosted daemon](/tutorials/operate-a-hosted-daemon)
- [Configuration](/configuration): Configure the Bento daemon with daemon.yaml: service name, port, webhooks, sandboxes, knowledge base, and environment variables.
- [Members](/members)
- [Knowledge base](/knowledge-base/)
- [Method and delivery](/knowledge-base/modes): Choose how Bento retrieves knowledge (BM25, vector, or hybrid) and how it delivers that knowledge to a coding agent.
- [Config](/knowledge-base/config)
- [MCP](/knowledge-base/mcp): Give coding agents your team knowledge over MCP. The Bento daemon serves an ask_knowledge search tool and per-file resources.
- [Pipeline configuration reference](/pipelines/config): Reference for Bento pipeline YAML: triggers, agents, skills, instructions, filters, sandboxes, structured results, and outputs.
- [Filters](/pipelines/filters): Filter GitHub, Linear, and webhook events by repository, label, and other fields so only the right Bento pipelines run.
- [Triggers](/triggers/): Start a Bento pipeline from a GitHub, Linear, webhook, schedule, or manual trigger. Compare the trigger types and when each one fires.
- [GitHub trigger](/triggers/github): Run a coding agent on GitHub pull request, issue, and other webhook events. Configure HMAC verification and event patterns.
- [Linear trigger](/triggers/linear): Run a coding agent on Linear issue and comment events. Configure the Linear webhook, signature verification, and Hookdeck relay.
- [Webhook trigger](/triggers/webhook): Fire a Bento pipeline from any HTTP POST to /webhooks/{name}, with bearer-token authentication declared in daemon.yaml.
- [Schedule trigger](/triggers/schedule)
- [Manual trigger](/triggers/manual): Fire any Bento pipeline on demand with bento trigger fire, and pass typed inputs to a pipeline that runs only on request.
- [Traces](/pipelines/traces)
- [Slack](/integrations/slack)
- [Public access](/public-access): Expose the Bento daemon to GitHub webhooks through a Cloudflare Quick Tunnel or Tailscale Funnel, and compare the two options.
- [Context engineering](/context-engineering): Assemble each coding agent prompt from personas, policies, skills, and pipeline instructions. Learn which file each instruction belongs in.
- [Best practices](/best-practices)
- [Troubleshooting](/troubleshooting)
- [Architecture](/architecture/vision)
- [Workspaces](/workspaces)
- [Authentication](/authentication)
- [Identity](/identity)
- [Security](/security)
- [References](/references)
- [Changelog](/changelog): Bento release history.
- [CLI reference](/cli/)
- [Setup](/cli/setup)
- [Secrets](/cli/secrets)
- [Lifecycle](/cli/lifecycle)
- [Sandbox image](/cli/image)
- [Sandboxes](/cli/sandbox)
- [Observability](/cli/observability)
- [Diagnostics](/cli/diagnostics)
- [Triggers](/cli/triggers)
- [Workbench](/cli/workbench)
- [Auth](/cli/auth)
- [Knowledge](/cli/knowledge)
- [Evals](/cli/evals)
- [Bento docs: run coding agents from version-controlled pipelines](/index): Bento runs coding agents from pipelines you keep in your repository. Declare the trigger, sandbox, skill, and guardrails in YAML.
- [Runtime wrapper](/architecture/runtime-wrapper)
- [Skill evolve](/architecture/skill-evolve)
-->

# Lifecycle

## `bento daemon start`

Start the daemon. The command uses the installed user service, launchd on macOS and systemd on Linux, when one is present. Otherwise it spawns a detached Bun process.

```bash
bento daemon start
```

## Startup readiness

After discovery, the daemon initializes knowledge alongside other startup tasks. It waits for knowledge initialization to finish before it constructs the runtime. Queue workers wait for the HTTP listener and any configured tunnel before they claim jobs.

`GET /health` reports `readiness.state` as `pending`, `ready`, or `failed`. `readiness.blockedOn` names unmet prerequisites. The daemon waits up to five minutes for these prerequisites. A failed prerequisite also sets the health status to `degraded`.

If a prerequisite fails, resolve the reported problem. Then restart the daemon. The queue resume command does not bypass startup readiness checks.

## `bento daemon stop`

Stop the daemon. The command sends SIGTERM and waits up to 35 seconds before it sends SIGKILL.

During shutdown, the daemon rejects new invocation submissions and cancels active invocations. It waits for cleanup and pending status writes within the shutdown deadline. After restart, it attempts one [automatic replay](/cli/triggers#bento-trigger-replay-trigger-id) for each eligible webhook trigger lineage.

```bash
bento daemon stop
```

## `bento daemon restart`

Stop the daemon, then start it. On macOS with a launchd-installed service, the command regenerates the plist before the restart.

```bash
bento daemon restart
```

## Apply configuration changes

The daemon reads configuration at startup. After changes, validate the files before restarting:

```bash
bento config validate && bento daemon restart
```

Validation checks configuration without a running daemon or provider credentials. Startup also checks live dependencies. The daemon does not support hot reload or configuration updates through SIGHUP.

## `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
```

## `bento serve`

Run the daemon in the foreground. This command is internal: the launchd and systemd service units that `bento daemon install` writes invoke it. To start the daemon yourself, use `bento daemon start`.

```bash
bento serve
```
