Skip to main content

Prerequisites

Before installing the plugin, make sure you have:
  • OpenCode installed (download)
  • Bun runtime for TypeScript execution (no build step required)
The plugin uses Bun to transpile TypeScript on the fly. OpenCode automatically detects Bun-compatible plugins.

Installation Methods

You can install the plugin globally (available in all OpenCode sessions) or per-project (available only in a specific project). Global installation makes the plugin available in every OpenCode session, regardless of which directory you’re working in.
1

Create the config directory

If it doesn’t exist, create the OpenCode config directory:
mkdir -p ~/.config/opencode
2

Edit opencode.json

Open or create ~/.config/opencode/opencode.json and add the plugin:
{
  "plugin": ["github:dmicheneau/opencode-template-agent"]
}
If you already have other plugins configured, add the new entry to the existing plugin array.
3

Restart OpenCode

Close and reopen your OpenCode session. The plugin is now active.You can verify by asking the AI:
List all available agents
The AI should invoke the list_agents tool and return the full agent catalog.

Per-Project Installation

Per-project installation limits the plugin to a specific project directory. Useful when you only need agent discovery in certain codebases.
1

Create the project config directory

In your project root, create the OpenCode config directory:
mkdir -p .opencode
2

Edit opencode.json

Create or edit .opencode/opencode.json in your project root:
{
  "plugin": ["github:dmicheneau/opencode-template-agent"]
}
3

Restart OpenCode in the project

Open OpenCode in this project directory. The plugin is active only for this project.

Configuration Examples

Single Plugin

If this is your only plugin:
{
  "plugin": ["github:dmicheneau/opencode-template-agent"]
}

Multiple Plugins

If you have other plugins installed:
{
  "plugin": [
    "github:dmicheneau/opencode-template-agent",
    "npm:some-other-plugin",
    "./local-plugin"
  ]
}
OpenCode supports multiple plugin sources:
  • github:owner/repo — GitHub repository
  • npm:package-name — npm package
  • ./relative/path — Local directory

Verifying Installation

Once installed, you can test the plugin by asking the AI:
Search for TypeScript agents
The AI should respond with a list of agents matching “TypeScript” by invoking the search_agents tool. If you get an error or no response, check:
  1. Config file path — make sure opencode.json is in the right location
  2. JSON syntax — validate your JSON (trailing commas are not allowed)
  3. Bun installation — run bun --version to verify Bun is installed

Troubleshooting

Check the config file path:
  • Global: ~/.config/opencode/opencode.json
  • Per-project: .opencode/opencode.json at project root
Validate JSON syntax:
cat ~/.config/opencode/opencode.json | bun x jsonlint
Restart OpenCode after making changes.
Verify Bun is installed:
bun --version
If not installed, follow the Bun installation guide.Check plugin array syntax:
{
  "plugin": ["github:dmicheneau/opencode-template-agent"]
}
Not:
{
  "plugin": "github:dmicheneau/opencode-template-agent"
}
The plugin field must be an array, even for a single plugin.
The plugin reads from the manifest.json in the GitHub repository. If you see outdated data:
  1. The repository might have updated agents
  2. OpenCode might be caching the plugin
Force a refresh:
  • Remove the plugin from opencode.json
  • Restart OpenCode
  • Re-add the plugin
  • Restart OpenCode again

Uninstalling

To remove the plugin:
1

Remove from config

Edit opencode.json and remove the plugin entry:
{
  "plugin": [
    // Remove this line:
    // "github:dmicheneau/opencode-template-agent"
  ]
}
2

Restart OpenCode

Close and reopen OpenCode. The plugin is now unloaded.

Next Steps

Tools Reference

Learn about the 4 available tools

Plugin Overview

Understand how the plugin works

Build docs developers (and LLMs) love