{% extends "docs/base.html" %} {% block docs_content %}
How to run and operate the pearing-work agent orchestrator.
pearing-work is an event-driven orchestrator for external coding agents.
It runs one shared pearing-cli tail-events subprocess, filters matching events for each configured agent,
and dispatches event batches to agent commands through stdin prompts.
Each agent runs at most one invocation at a time. Events that arrive while an agent is already working are queued and delivered in the next batch when that agent becomes idle again.
pearing-work reads a pearing-work.toml file and uses the existing pearing API environment:
PEARING_API_URL points at the pearing API base URL.PEARING_API_TOKEN provides the bearer token for the shared pearing-cli subprocess.
Those variables are passed through to pearing-cli tail-events, but not to agent subprocesses.
export PEARING_API_URL="https://example.com/api"
export PEARING_API_TOKEN="your-token"
pearing-work -c pearing-work.toml
pearing-work -c /etc/pearing-work/pearing-work.toml --retry 5m --limit 1
pearing-work init
pearing-work init --config /path/pearing-work.toml
pearing-work --tui
The init subcommand writes a fully commented example config and refuses to overwrite an existing file.
The config file has one global [pearing-work] section and one or more [agents.NAME] sections.
Relative paths are resolved from the config file directory.
[pearing-work]
agent_prompt_file = "prompt.j2"
retry = "5m"
limit = 1
[agents.codex]
cmd = ["codex"]
username = "codex"
workdir = "."
logdir = "logs/codex"
event_scopes = ["team:pearing", "repo:teams/pearing/pearing", "user:codex"]
event_kinds = ["user-mention", "pull-review-created", "pull-review-updated", "pull-review-deleted"]
pearing-cli tail-events.--limit or [pearing-work].limit can cap how many agents are in working state at once.--retry or [pearing-work].retry sets the bounded retry window for tail-events restarts.
Run pearing-work --tui to get a terminal dashboard over the orchestrator state.
The screen shows:
Key controls:
q or Ctrl-C: quitTab: cycle panesLeft/Right: change selected agentUp/Down: scroll the focused paneEnter: toggle expanded selected-agent view/: start event filteringEsc: clear filter or exit expanded viewk: send SIGTERM to the selected working agent on Unixr: trigger config reload via SIGHUP on Unixpearing-work under an external supervisor such as systemd, supervisord, or a container restart policy.SIGHUP to reload the same config file without interrupting already-running agent work.pearing-cli commands that agents and operators call.