Skip to content

OpenCode

OpenCode is Shiba’s default coding agent harness. It is open source, highly extensible, and supports multi-provider LLM backends through your Cloudflare AI Gateway.

Attribute Specification
Harness ID opencode (default)
CLI Binary opencode
Pinned Version 1.18.31 (in Dockerfile)
Default Model google/gemini-3.5-flash-lite
Supported Providers Google AI Studio, Anthropic, OpenAI, xAI (Grok), OpenCode Go
Credential Model AI Gateway BYOK (dummy key inside sandbox; real key injected at egress)
Invocation opencode run "<task>" --format json

OpenCode can route tasks across multiple AI providers by prefixing the model with the provider slug:

Terminal window
# Google Gemini
google/gemini-3.5-flash-lite
google/gemini-1.5-pro
# xAI Grok
xai/grok-4
# Anthropic Claude
anthropic/claude-sonnet-4-6
# OpenAI
openai/gpt-4o
Developer Request
└── CodingOrchestrator generates delegate_coding_task({ harness: "opencode" })
└── Human signs off on exact prompt & repository
└── Ephemeral Cloudflare Sandbox boots
├── Writes per-run .opencode.json configuration
├── Executes: opencode run "<task>" --format json
├── Streams newline-delimited JSON events
└── Collects git status and builds unified diff

Add your provider keys (Google, Anthropic, OpenAI, xAI) to your Cloudflare AI Gateway.

In wrangler.jsonc or via environment variables:

Terminal window
pnpm wrangler secret put CODING_MODEL # enter "google/gemini-3.5-flash-lite"

OpenCode is used by default if no harness is explicitly provided:

{
"repoUrl": "https://github.com/acme/web",
"task": "Add dark mode toggle to navigation bar",
"baseBranch": "main",
"harness": "opencode",
"codingModel": "xai/grok-4"
}