agent-notify 是做什么的?
为主机编码智能体在完成一回合操作时添加桌面通知。具有幂等性——可安全重复运行。
安装内容
脚本复制到 ~/.agent-notify/:
notify.sh— 统一的通知器(自动检测 argv[1] 与 stdin)notify-turn-start.sh— 供基于钩子的智能体记录回合开始时间notify-wrap.sh— 通用 CLI 包装器,适用于无钩子的智能体opencode-plugin.ts— OpenCode TS 插件
补丁的配置文件(仅当对应 home 目录存在时):
~/.codex/config.toml→notify = [".../notify.sh"]~/.codex/hooks.json→PermissionRequest+UserPromptSubmit~/.claude/settings.json→Stop+UserPromptSubmit+Notification钩子~/.cursor/hooks.json→stop+beforeSubmitPrompt钩子~/.qoder/settings.json→Stop+UserPromptSubmit+Notification钩子~/.kimi/config.toml→[[hooks]]条目~/.config/opencode/plugins/→ 放置agent-notify.ts
参见 reference/agent-hooks.md 获取上游文档和能力总结。
如何运行
bash <skill-dir>/assets/install.sh
标志:--target codex|claude|cursor|qoder|kimi|opencode,--uninstall
可选:AGENT_NOTIFY_HOME=/path/to/home 强制为哪个配置文件接收配置(在 WSL 下有用)。
智能体执行步骤
调用时:
-
解析此技能
assets/install.sh的绝对路径(不要依赖当前工作目录)。 -
使用 bash 运行它,并传递用户标志(
--uninstall、--target等):- macOS / Linux:
bash <abs>/assets/install.sh - Windows(推荐):Git Bash
"C:\Program Files\Git\bin\bash.exe" "<abs>\assets\install.sh" - Windows + WSL(备选):将
-c参数用单引号括起来,将HOME指向 Windows 配置文件,通过路径运行:wsl -e bash -lc 'export HOME=/mnt/c/Users/<you>; bash /mnt/c/Users/<you>/.agents/skills/agent-notify/assets/install.sh'
- macOS / Linux:
-
硬性规则(Windows 智能体):
- 不要将脚本通过管道传递给 bash(
sed … | bash、cat … | bash)——$0会失效且资产丢失。 - 不要在 PowerShell 双引号
wsl … -c "…"字符串中使用$(…)—— PowerShell 会展开它们并在项目当前工作目录中创建垃圾文件。 - 优先使用 Git Bash,而不是自创 WSL+PowerShell 引用绕行方案。
- 不要将脚本通过管道传递给 bash(
-
显示安装器标准输出。
-
提醒用户重启其智能体会话。