OpenCode
Automatic
npx -y @french-castle/jev-code@latest setup opencode # ~/.config/opencode/opencode.json
npx -y @french-castle/jev-code@latest setup opencode --project # ./opencode.json
What it does:
| Piece | Location |
|---|---|
| Skill | ~/.agents/skills/jev/ (OpenCode reads it, as do Codex and Pi). With --project: .agents/skills/jev/. |
| Tool | mcp.jev entry in opencode.json. The existing file is backed up as opencode.json.bak-<timestamp> before it is modified. A user-level file that holds the key, and every backup, is readable by you only (mode 0600, on macOS and Linux). With --project, ./opencode.json names the key as {env:TYPESAFE_API_KEY} (or your host's variable) and never holds it; export the key in your shell. |
The registered command pins the version setup installed. Re-running setup (npx -y @french-castle/jev-code@latest setup) replaces the entry with the new pin and reports it as updated; doctor shows the pinned version.
Manual
Add to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"jev": {
"type": "local",
"command": ["npx", "-y", "@french-castle/jev-code@0.5.1", "mcp"],
"enabled": true,
"environment": { "TYPESAFE_API_KEY": "{env:TYPESAFE_API_KEY}" }
}
}
}
OpenCode substitutes {env:TYPESAFE_API_KEY} from its own environment, so a project's opencode.json never has to hold the key. The literal key works too, in the user config only.
Any provider key works in place of TYPESAFE_API_KEY: OPENROUTER_API_KEY routes through OpenRouter and AI_GATEWAY_API_KEY through Vercel AI Gateway (the variable decides the host). OpenAI's Decisions API needs both OPENAI_API_KEY and JEV_CODE_PROVIDER=openai in the environment, and the other companies' decision APIs (Azure, Foundry, Gemini, Perplexity, Cloudflare) likewise need their host named, as Hosts and gateways lists. A local Ollama needs only JEV_CODE_PROVIDER=ollama. A System One gateway of your own takes TYPESAFE_API_KEY plus TYPESAFE_BASE_URL, as the README explains.
Install the skill with npx skills add FrancoisChastel/jev-code --skill jev -a opencode, or copy skills/jev/ into ~/.config/opencode/skills/.
Native custom tool (optional)
If you would rather not spawn an MCP server, integrations/opencode/jev.ts defines the same five tools with OpenCode's tool() helper. Copy it to .opencode/tools/jev.ts (project) or ~/.config/opencode/tools/jev.ts (global), and add the package to the matching package.json (npm install @french-castle/jev-code). The named exports become jev_classify, jev_check, and so on.
Verify
opencode mcp list
jev-code doctor
opencode mcp list should show jev connected. OpenCode prefixes MCP tools with the server name, so inside a session the tools appear as jev_jev_classify, jev_jev_check, and so on.