Daemon lifecycle
bro command reference for daemon lifecycle.
See Init and config for shared conventions and environment variables.
The local router listens on http://127.0.0.1:4356 by default. It serves the supported model protocols and the configured upstream MCP aggregate; ACP agent adapters use their own stdio lifecycle. This section covers the daemon, request history, retained remote operations, and named remote contexts.
bro serve
Load a config, run migrations, and serve HTTP + control socket in the foreground
Usage: bro serve [OPTIONS]
| Flag | Description |
|---|---|
-c, --config <CONFIG> | Path to bitrouter.yaml. When omitted, the binary resolves in this order: ./bitrouter.yaml → $BITROUTER_HOME/bitrouter.yaml → ~/.bitrouter/bitrouter.yaml → zero-config in-memory defaults (bro init is the explicit way to scaffold a file) |
Runs in the foreground — the form you want under a process supervisor or in a container:
bro serve -c ./bitrouter.yamlbro start
Spawn bro serve as a detached background process
Usage: bro start [OPTIONS]
| Flag | Description |
|---|---|
-c, --config <CONFIG> | Path to bitrouter.yaml (passed through to the child) |
--log <LOG> | Path to redirect the daemon's stdout/stderr to. Defaults to bitrouter.log inside the config file's directory (e.g. ~/.bitrouter/bitrouter.log) so it lives alongside the socket and pid file rather than in the launcher's CWD |
Daemonizes: writes a pidfile and detaches. stop/restart target the pidfile; reload hot-loads config changes without dropping in-flight connections.
bro stop
Send a stop command to a running daemon
Usage: bro stop [OPTIONS]
| Flag | Description |
|---|---|
-c, --config <CONFIG> | Path to bitrouter.yaml (used to locate the control socket). Resolves via the standard chain: ./bitrouter.yaml → $BITROUTER_HOME/bitrouter.yaml → ~/.bitrouter/bitrouter.yaml |
--socket <SOCKET> | Explicit control socket path. Overrides the config-derived path |
bro restart
stop then start — config path is passed through
Usage: bro restart [OPTIONS]
| Flag | Description |
|---|---|
-c, --config <CONFIG> | Path to bitrouter.yaml. When omitted, the binary resolves in this order: ./bitrouter.yaml → $BITROUTER_HOME/bitrouter.yaml → ~/.bitrouter/bitrouter.yaml → zero-config in-memory defaults (bro init is the explicit way to scaffold a file) |
--socket <SOCKET> | Explicit control socket path. Overrides the config-derived path |
--log <LOG> | Path to redirect the new daemon's stdout/stderr to. Defaults to bitrouter.log next to the config file |
bro reload
Hot-reload the running daemon's config / routing table
Usage: bro reload [OPTIONS]
| Flag | Description |
|---|---|
-c, --config <CONFIG> | Path to bitrouter.yaml (used to locate the control socket) |
--socket <SOCKET> | Explicit control socket path. Overrides the config-derived path |
bro operations
Inspect a retained remote administration operation
Usage: bro operations <COMMAND>
bro operations show
Show one retained reload operation owned by this credential
Usage: bro operations show --instance <INSTANCE> <REQUEST_ID>
| Argument | Description |
|---|---|
<REQUEST_ID> | Reload request UUID returned by bro reload |
| Flag | Description |
|---|---|
--instance <INSTANCE> | Daemon boot instance UUID returned with the operation |
bro status
Report a running daemon's status (pid, listen address, model count). Prints running: no when no daemon is reachable.
With --requests, reports what the router has actually done instead: settled requests (time, model, the provider that actually served, tokens, cost, latency, status) plus daemon state and a spend rollup scoped to every caller. Read straight from the metering store, so it works with no daemon running. JSON by default like every other command; --human renders the table.
Usage: bro status [OPTIONS]
| Flag | Description |
|---|---|
-c, --config <CONFIG> | Path to bitrouter.yaml (used to locate the control socket) |
--socket <SOCKET> | Explicit control socket path. Overrides the config-derived path |
Prints running: no when no daemon is reachable — safe to poll in scripts.
bro requests
Show recent settled requests and aggregate spend
Usage: bro requests [OPTIONS]
| Flag | Description |
|---|---|
--limit <LIMIT> | Maximum number of recent requests to return [default: 500] |
--since <SINCE> | Inclusive RFC3339 lower bound. Requires --until |
--until <UNTIL> | Exclusive RFC3339 upper bound. Requires --since |
--model <MODEL> | Keep only requests resolved to this model id |
--provider <PROVIDER> | Keep only requests served by this provider id |
-c, --config <CONFIG> | Path to bitrouter.yaml (used to locate the local control socket) |
--socket <SOCKET> | Explicit local control socket path |
bro context
Manage named remote-control targets. Contexts store a token environment variable name, never the token value
Usage: bro context <COMMAND>
bro context add
Add a named remote target
Usage: bro context add --endpoint <ENDPOINT> --token-env <NAME> <NAME>
| Argument | Description |
|---|---|
<NAME> | Context name used by --context |
| Flag | Description |
|---|---|
--endpoint <ENDPOINT> | HTTPS origin or endpoint ending in /control/v1. Plain HTTP is accepted only for loopback/SSH-forwarded endpoints |
--token-env <NAME> | Environment variable containing this context's bearer token |
bro context list
List configured remote targets
Usage: bro context list
bro context show
Show one remote target without reading its token
Usage: bro context show <NAME>
| Argument | Description |
|---|---|
<NAME> |
bro context remove
Remove one remote target
Usage: bro context remove <NAME>
| Argument | Description |
|---|---|
<NAME> |
How is this guide?