suvadu-opencode-hook
v0.1.1
Published
OpenCode plugin that logs bash tool executions to Suvadu for AI command history and reporting.
Maintainers
Readme
suvadu-opencode-hook
OpenCode plugin that logs OpenCode bash tool executions into Suvadu, so AI-run shell commands show up in your command history and reports.
Requirements
- OpenCode
suv(Suvadu CLI) installed and available inPATH
Install
Option A: Global file plugin (simple)
mkdir -p ~/.config/opencode/plugins
cp ./suvadu-shell-hook.js ~/.config/opencode/plugins/Restart OpenCode.
Option B: Project-local plugin
mkdir -p .opencode/plugins
cp ./suvadu-shell-hook.js .opencode/plugins/This keeps the plugin scoped to one repo/project.
Option C: OpenCode config (plugin) via npm package
OpenCode can install plugins from npm through opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["<published-package-name>"]
}For this repo, Option C works after publishing this plugin as an npm package.
How it works
- Hooks OpenCode
tool.execute.beforeandtool.execute.afterfor thebashtool. - Captures command, cwd, timing, session id, and exit code (when available).
- Writes entries with:
suv add --executor-type agent --executor opencode ...Verify
Run a command through OpenCode bash tool (for example, echo hello), then check:
suv search --executor opencodeLicense
MIT. See LICENSE.
