Audio notifications for OpenCode. Get notified when permissions are requested or tasks complete.
Works on macOS, Linux Desktop, Linux TTY, Windows, and WSL. Install in 30 seconds:
curl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/install.sh | bashYou ask OpenCode to do something, switch to another window, and forget to check back.
π Get an audio notification when:
- OpenCode needs permission to run commands
- OpenCode finishes your task
No more constant checking!
Copy and paste this:
curl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/install.sh | bashThat's it! Start OpenCode and you'll have audio notifications.
If you prefer to install manually:
Step 1: Create the plugin directory
mkdir -p ~/.config/opencode/pluginStep 2: Download the plugin
curl -o ~/.config/opencode/plugin/audio-notify.js \
https://raw.githubusercontent.com/IFAKA/oc-notify/master/audio-notify.jsStep 3: Restart OpenCode
opencodeDone! π
curl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/update.sh | bashcurl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/uninstall.sh | bashDetails: Installation Guide
| Feature | Description |
|---|---|
| π Permission Alerts | Sound when OpenCode needs approval |
| π΅ Completion Sounds | Sound when your task finishes |
| π Cross-Platform | macOS, Linux Desktop, Linux TTY, Windows, WSL |
| π― Zero Config | Works immediately with smart defaults |
| π Anti-Spam | Smart cooldowns prevent sound spam |
| βοΈ Configurable | Customize sounds, timing, everything |
| πͺΆ Lightweight | Single file, no dependencies |
OpenCode asks permission
β
π DING!
β
You switch back & approve
β
[Task runs...]
β
π΅ CHIME!
β
You check results
Permission sound: Short, attention-grabbing beep
Completion sound: Pleasant chime
You're all set! Works out of the box with system sounds.
You're all set! Auto-detects PulseAudio/PipeWire.
For best audio quality, install ALSA utils:
sudo pacman -S alsa-utils # Arch
sudo apt install alsa-utils # Debian/Ubuntu
sudo dnf install alsa-utils # FedoraTest your audio:
speaker-test -t sine -f 800 -l 1Heard a beep? β
Perfect!
No sound? See Troubleshooting
You're all set! Uses PowerShell beep commands.
Works with terminal bell by default. For better sound, configure audio forwarding.
Start OpenCode:
opencodeYou should see:
π Audio Notify Plugin v1.0.0
π± Platform: linux
β
Available audio methods: speaker-test, bell
π΅ Primary method: speaker-test
Test it:
- Ask OpenCode to run a bash command
- π Hear a sound when permission requested
- π΅ Hear a sound when task completes
Working? π You're done!
Not working? π Check Troubleshooting
The plugin works great with defaults. Only configure if you want to customize.
Create: ~/.config/opencode/opencode.json
{
"audio_notifications": {
"completion": {
"enabled": false
}
}
}{
"audio_notifications": {
"permission": { "method": "bell" },
"completion": { "method": "bell" }
}
}{
"audio_notifications": {
"permission": { "cooldown": 5 },
"completion": { "cooldown": 10 }
}
}See all options: docs/CONFIGURATION.md
Test manually:
printf '\a'Still nothing?
- Linux TTY: Install
alsa-utils(see Platform Setup) - macOS: Check System Preferences β Sound β Alert volume
- All: Enable debug mode (see below)
Enable debug mode:
Edit ~/.config/opencode/opencode.json:
{
"audio_notifications": {
"debug": true
}
}Restart OpenCode - you'll see detailed logs.
Install ALSA utils:
sudo pacman -S alsa-utils # Arch
sudo apt install alsa-utils # Debian/Ubuntu
sudo dnf install alsa-utils # FedoraIncrease cooldowns:
{
"audio_notifications": {
"permission": { "cooldown": 10 },
"completion": { "cooldown": 20 }
}
}Option 1: In config
{
"audio_notifications": {
"enabled": false
}
}Option 2: Remove plugin
rm ~/.config/opencode/plugin/audio-notify.jsMore help: docs/TROUBLESHOOTING.md or open an issue
Click to expand technical details
On startup, the plugin:
- Detects your platform (macOS, Linux, Windows)
- Tests which audio methods are available
- Picks the best one automatically
- Falls back gracefully if methods fail
| Platform | Best β Fallback |
|---|---|
| macOS | afplay β bell |
| Linux Desktop | paplay β speaker-test β bell |
| Linux TTY | speaker-test β beep β bell |
| Windows | powershell-beep β bell |
permission.updated- Fires when OpenCode asks permissionsession.idle- Fires when OpenCode finishes processing
- Permission sounds: Max 1 per 2 seconds
- Completion sounds: Max 1 per 5 seconds
Why? If OpenCode requests 10 permissions rapidly, you hear 1 sound, not 10!
# Install
curl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/install.sh | bash
# Update
curl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/update.sh | bash
# Uninstall (leaves no trace)
curl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/uninstall.sh | bash
# Test audio
curl -fsSL https://raw.githubusercontent.com/IFAKA/oc-notify/master/scripts/test-audio.sh | bashPlugin: ~/.config/opencode/plugin/audio-notify.js
Config: ~/.config/opencode/opencode.json (optional)
Disable completion sounds:
{ "audio_notifications": { "completion": { "enabled": false } } }Use only terminal bell:
{ "audio_notifications": { "permission": { "method": "bell" }, "completion": { "method": "bell" } } }Longer cooldowns:
{ "audio_notifications": { "permission": { "cooldown": 10 }, "completion": { "cooldown": 20 } } }Bug? Open an issue
Idea? Request a feature
Code? Fork, change, PR - See docs/DEVELOPMENT.md
MIT License - See LICENSE
Created by @IFAKA
Inspired by the need to multitask while OpenCode works! β¨
If this helps you, give it a star! β It helps others discover it.
Made with π for the OpenCode community
Documentation β’ Issues