Start
Getting Started
Install
brew tap gabrielkoerich/homebrew-tap
brew install orchOn Linux, install the prebuilt binary with cargo-binstall, or build from source with cargo:
cargo binstall orch-cli # prebuilt x86_64 binary
cargo install orch-cli # from source, needs libssl-dev and pkg-config
orch service install # systemd user unit for `orch serve`orch service start|stop|restart|status drives it through systemctl --user. A user service stops at logout unless lingering is on (loginctl enable-linger $USER). The unit appends stdout to ~/.orch/state/orch.log and stderr to ~/.orch/state/orch.error.log, so orch log reads them. A unit written by an older orch logs to journald only, rewrite it with orch service install --force.
The Homebrew formula targets macOS on Apple silicon and installs gh and tmux. On Linux, install gh and tmux yourself.
Agent CLIs
Install at least one agent CLI:
brew install --cask claude-code # Claude (if available)
brew install --cask codex # Codex (if available)
brew install opencode # OpenCodeThe grok CLI must be on PATH. Orch discovers it by the binary name grok.
Quick Start
Log in to gh and one agent CLI, then:
orch init
orch plan PLAN.mdorch init finds the agent CLIs on PATH and whether each is logged in, and checks gh auth. It asks for one repository, writes a config that lists only non-default values, and starts the service.
--repo OWNER/REPO skips the question. From a git checkout, origin is the default.
orch task add always targets the current project (resolved from CWD). To create tasks for another project, cd into it first. Bare clones live at ~/.orch/projects/<owner>/<repo>.git. Agents always work in worktrees — never in the main clone. Worktrees are under ~/.orch/worktrees/<project>/<branch>/.
GitHub Authentication
The simplest setup is gh auth login. orch picks up the token it stored, with no other config.
Tokens are resolved in this order (first match wins):
GH_TOKENenvironment variableGITHUB_TOKENenvironment variablegh.auth.tokenin~/.orch/config.ymlgh auth tokenCLI
Running as a service
The background service (launchd on macOS, a systemd user unit on Linux) does not inherit your shell's environment, so GH_TOKEN set in a shell profile does not reach it. It still runs as your user, so the last step above, gh auth token, reads the login gh auth login stored. With gh auth login done, the service needs nothing else.
To give the service a different token, set gh.auth.token in ~/.orch/config.yml. It takes the token as written, ${NAME} for an environment variable, or passbox:<name> for a passbox entry. A plain token sits in the file in clear text, so prefer a reference. A passbox value is read once per process. A reference that fails to resolve is an error, orch does not fall back to gh auth token.
Do not put the token in the service's plist. brew services writes ~/Library/LaunchAgents/sh.brew.orch.plist again on every restart and upgrade, so an edit there does not last.
Where the token goes
orch writes no token into the runner scripts or other files under ~/.orch/state/. It passes GH_TOKEN to an agent's tmux session as tmux new-session -e GH_TOKEN=..., so the token reaches the agent's environment from its first command. The cost is that the token appears in the arguments of that short-lived tmux command, where another process running as your user could read it with ps. Setting it with tmux set-environment after the session starts avoids that, but needs a second window, and orch's session monitoring watches the first one (#2903 was reverted for that reason). orch also clears GH_TOKEN from the tmux server's global environment.
Files
All runtime state lives in ~/.orch/ (ORCH_HOME):
| File | Description |
|---|---|
config.yml | Global runtime configuration |
orch.db | SQLite task database (internal tasks, metrics, KV store) |
projects/ | Bare clones added via orch project add |
worktrees/ | Agent worktrees (<project>/<branch>/) |
state/ | Runtime state (logs, prompts, per-task artifacts) |
Per-project config lives at {project_path}/.orch.yml (for GitHub repo and job definitions).
Source files:
| File | Description |
|---|---|
prompts/agent_system.md | System prompt (workflow, rules, output format) |
prompts/agent_message.md | Task message (task details, context, memory) |
prompts/route.md | Routing + profile generation prompt |
prompts/review_system.md | Review agent system prompt |
prompts/review_task.md | Review task prompt (diff, commits, criteria) |
How It Works
- Add a task via
orch task add(or via a GitHub issue / scheduled job). - Route the task: the router picks an agent and the agent's model for the task's complexity.
router.modeisround_robinby default. Inllmmode the router also builds a profile. - Run the task — the chosen executor runs in agentic mode inside a tmux session in the task worktree (
PROJECT_DIR) with controlled tool access. - Output — the agent writes results to
~/.orch/state/{repo}/tasks/{id}/attempts/{n}/output.json; task metadata is updated in the SQLite store (~/.orch/orch.db). - Review: a different agent reviews the PR when one is available (the authoring agent reviews otherwise) and posts an
## Automated Reviewcomment, or an App review inreview.mode: app. An approved task waits inapproveduntil CI passes and orch merges the PR. - Delegation — if the agent returns
delegations, child tasks are created and the parent is blocked until children finish. - Error handling: a failed run puts the agent or model in cooldown and routes the task again. After
workflow.max_attemptsattempts (default 5) the task isblocked.