Skip to content

OpenCode

Target id Package Ship with
opencode @oiap/exporter-opencode install-agent-plugin
Terminal window
npx oiap build oiap.plugin.ts --target opencode --out dist/opencode
npx install-agent-plugin <owner>/<repo> --plugin <plugin-id> --agent opencode

OpenCode target exporter for Open Interoperable Agent Plugins.

The exporter renders project-local OpenCode configuration and companion assets:

  • opencode.json for schema, instruction references, MCP servers, and permissions.
  • AGENTS.md and .opencode/instructions/ for project rules.
  • .opencode/skills/ for native Agent Skills.
  • .opencode/commands/ for slash command prompt templates.
  • .opencode/agents/ for custom primary/subagent prompt files.
  • .opencode/plugins/oiap-hooks.js for plugin hooks backed by the OIAP generated runtime.

Most authors should use the CLI:

Terminal window
bun run oiap build ./oiap.plugin.ts --target opencode --out ./build/opencode

The output is a bundle artifact only. It does not install files into a user’s global OpenCode config directory or enable host-managed settings.

Where install-agent-plugin and installPlugin() write the bundle, from the target profile. --out <dir> overrides them.

Scope Path
Local (default) ./.opencode/plugins/<plugin-id>
Global (--global) ~/.config/opencode/plugins/<plugin-id>

From the platform support matrix (see its legend).

Profile Package Rules Skills Commands Hooks Agents MCP Runtime Policy
bridge P Y Y Y P Y Y R P

Bridge target. OpenCode documents project opencode.json, AGENTS.md, .opencode/skills, .opencode/commands, .opencode/agents, local or npm plugins, local and remote MCP servers, and permission rules. OIAP exports those project-local assets and uses a bundled JavaScript OpenCode plugin bridge for supported hook events.