Beep On Idle
Play a short beep whenever an opencode agent finishes its work and waits for input.
0
66
9 in 7 days
30.1
Multi-signal model
26 days ago
2026-09-08
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-beep-on-idle@1.0.1"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-beep-on-idle@1.0.1"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-beep-on-idleOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
An opencode plugin that plays a short beep whenever any agent finishes its work and waits for the next input. Works for main sessions and subagents.
Requirements
- opencode with plugin support
- Linux with
canberra-gtk-play(or setBEEP_CMD, see below)
Install
From npm, in your opencode.json / opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-beep-on-idle"]
}
Or from a local path:
{
"plugin": ["/path/to/opencode-beep-on-idle/beep-on-idle.ts"]
}
Restart opencode after changing plugins — config is loaded once at startup.
Configuration
| Env var | Default | Purpose |
|---|---|---|
BEEP_CMD |
/usr/bin/canberra-gtk-play -i bell |
Shell command played on each idle event |
Example: BEEP_CMD="paplay ~/sounds/done.oga".
How it works
The plugin subscribes to opencode's event bus and fires on
session.status → idle and on session.idle. The sound is spawned
detached and fire-and-forget: awaiting audio child processes can stall the
plugin event loop (observed with proc.exited never resolving for
paplay/canberra-gtk-play/pw-play when awaited), so the child is
backgrounded (&, stdio detached) and never awaited.
Development
bun install
bun run build # bundle check
bunx tsc --noEmit # typecheck
bun run test # smoke test (uses test/fake-beep.sh, no sound played)
Note: BEEP_CMD/BEEP_MARKER must be exported before bun starts (as the
test script does) — Bun.spawn does not see process.env mutations made
at runtime.
After an opencode upgrade, re-run the checks above plus one real
listen-test (opencode run a trivial prompt), since the plugin API can shift
between versions.
Changelog
1.0.1
- Fix: add
mainentry so opencode's npm plugin loader can resolve the entrypoint (without it the plugin was silently skipped).
1.0.0
- Initial release: beep on
session.statusidle andsession.idlevia detachedcanberra-gtk-play,BEEP_CMDoverride, smoke test.
License
MIT — see LICENSE.
Similar plugins
Simple Notify
opencode-simple-notify
Desktop notification plugin for OpenCode - works on Linux (dbus) and macOS (osascript)
Alert
@chousyn/opencode-alert
Cross-platform notification plugin for OpenCode — desktop alerts, sound alerts, and webhook notifications with project-level configuration
Notification
opencode-notification
OpenCode plugin for simple system notifications when permissions are needed, generation completes, or errors occur