@decade-qzj/opencode-message-notify
v0.1.2
Published
OpenCode plugin that sends detailed Agent messages and usage statistics to iOS via Bark app
Maintainers
Readme
opencode-message-notify
OpenCode plugin that sends detailed Agent messages and usage statistics to your iOS device via the Bark app.
Features
- Real-time iOS notifications via Bark app - get notified anywhere
- Detailed Agent message content - see exactly what your Agent is telling you, not just "task completed"
- Usage statistics tracking - monitor cost, tokens, and cache usage
- Permission request notifications - never miss a permission prompt
- Zero dependencies - lightweight and fast
Installation
Add the plugin to your opencode.json or opencode.jsonc:
{
"plugin": ["@decade-qzj/opencode-message-notify@latest"]
}Using @latest ensures you always get the newest version when the cache is refreshed.
To pin a specific version:
{
"plugin": ["@decade-qzj/[email protected]"]
}Restart OpenCode. The plugin will be automatically installed and loaded.
Updating
OpenCode caches plugins in ~/.cache/opencode. Plugins are not auto-updated; you need to clear the cache to get new versions.
If you use @latest
Clear the cache and restart OpenCode:
Linux/macOS:
rm -rf ~/.cache/opencode/node_modules/@decade-qzj/opencode-message-notifyWindows (PowerShell):
Remove-Item -Recurse -Force "$env:USERPROFILE\.cache\opencode\node_modules\@decade-qzj\opencode-message-notify"Then restart OpenCode - it will download the latest version automatically.
If you use a pinned version (e.g., @0.1.0)
Update the version in your
opencode.json:{ "plugin": ["@decade-qzj/[email protected]"] }Clear the cache (see commands above)
Restart OpenCode
Check installed version
Linux/macOS:
cat ~/.cache/opencode/node_modules/@decade-qzj/opencode-message-notify/package.json | grep versionWindows (PowerShell):
Get-Content "$env:USERPROFILE\.cache\opencode\node_modules\@decade-qzj\opencode-message-notify\package.json" | Select-String "version"Setup Bark App
- Download Bark from the App Store
- Register for a free account
- Copy your device token from the app
- Configure the plugin (see below)
Configuration
Environment Variable (Recommended)
Set the DAY_APP_TOKEN environment variable in your shell profile:
# Add to your ~/.zshrc or ~/.bashrc
export DAY_APP_TOKEN="your_bark_device_token"Config File
Create ~/.config/opencode/opencode-notify.json:
{
"token": "your_bark_device_token",
"title": "OpenCode",
"notifyOnComplete": true,
"notifyOnPermission": true,
"includeUsageStats": true,
"includeMessageContent": true
}Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| token | string | (env) | Bark device token |
| title | string | "OpenCode" | Notification title prefix |
| notifyOnComplete | boolean | true | Send notification on session completion |
| notifyOnPermission | boolean | true | Send notification for permission requests |
| includeUsageStats | boolean | true | Include cost and token statistics |
| includeMessageContent | boolean | true | Include Agent's actual message content |
How It Works
Message Content
Unlike other plugins that just notify "task completed", this plugin captures and sends the actual Agent message content. You'll see:
- What the Agent was working on
- The final result or summary
- Any important notes or next steps
Usage Statistics
The plugin tracks and reports:
- Cost - API cost in USD
- Tokens - Input, Output, Reasoning breakdown
- Cache - Cache Read/Write statistics
Example notification:
I've analyzed the codebase and found 3 potential areas for optimization:
💰 Cost: 0.0235
🧮 Tokens
- Input: 15,420
- Output: 3,280
- Reasoning: 8,150
💾 Cache
- Read: 2,100
- Write: 450Platform Notes
This plugin works on all platforms that OpenCode supports:
- macOS - No additional setup required
- Linux - No additional setup required
- Windows - No additional setup required
The only requirement is having the Bark app configured on your iOS device.
Troubleshooting
Notifications not appearing on iOS
- Verify your Bark token - Make sure it's correct in your config
- Check Bark app - Test with a manual notification in the Bark app
- Clear the cache - Remove the plugin from cache and restart OpenCode
Testing the plugin
Send a test notification manually using curl:
curl "https://api.day.app/YOUR_TOKEN/Test/Hello%20World"Plugin not loading
- Check your
opencode.jsonsyntax - Verify the plugin name is correct
- Clear the cache and restart OpenCode
Development
Building
npm run buildType checking
npm run typecheckLicense
MIT
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Support
If you have any questions or issues, please open a GitHub issue.
