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的絕對路徑(不要依賴當前工作目錄 cwd)。 -
使用 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(
-
顯示安裝程式的 stdout。
-
提醒使用者重新啟動其代理會話。