A comprehensive guide to writing plugins for OpenCode that extend agent behavior with hooks, custom tools, and event handling.
- Create a TypeScript file in
.opencode/plugin/(project) or~/.config/opencode/plugin/(global) - Export a named plugin function
- Restart OpenCode