OpenCode
OpenCode terminal agent. Uses the OpenCode session API for resume and discovery.
Slot:
agent · Name: opencode · Binary: opencodeOpenCode is an open-source terminal coding agent. It has a structured session API, which means AO can discover, resume, and track its sessions reliably.
macOSSupported
LinuxSupported
WindowsSupported
Install
npm install -g opencode-aiUse
agent: opencodeNo plugin-level config.
How it works
- Launch:
opencodestarts in the worktree withAO:<sessionId>as the session title — this is how AO finds it back later. - Session discovery:
opencode session list --format jsonreturns the list; AO matches on the title prefix. - Resume:
opencode --session <id>rehydrates the state. - Activity tracking: Primary signal is the OpenCode session's
updatedAt. AO falls back to its own activity JSONL if the session API doesn't answer. - PR + git tracking: PATH wrappers for
gh/git.
Environment variables
| Variable | Set by AO | Purpose |
|---|---|---|
AO_SESSION_ID | ✓ | AO session id |
AO_ISSUE_ID | ✓ | Issue identifier |
PATH | ✓ | Prepends ~/.ao/bin |
GH_PATH | ✓ | Absolute path to real gh |