opencode

A command for managing OpenCode and Zen connections, switching between cloud and local Ollama models, viewing available models, and editing OpenCode settings. Ollama is software for running AI models on your own computer.

In plain words
What is it for?
Checking OpenCode and Ollama status, connecting to Zen, switching to a local model, listing or downloading models, editing configuration, and installing OpenCode.
Why use it?
It puts common connection, model, installation, and configuration tasks in one command instead of requiring separate manual checks.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/skywalker2506/ccplugin-opencode-bridge/opencode
Clone the repo
git clone --depth 1 https://github.com/SkyWalker2506/ccplugin-opencode-bridge
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,420 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01420
Opus 5 $0.00000 $0.00710
Sonnet 5 $0.00000 $0.00284
Haiku 4.5 $0.00000 $0.00142

Measured yesterday against content hash 17272334e1ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/opencode.md · 153 lines

How it starts

The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/opencode

Manage OpenCode/Zen connections, switch models, and configure local Ollama.

Usage

Command Behavior
/opencode Show current OpenCode setup status (Zen + Ollama)
/opencode zen Connect to Zen cloud, set free model (gpt-5-nano)
/opencode local Switch to Ollama local model (qwen2.5-coder:7b)
/opencode models List available models (Zen free + Ollama pulled)
/opencode pull <model> Pull an Ollama model (e.g., gemma3:4b, qwen2.5-coder:7b)
/opencode config Show and edit ~/.config/opencode/opencode.json
/opencode install Install or update OpenCode CLI (npm install -g opencode-ai)

Execution

Default: Show Status

When invoked without arguments, run the status script:

bash ~/.claude/plugins/opencode-bridge/scripts/opencode-status.sh

Display the output. The script checks:

1. Check if OpenCode CLI is installed:
   - Run: which opencode
   - If missing, offer to install: npm install -g opencode-ai

2. Check Ollama status:
   - Run: ollama list 2>/dev/null
   - Show pulled models or note that Ollama is not running

3. Check config file:
   - Read: ~/.config/opencode/opencode.json
   - Show current model, small_model, enabled_providers

4. Display summary:

   OpenCode Bridge Status
   ----------------------
   CLI:        installed (vX.X.X) | not installed
   Zen:        connected (model: opencode/gpt-5-nano) | not connected
   Ollama:     running (models: qwen2.5-coder:7b, gemma3:4b) | not running
   Config:     ~/.config/opencode/opencode.json
   Providers:  ["opencode", "ollama"]

/opencode zen -- Connect to Zen Cloud

1. Verify OpenCode CLI is installed (install if missing)
2. Check if ~/.config/opencode/opencode.json exists
   - If not, copy from ~/Projects/claude-config/templates/opencode.json
3. Remind user to authenticate:
   - "Run `opencode` then `/connect` -> select `opencode` -> paste API key from https://opencode.ai/auth"
   - Or set env: export OPENCODE_ZEN_API_KEY='sk-...' in ~/.zshrc
4. Set model to opencode/gpt-5-nano (default free tier)
5. Show available Zen free models:

   Zen Free Models
   ---------------
   opencode/gpt-5-nano        -- Free tier (default)
   opencode/minimax-m2.1-free -- Free, limited time
   opencode/glm-4.7-free      -- Free, limited time
   opencode/kimi-k2.5-free    -- Free, limited time
   opencode/big-pickle         -- Free, limited time

Read the full file on GitHub · 153 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 153 lines · 0 tokens per session scan A 17272334e1ae

Subscribe to this mod's changes

opencode is a command published in the GitHub repository SkyWalker2506/ccplugin-opencode-bridge (3 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,420 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.