OpenCode plugin that triggers a terminal bell on key events.
Privacy-friendly by design: no system notifications, no message content, no external commands, no network calls. It only writes the BEL control character (\x07) to stdout.
- Add the plugin to
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-bell@0.1.1"]
}- Restart OpenCode CLI.
OpenCode will auto-install the package and cache it under ~/.cache/opencode/node_modules/.
Copy index.js into ~/.config/opencode/plugins/ and restart OpenCode.
The plugin triggers a terminal bell for these events:
permission.askedquestion.askedsession.idlesession.error
Behavior details:
- Rings only when
process.stdout.isTTYis true. - Debounces repeated rings for the same key within 1200ms.
- Uses per-session keys when
event.properties.sessionIDis present.
- Trigger a permission request (e.g., any tool that requires approval).
- Or wait for a session to complete (
session.idle).
If you do not hear/see anything, check Terminal.app settings:
- Terminal.app -> Settings -> Profiles -> Bell
- Remove
opencode-bellfromopencode.jsonand restart OpenCode. - If you used the local-file method, delete
~/.config/opencode/plugins/index.js(or whichever filename you used).
MIT