@jack-yang/opencode-bark-notifyFocus-aware Bark push notifications for OpenCode — get detailed agent messages on your phone when you step away
0
418
6 in 7 days
35.3
Multi-signal model
21 days ago
2026-07-29
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": ["@jack-yang/opencode-bark-notify@1.0.2"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@jack-yang/opencode-bark-notify@1.0.2"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @jack-yang/opencode-bark-notifyopencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
Focus-aware Bark push notifications for OpenCode.
Get detailed agent messages on your iPhone when you step away from your computer. When you're at the terminal, notifications are suppressed — no spam.
Features
- Focus-aware — Suppresses notifications when your terminal is the frontmost app
- Detailed content — Sends the agent's actual last message, not just "task completed"
- Category badges — iOS subtitle shows what happened: ✅ Responded / 🔐 Wait for Permission / ❓ Input Needed
- Session-aware — Includes the session title in every notification
- Zero dependencies — Pure TypeScript, runs on Bun
Prerequisites
- Bark app installed on iOS
- Your Bark device key (found in the Bark app homepage, e.g.
BrHXXCACzphzrB63kNJMFF)
Install
Option 1: With config (recommended)
Add to your ~/.config/opencode/opencode.json:
{
"plugin": [
["@jack-yang/opencode-bark-notify", {
"barkKey": "YOUR_BARK_DEVICE_KEY"
}]
]
}
Option 2: With env var
Add to your ~/.zshrc:
export BARK_KEY="YOUR_BARK_DEVICE_KEY"
Then in opencode.json:
{
"plugin": ["@jack-yang/opencode-bark-notify"]
}
Restart OpenCode.
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
barkKey |
string | (env: BARK_KEY) |
Bark device key (required) |
barkUrl |
string | https://api.day.app |
Bark server URL (for self-hosted) |
level |
string | timeSensitive |
iOS notification level |
group |
string | opencode |
iOS notification group |
terminals |
string[] | ["Ghostty", "Terminal", "iTerm2", ...] |
Terminal app names for focus detection |
Example with all options
{
"plugin": [
["@jack-yang/opencode-bark-notify", {
"barkKey": "YOUR_KEY",
"barkUrl": "https://your-bark-server.com",
"level": "active",
"group": "my-agent",
"terminals": ["Ghostty", "WezTerm"]
}]
]
}
How focus detection works
On macOS, the plugin uses osascript to check if a terminal app is the frontmost application. If it is, notifications are suppressed — you're already looking at the terminal. If you've switched to another app or stepped away, notifications fire.
On non-macOS, focus detection is disabled (notifications always fire).
Notification types
| Event | Badge | Body |
|---|---|---|
| Session complete | ✅ Responded | Agent's last message (up to 500 chars) |
| Permission request | 🔐 Wait for Permission | Permission type + patterns |
| Question | ❓ Input Needed | The question text |
Pairing with desktop notifications
This plugin complements @mohak34/opencode-notifier (desktop notifications). Use both together:
- Desktop (osascript/sound/bell) → when at computer but in another app
- Bark (iPhone push) → when away from computer entirely
Both independently check focus, so there's no conflict.
License
MIT