opencode-ntfy-smartOpenCode plugin that sends ntfy.sh notifications with smart main/subagent filtering
0
20
近 7 天 2
22.3
生态多维模型
3 个月前
2026-04-30
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-ntfy-smart@0.1.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-ntfy-smart@0.1.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-ntfy-smartopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
opencode-ntfy-smart is a standalone OpenCode plugin that sends ntfy.sh push notifications with smart filtering for main sessions and subagents.
It keeps the four supported notification events while reducing subagent noise:
| Event | Main session | Subagent |
|---|---|---|
session.idle |
notify | suppress |
session.error |
notify | suppress |
permission.asked |
notify | notify |
question.asked |
notify | notify |
Install
When you use OpenCode as a global app, you do not need to run npm install manually for the plugin. OpenCode can install npm plugins automatically from ~/.config/opencode/opencode.json and cache them under ~/.cache/opencode/.
Agentic
Give your agent a prompt like this:
Update my OpenCode config to use `opencode-ntfy-smart` as a plugin. If `opencode-ntfy.sh` is present, replace it. Keep my other plugins unchanged, and create or update `~/.config/opencode/notification-ntfy-smart.json` with my ntfy.sh topic/server settings.
Manual
- Edit
~/.config/opencode/opencode.jsonand addopencode-ntfy-smartto thepluginarray. If you are migrating fromopencode-ntfy.sh, replace it.
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-ntfy-smart"]
}
- Create
~/.config/opencode/notification-ntfy-smart.jsonusing the configuration example below.
Local Development
npm install
npm run build
Use the local OpenCode plugin build at /root/code/opencode-ntfy-smart/dist/index.js.
Example OpenCode plugin configuration:
{
"plugin": [
"/root/code/opencode-ntfy-smart/dist/index.js"
]
}
Configuration
Create the config file at ~/.config/opencode/notification-ntfy-smart.json.
{
"$schema": "https://raw.githubusercontent.com/antctt/opencode-ntfy-smart/main/notification-ntfy-smart.schema.json",
"enabled": true,
"events": {
"session.idle": { "enabled": true },
"session.error": { "enabled": true },
"permission.asked": { "enabled": true },
"question.asked": { "enabled": true }
},
"backend": {
"topic": "opencode-example-topic",
"server": "https://ntfy.sh",
"priority": "default",
"fetchTimeout": "PT10S",
"title": {
"session.idle": { "value": "{project}: opencode finished" },
"session.error": { "value": "{project}: opencode error" },
"permission.asked": { "value": "{project}: permission needed" },
"question.asked": { "value": "{project}: response needed" }
},
"message": {
"session.idle": { "value": "The agent finished and is waiting for input." },
"session.error": { "value": "{error}" },
"permission.asked": { "value": "Permission requested: {permission_type} {permission_patterns}" },
"question.asked": { "value": "{question}" }
}
}
}
Publish
npm pack
npm publish