Something went wrong. Try again.
opencode v2 mirror
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162---title: "Plugins"---
Plugins configured in `opencode.json(c)` that expose a TUI component are loaded automatically by the CLI. To learn howto build plugins, see [Building plugins](/build/plugins). You do not need to add the same package to `cli.json`. The CLIgets the active plugin list from the connected OpenCode server, so this also works when the server is remote.
Use `cli.json` for CLI-only plugins. These plugins run locally in the terminal and remain active when the CLI connectsto a remote server:
```json title="cli.json"{ "plugins": [ "opencode.example", "opencode.example@1.0.0", "@example/opencode-tui", "@example/opencode-tui@1.0.0", "./plugins/status", "../plugins/status", "/home/user/plugins/status", "file:///home/user/plugins/status" ]}```
Entries are processed in order. Prefix an ID or wildcard with `-` to disable matching plugins:
```json title="cli.json"{ "plugins": ["*", "-opencode.notifications", "-team.*"]}```
Pass plugin options with the object form:
```json title="cli.json"{ "plugins": [ { "package": "@example/opencode-tui", "options": { "compact": true } } ]}```
OpenCode also discovers plugins under the global config directory and project `.opencode` directories. Each plugin usesthe same layout as a published package, with server and TUI entrypoints kept together.
```text title="Plugin discovery paths"<global-config>/plugins/status/index.ts<global-config>/plugins/status/tui.ts<project>/.opencode/plugins/status/index.ts<project>/.opencode/plugins/status/tui.ts```
Discovered plugins can import `@opencode/plugin/tui` directly; OpenCode resolves the package at runtime. See[Building CLI plugins](/build/plugins/cli) for examples.