Part of
hooks/— see alsosrc/hooks/for installation code
- TypeScript plugin using the zx library (not a shell hook)
- Intercepts
tool.execute.beforeevents, callsrtk hook opencodeas a subprocess - The Rust side judges the command against OpenCode's own permission rules
(root and project
opencode.json/.jsonc, last match wins) and answers{}whenever the rewrite would change the verdict those rules give — OpenCode evaluates the final command itself, so RTK never lifts a deny, silences an ask, or blocks an allow (#4195) - Uses
.quiet().nothrow()to silently ignore failures - Mutates
args.commandin-place if the answered rewrite differs from original - Installed to
~/.config/opencode/plugins/rtk.tsbyrtk init -g --opencode