Documentation Index
Fetch the complete documentation index at: https://docs.crewship.ai/llms.txt
Use this file to discover all available pages before exploring further.
opencode-ai (v1.14.33+). Active upstream is github.com/anomalyco/opencode (sst/opencode redirects there).
Install
Auth (BYOK across 75+ providers)
OpenCode reads provider credentials from env vars based on whichprovider/model you pick. Crewship’s apiKeyEnvVarsForAdapter("OPENCODE") accepts:
| Env var | Provider |
|---|---|
ANTHROPIC_API_KEY | Anthropic |
OPENAI_API_KEY | OpenAI |
GOOGLE_API_KEY / GEMINI_API_KEY | |
OPENROUTER_API_KEY | OpenRouter |
XAI_API_KEY | xAI / Grok |
GROQ_API_KEY | Groq |
DEEPSEEK_API_KEY | DeepSeek |
SECRET-type credential and assign to your OpenCode agent.
Models
OpenCode requiresprovider/model namespaced strings (NOT bare IDs). Curated picker entries:
Command shape
--format json (NOT --output-format) emits JSONL events.
MCP
Configured at/output/<slug>/opencode.json:
- Top key is
mcp(NOTmcpServers) type: local(stdio) orremote(HTTP/SSE)commandis an ARRAY (binary + args together)- env field is
environment(NOTenv) - Env-var syntax is
{env:VAR}(NOT${VAR}) — Crewship translates standard${VAR}form on write
Memory
AGENTS.md is OpenCode’s auto-discovered system instructions file. Crewship writes it as part of the canonical memory set. For turn-1 parity (OpenCode discovers AGENTS.md on the second invocation, not the first), the orchestrator also prepends the preamble inline with [SYSTEM]/[USER] delimiters on the first turn — turn-2+ uses the file.
Output stream
Flat JSONL perpackages/opencode/src/cli/cmd/run.ts:
type IS the part type at top level — NOT a nested message.part.updated envelope. step_finish (snake_case, NOT hyphen).
Troubleshooting
Bare model rejected — useprovider/model form (anthropic/claude-sonnet-4-6 not claude-sonnet-4-6).
MCP server uses literal ${VAR} token — Cursor/Claude ${VAR} syntax incompatible; ensure Crewship’s writer translated to {env:VAR}. Check by cat /output/<slug>/opencode.json.