Skip to content

flexdinesh/opencode-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-plugins

A pnpm monorepo for OpenCode plugins.

Layout

packages/
  plugins/
    oc-bash-guard/  # server plugin
    oc-tps/         # TUI plugin
    oc-timer/       # TUI plugin

Plugins

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.

Development

Install workspace dependencies:

pnpm install

Run all available package tests:

pnpm test

Run all available package checks:

pnpm check

Run a command for one package:

pnpm --filter oc-bash-guard test
pnpm --filter oc-tps check
pnpm --filter oc-timer check

Adding a plugin

  1. Create a package under packages/plugins/<plugin-name>.
  2. Add a package.json with explicit OpenCode exports.
  3. Keep server and TUI plugins in separate modules/packages.
  4. For server plugins, default-export { id, server } typed with PluginModule from @opencode-ai/plugin.
  5. For TUI plugins, default-export { id, tui } typed with TuiPluginModule from @opencode-ai/plugin/tui.
  6. Add plugin-specific docs and tests/checks.

Local usage

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-timer

For 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors