A pnpm monorepo for OpenCode plugins.
packages/
plugins/
oc-bash-guard/ # server plugin
oc-tps/ # TUI plugin
oc-timer/ # TUI plugin| Package | Type | Description |
|---|---|---|
oc-bash-guard |
Server | Prompts before risky bash commands and allows safe commands through. |
oc-tps |
TUI | Displays live TPS, average TPS, and average TTFT in the session prompt. |
oc-timer |
TUI | Shows active elapsed session time in the session prompt. |
Install workspace dependencies:
pnpm installRun all available package tests:
pnpm testRun all available package checks:
pnpm checkRun a command for one package:
pnpm --filter oc-bash-guard test
pnpm --filter oc-tps check
pnpm --filter oc-timer check- Create a package under
packages/plugins/<plugin-name>. - Add a
package.jsonwith explicit OpenCode exports. - Keep server and TUI plugins in separate modules/packages.
- For server plugins, default-export
{ id, server }typed withPluginModulefrom@opencode-ai/plugin. - For TUI plugins, default-export
{ id, tui }typed withTuiPluginModulefrom@opencode-ai/plugin/tui. - Add plugin-specific docs and tests/checks.
These plugins are not published to npm or any registry. They can't be installed with npm install or opencode plugin.
Symlink each plugin into ~/.config/opencode/plugins/:
mkdir -p ~/.config/opencode/plugins
ln -s $PWD/packages/plugins/oc-bash-guard ~/.config/opencode/plugins/oc-bash-guard
ln -s $PWD/packages/plugins/oc-tps ~/.config/opencode/plugins/oc-tps
ln -s $PWD/packages/plugins/oc-timer ~/.config/opencode/plugins/oc-timerFor server plugins, add to opencode.json or opencode.jsonc:
{
"plugin": ["./plugins/oc-bash-guard"]
}For TUI plugins, add to ~/.config/opencode/tui.json:
{
"plugin": ["./plugins/oc-tps/tui", "./plugins/oc-timer/tui"]
}Restart OpenCode after changing plugin files, config, or dependencies.