opencode
opencode
The opencode worker exposes the OpenCode API as iii functions. One
opencode::run call executes one headless OpenCode turn — the same agent the
user runs in their terminal, with the same tools — in a chosen working
directory, and returns the final result, token usage, and cost. Every JSON
event OpenCode emits (step_start, text, tool_use, step_finish) mirrors
verbatim onto opencode::events; a translated AgentEvent view lands on
agent::events, which the iii console and the acp worker render.
Requires the opencode CLI on the host and an API key for the LLM provider you
use (e.g. ANTHROPIC_API_KEY, or opencode auth). When a turn needs a
capability beyond OpenCode itself, add another iii worker to the bus instead of
bolting anything onto this one.