Get native Windows notifications when using OpenCode inside WSL (Windows Subsystem for Linux).
This plugin bridges the gap between Linux and Windows by triggering Windows toast notifications via powershell.exe.
-
🔔 Native Windows toast notifications
-
🐧 Works seamlessly with WSL-based OpenCode
-
⚡ Alerts for:
- Session completed
- Session errors
- Permission/input requests
-
🔊 Custom sound support (WAV / MP3)
-
🧠 Lightweight and easy to configure
OpenCode runs inside WSL (Linux), which cannot directly trigger Windows notifications.
This plugin solves that by:
- Calling
powershell.exefrom WSL - Using the BurntToast PowerShell module
- Displaying native Windows notifications
Open PowerShell as Administrator and run:
Install-Module BurntToast -Force
Test installation:
New-BurntToastNotification -Text "OpenCode", "Test notification"
Run in WSL:
mkdir -p ~/.config/opencode/plugins
import notification from "./plugins/notification.js"
export default {
plugins: [notification],
}export const NotificationPlugin = async ({ $ }) => {
const notify = async (message) => {
await $`powershell.exe -NoProfile -Command "
Import-Module BurntToast;
New-BurntToastNotification -Text 'OpenCode', '${message}'
"`
}
const beep = async () => {
await $`powershell.exe -NoProfile -Command "
(New-Object Media.SoundPlayer 'C:\\Users\\YourName\\Music\\faaaah.wav').PlaySync()
"`
}
return {
event: async ({ event }) => {
if (event.type === "session.idle") {
await notify("Session completed!")
await beep()
}
if (event.type === "session.error") {
await notify("Session error!")
await beep()
}
if (event.type === "permission.asked") {
await notify("Waiting for input")
}
},
}
}Close and reopen OpenCode after adding the plugin.
To use your own sound:
-
Place a
.wavfile somewhere on Windows:C:\Users\YourName\Music\faaaah.wav -
Update the path in
notification.js
⚠️ Note:.wavis recommended for best compatibility
~/.config/opencode
├── index.js
└── plugins
└── notification.js
- Run OpenCode inside WSL
- Ask it to perform a task
- Switch tabs or continue working
- Receive a Windows notification when done
WSL applications cannot directly trigger Windows notifications.
This plugin provides a simple and effective workaround using PowerShell bridging.
- 📊 Show task summary in notification
- ⏱ Display execution time
- 🔕 Notification cooldown (prevent spam)
- 🎯 Per-project customization
Feel free to open issues or submit PRs to improve this plugin!
If this helped you, consider starring the repo ⭐

