# Add Opencode

Use OpenCode as an agent provider.

- Repository: https://github.com/nanocoai/nanoclaw (31069 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add nanocoai/nanoclaw --skill add-opencode -g -a claude-code -y`
Codex: `npx skills add nanocoai/nanoclaw --skill add-opencode -g -a codex -y`
Cursor: `npx skills add nanocoai/nanoclaw --skill add-opencode -g -a cursor -y`
Gemini CLI: `npx skills add nanocoai/nanoclaw --skill add-opencode -g -a gemini-cli -y`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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`.
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

The rest: https://github.com/nanocoai/nanoclaw/blob/HEAD/.claude/skills/add-opencode/SKILL.md
