See More

# Plugins Add published packages, versioned packages, scoped packages, or local plugin directories to `opencode.json(c)`. ## Configure ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", "plugins": [ "opencode-acme-plugin", "[email protected]", "@acme/opencode-plugin", "./plugins/local", "../shared/plugin", "/absolute/path/plugin", "file:///home/me/plugins/local", { "package": "@acme/opencode-plugin", "options": { "agent": "reviewer", "strict": true, }, }, ], } ``` Relative paths resolve from the config file containing the entry. Configured local paths must be directories. A path to a single file is skipped. See [Load](/build/plugins#load) for how OpenCode finds each part in a directory. Plugin arrays from applicable config files are applied from lowest to highest precedence instead of replacing one another. ```text ~/.config/opencode/opencode.jsonc ./opencode.jsonc ./.opencode/opencode.jsonc ``` ## Discover OpenCode also loads direct `.ts` and `.js` files and immediate plugin package directories from every discovered `.opencode/plugins/` directory. ```text .opencode/ └── plugins/ ├── concise.ts ├── reviewer.js └── acme-package/ ``` Global plugins use the same discovery layout under the OpenCode config directory. ```text ~/.config/opencode/plugins/ ``` A `plugins/` directory beside a project-root `opencode.json(c)` is not discovered automatically; configure its plugin directories explicitly or move it under `.opencode/`. ```jsonc title="opencode.jsonc" { "plugins": ["./plugins/local"] } ``` ## Control Plugin entries are processed in order. Prefix an ID or wildcard with `-` to disable it, use `*` for every plugin, and use `.*` to match an ID prefix. A later ID re-enables a plugin. ```jsonc title="opencode.jsonc" { "plugins": ["*", "-opencode.provider.*", "opencode.provider.openai", "-acme.reviewer"] } ``` To disable the notice added to new forks, add `"-opencode.fork-notice"` to `plugins`. Two built-in plugins ignore removals so that a repository cannot switch off [policy](/policies) enforcement: `opencode.config.policy` and `opencode.provider.opencode`, the Console connection that delivers organization policy. ## Manage Install, list, check, update, or remove global package plugins with the CLI. ```sh opencode plugin add [email protected] opencode plugin list opencode plugin list --builtin opencode plugin check opencode plugin update opencode plugin update opencode-acme-plugin opencode plugin remove [email protected] ``` `plugin check` checks server, GUI-only, and TUI-only package plugins for updates. `plugin update` updates every outdated package; pass a configured package target to check or update only that package. Local plugins and exact package revisions are skipped. A package updates itself when it names what to follow: `name@latest`, a version range such as `name@^1.2.0`, `name@~1.2.0`, `[email protected]` or `name@>=1.2.0 <2`, a Git branch such as `github:acme/plugin#main`, or a Git `semver:` range. OpenCode checks it on startup and every 24 hours, installs a newer version, and reloads it. A range only moves to versions inside it. If the new version fails to load, the previous one keeps running and stays installed. A bare name (`name`) or repository (`github:acme/plugin`) stays on the version it installed. So do other npm tags such as `name@next` and Git tags. `plugin check` still reports their updates and `plugin update` installs them. Exact versions and commit hashes are pinned. Package installation accepts npm names with versions, tags, or ranges, plus npm-compatible Git package specifications. Git repositories can use hosted shortcuts, HTTPS, or SSH, including private repositories available through your existing Git credentials. ```sh opencode plugin add @acme/opencode-plugin@latest opencode plugin add github:acme/opencode-plugin opencode plugin add git+ssh://[email protected]/acme/opencode-plugin.git#main opencode plugin add 'github:acme/plugins#main::path:packages/opencode-plugin' ``` Branches, tags, complete commit hashes, and npm's `::path:` repository-subdirectory selectors are supported. Configure local paths directly; tarball and npm alias targets are not accepted by `plugin add`. ## Reload Changes under watched config directories reload automatically. Server startup loads cached package plugins immediately, installs missing packages in the background, and checks unpinned npm and Git plugins for updates. Exact npm versions and full Git commit hashes stay pinned. Changes to unwatched local dependencies may still require restarting OpenCode. ```sh touch .opencode/plugins/concise/index.ts opencode service restart ``` ## Desktop A plugin that exports `./gui-experimental` also adds panels, commands, or settings to OpenCode Desktop. The app loads plugins from the server it runs, so configure the plugin in your global `opencode.json(c)` to use it in every window. ```jsonc title="~/.config/opencode/opencode.jsonc" { "plugins": ["opencode-acme-plugin"], } ``` **Settings > Extensions > Plugins** lists them when the app's own server is selected. A plugin's switch turns off only its desktop UI, and **Reload** loads it again after a failure. To turn off the whole plugin, add `-` and its ID to `plugins`, for example `"-acme"`. ## Terminal TUI-only plugins are configured separately and remain active when connected to a remote server. ```json title="cli.json" { "plugins": ["opencode-acme-cli"] } ``` Create plugins that add tools, hooks, integrations, commands, agents, and other behavior.