Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
Back to list

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 & CodingAdvanced30,47112,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 providers branch for both the host and container trees and appends the self-registration imports
  • Pins @opencode-ai/sdk and the opencode-ai CLI 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 opencode and back-fills existing per-group source overlays
  • Ships ready-to-copy .env shapes and OneCLI secret commands for OpenRouter, DeepSeek, Anthropic, and OpenCode Zen (x-api-key quirk 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

  1. "Move this group to DeepSeek" → copy provider files, set OPENCODE_PROVIDER=deepseek and ANTHROPIC_BASE_URL=https://api.deepseek.com/v1, restart the group.
  2. "Use OpenRouter with a Sonnet/Haiku pair" → set OPENCODE_MODEL / OPENCODE_SMALL_MODEL and register the key with host-pattern openrouter.ai.
  3. Hitting Unknown provider: opencode after 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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download 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.

  1. Clone the NanoClaw repository: git clone https://github.com/nanocoai/nanoclaw.git
  2. Copy the skill folder into place: mkdir -p ~/.claude/skills && cp -r nanoclaw/.claude/skills/add-opencode ~/.claude/skills/
  3. Make sure you have Docker (buildkit), pnpm, bun, the NanoClaw ncl CLI, and onecli installed.
  4. Open Claude Code at the NanoClaw repo root and ask it to "add the OpenCode provider".
  5. The skill runs git fetch origin providers, copies provider files, installs SDK 1.4.17, and patches the Dockerfile.
  6. Confirm pnpm run build and all three guard tests pass, then build the image with ./container/build.sh.
  7. Fill in OPENCODE_PROVIDER, OPENCODE_MODEL, and ANTHROPIC_BASE_URL in .env, and register the provider key in OneCLI with the matching host pattern.
  8. Switch a group with ncl groups config update --id <group-id> --provider opencode, then ncl groups restart --id <group-id>. Memory does not carry over — run /migrate-memory.