Add OpenCode Provider (NanoClaw)
Wires OpenCode (OpenRouter, DeepSeek, Zen, Anthropic) in as a per-group agent backend for NanoClaw instead of the Anthropic Agent SDK.
Dev & CodingAdvanced★ 30,471⑂ 12,865AI score 8/10Last updated: Aug 9, 2026
What it does
Lets NanoClaw's containerized agent runtime use OpenCode as its provider instead of the default claude backend.
- Pulls OpenCode provider sources from the
providersbranch for both the host and container trees and appends the self-registration imports - Pins
@opencode-ai/sdkand theopencode-aiCLI to 1.4.17 (1.14.x changes the session API and is incompatible) - Adds a dedicated Dockerfile RUN layer and rebuilds the agent image
- Validates the wiring with three registration guard tests plus a structural Dockerfile test
- Switches per group with
ncl groups config update --provider opencodeand back-fills existing per-group source overlays - Ships ready-to-copy
.envshapes and OneCLI secret commands for OpenRouter, DeepSeek, Anthropic, and OpenCode Zen (x-api-keyquirk included)
Who it's for
- Operators self-hosting NanoClaw who want cheaper or alternative models
- Teams that keep API keys in OneCLI's credential proxy rather than container env vars
- Developers running multi-provider experiments across agent groups
Examples
- "Move this group to DeepSeek" → copy provider files, set
OPENCODE_PROVIDER=deepseekandANTHROPIC_BASE_URL=https://api.deepseek.com/v1, restart the group. - "Use OpenRouter with a Sonnet/Haiku pair" → set
OPENCODE_MODEL/OPENCODE_SMALL_MODELand register the key with host-patternopenrouter.ai. - Hitting
Unknown provider: opencodeafter a rebuild →docker builder prune -f && ./container/build.sh, then refresh the per-group overlays.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/nanocoai/nanoclaw/HEAD/.claude/skills/add-opencode/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the .claude/skills/add-opencode folder from the GitHub repo nanocoai/nanoclaw into my ~/.claude/skills/add-opencode/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/nanocoai/nanoclaw.git && mkdir -p ~/.claude/skills && cp -r nanoclaw/.claude/skills/add-opencode ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Clone the NanoClaw repository:
git clone https://github.com/nanocoai/nanoclaw.git - Copy the skill folder into place:
mkdir -p ~/.claude/skills && cp -r nanoclaw/.claude/skills/add-opencode ~/.claude/skills/ - Make sure you have Docker (buildkit),
pnpm,bun, the NanoClawnclCLI, andonecliinstalled. - Open Claude Code at the NanoClaw repo root and ask it to "add the OpenCode provider".
- The skill runs
git fetch origin providers, copies provider files, installs SDK 1.4.17, and patches the Dockerfile. - Confirm
pnpm run buildand all three guard tests pass, then build the image with./container/build.sh. - Fill in
OPENCODE_PROVIDER,OPENCODE_MODEL, andANTHROPIC_BASE_URLin.env, and register the provider key in OneCLI with the matching host pattern. - Switch a group with
ncl groups config update --id <group-id> --provider opencode, thenncl groups restart --id <group-id>. Memory does not carry over — run/migrate-memory.
View source on GitHub ↗License: MIT