Brepl integration for OpenCode - automatic Clojure syntax validation, auto-fix, and REPL evaluation.
- Pre-edit Validation - Validates Clojure syntax before files are written
- Auto-Correction - Fixes mismatched brackets
- Post-edit Evaluation - Evaluates files in running nREPL server
Detailed brepl features here.
bbin install io.github.licht1stein/brepl
brepl --helpFollow instruction
# to `~/.config/opencode/plugins/brepl.ts`
./install.sh./install.sh /path/to/project
Copy brepl.ts file to either
- Global plugin directory (
~/.config/opencode/plugins/) - Project plugin directory (
.opencode/plugins/)
# Just run in your project dir
opencodePlugin automatically validates and fixes Clojure files on Edit/Write.
OpenCode Starts
↓
session.created (capture sessionId)
↓
┌────────────────────────────────────┐
│ Edit/Write Clojure File |
├────────────────────────────────────┤
│ tool.execute.before (Event) │
│ ↓ │
│ brepl hook validate (stdin) │
│ ↓ │
│ Valid? → Allow + Apply correction │
└────────────────────────────────────┘
↓
File Written
↓
┌────────────────────────────────────┐
│ tool.execute.after (Event) │
│ ↓ │
│ brepl hook eval (with sessionId) │
│ ↓ │
│ Report results │
└────────────────────────────────────┘
↓
session.deleted (cleanup backups)
No license