Skip to content
Automation
Skill

/add-opencode

Use OpenCode as an agent provider. OpenRouter, OpenAI, Google, DeepSeek, etc. via OpenCode config — not the Anthropic Agent SDK. Per group via `ncl groups config update --provider opencode`; host passes OPENCODE_* and XDG mount when spawning containers.

From plugin
nanoclaw
31k64 skills

Claude Code

$ npx -y skills add nanocoai/nanoclaw --skill add-opencode --agent claude-code

SKILL.md

add-opencode.SKILL.md
name: add-opencode
description: Use OpenCode as an agent provider. OpenRouter, OpenAI, Google, DeepSeek, etc. via OpenCode config — not the Anthropic Agent SDK. Per group via `ncl groups config update --provider opencode`; host passes OPENCODE_* and XDG mount when spawning containers.
metadata:
  nanoclaw-provider: opencode
  nanoclaw-provider-label: OpenCode
  nanoclaw-provider-hint: Open-source provider router
  nanoclaw-provider-offered: 'true'
  nanoclaw-provider-image: local-required

OpenCode agent provider

Install OpenCode as an optional NanoClaw runtime. The payload is included in this skill; it needs no separate provider branch. It uses the upstream runtime, instructions, host, and setup metadata contracts. The host contract remains at version 1; the container owns its non-secret ChatGPT placeholder file.

OpenCode is offered by the standard setup provider picker. Existing installs can add or authenticate it with `pnpm exec tsx setup/index.ts --step provider-auth opencode`; an install that way also rebuilds and restarts the host before auth. To replace an installed payload and update its pins, append `--refresh`; back up local payload edits first. Ordinary re-authentication leaves installed files and the container image alone. Backend defaults are installation-wide; model and reasoning effort can be overridden per group through the existing container configuration. Per-group backend/auth selection is separate work. Channel attachments reach the agent as a prompt line naming the staged file; the agent opens it with OpenCode's read tool, which hands images and PDFs to models that accept them (a custom model declares that with `OPENCODE_MODEL_INPUT_MODALITIES`).

Authentication checks the installed files, registration lines, and exact pins against this skill's declarations without launching a subprocess or container. Install and refresh run the existing provider contract verification; the build step owns image freshness. Model selection does not repeat installation checks. A working backend and account are checked separately by sending a real request.

Install

After installing this payload, run `pnpm exec tsx scripts/opencode-host.ts --configure` for host OpenCode setup, or use `--update` / `--debug` for the corresponding operational skill. An existing OpenCode CLI can also run directly in the checkout; it discovers `.claude/skills` natively. Host sign-in uses OpenCode's own settings and is independent of the container's gateway credentials. Installed setup failures use the existing provider failure-assist hook, including wizard authentication and installation-check failures. Host diagnostic context is model input and may remain in native OpenCode history; deleting its private temporary file does not erase those records. The helper requires stable OpenCode 1.18.25 or newer with `--prompt` and prefers the newest compatible installation it finds. `--debug`, `--update` and failure help launch it with an `OPENCODE_PERMISSION` override, so OpenCode asks before every edit and command even when the operator's top-level config allows them (OpenCode itself skips the prompt for a bare redirection with no command, such as `> file`). `--configure` keeps OpenCode's native permissions. Automatic help before payload installation is optional and is not part of the runtime contract.

Install and refresh require host contract version 1 and credential-connection seam version 1 or later. The compatibility predicate below guards every subsequent step, so an unsupported core receives no partial payload or dependency changes. Update core first if it reports a missing prerequisite.

node -e "const fs=require('fs'); const p='src/provider-contracts/registry.ts', g='setup/gateways/credential-store.ts'; if(fs.existsSync(p) && /PROVIDER_HOST_CONTRACT_SEAM_VERSION = 1/.test(fs.readFileSync(p,'utf8')) && fs.existsSync(g) && /PROVIDER_CREDENTIAL_CONNECTION_SEAM_VERSION = [1-9]/.test(fs.readFileSync(g,'utf8'))) console.log('yes'); else console.log('no')"

Copy only the files listed below from this skill's `payload/` to the matching paths at the project root. Do not copy ignored dependency directories or other generated native-test files. These are skill-owned files; overwrite them together when refreshing the skill. Keep the core-owned `cwd-shim.ts`, registries, and contract realization files in place.

When refreshing an older installation, remove its unused `opencode-memory-plugin.ts`, `opencode.compaction.test.ts`, and dedicated `opencode-managed-config` tree from `container/agent-runner/src/providers/`. Recreate affected containers after the refresh to discard their old config symlinks. Keep other tools' settings and persisted session data.

The obsolete host Dockerfile guard and the retired attachment test must also be removed during refresh; current OpenCode installation is declared by the SDK and CLI manifests, and the test covered file-part code this payload no longer has.

rm -f src/opencode-dockerfile.test.ts container/agent-runner/src/providers/opencode.attachments.test.ts
payload/container/agent-runner/src/provider-contracts/opencode.ts -> container/agent-runner/src/provider-contracts/opencode.ts
payload/container/agent-runner/src/providers/mcp-to-opencode.test.ts -> container/agent-runner/src/providers/mcp-to-opencode.test.ts
payload/container/agent-runner/src/providers/mcp-to-opencode.ts -> container/agent-runner/src/providers/mcp-to-opencode.ts
payload/container/agent-runner/src/providers/opencode-config.ts -> container/agent-runner/src/providers/opencode-config.ts
payload/container/agent-runner/src/providers/opencode-memory.ts -> container/agent-runner/src/providers/opencode-memory.ts
payload/container/agent-runner/src/providers/opencode-registration.test.ts -> container/agent-runner/src/providers/opencode-registrat
Read more
@nanocoai
Ships withnanoclaw

A lightweight alternative to OpenClaw that runs in containers for security. Connects to WhatsApp, Telegram, Slack, Discord, Gmail and other messaging apps,, has memory, scheduled jobs, and runs directly on Anthropic's Agents SDK

Stars on GitHub

Momentum

stars in total
31.1k
Star history of nanocoai/nanoclaw on GitHub, a chart by star-history.com

Other skills on nanoclaw.

add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

@nanocoai@nanocoaiInstall Skill
add-atomic-chat-tool

add-atomic-chat-tool

Add Atomic Chat MCP server so the container agent can call local models served by the Atomic Chat desktop app via its…

@nanocoai@nanocoaiInstall Skill
add-clidash

add-clidash

Add clidash — a zero-dependency, read-only web dashboard that derives its tabs and tables at runtime from any CLI that lists…

@nanocoai@nanocoaiInstall Skill
add-codex

add-codex

Use Codex (OpenAI's codex app-server) as a full agent provider — planning, tool orchestration, MCP tools, server-side history,…

@nanocoai@nanocoaiInstall Skill
add-cursor

add-cursor

Use Cursor (local Agent SDK) as a full agent provider — planning, tool orchestration, MCP tools, session resume — alongside or…

@nanocoai@nanocoaiInstall Skill

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n11d209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
agent-browser

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…

@vercel-labs-2@vercel-labs-2Install Skill
opencli-adapter-author

opencli-adapter-author

Build or improve an OpenCLI JS adapter using observed site behavior, existing adapters and browser API evidence. For ad-hoc…

opencli3d31k
@jackwener@jackwenerInstall Skill

Questions about add-opencode.

Which coding agents can use add-opencode?
add-opencode installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.