{% extends "docs/base.html" %} {% block docs_content %}

Work documentation

How to run and operate the pearing-work agent orchestrator.

API docs CLI docs Skills docs Work docs

Overview

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.

Startup and environment

pearing-work reads a pearing-work.toml file and uses the existing pearing API environment:

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.

Config 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"]

Dispatch model

TUI

Run pearing-work --tui to get a terminal dashboard over the orchestrator state. The screen shows:

Key controls:

Operational patterns

{% endblock %}