@xwss/agentbell 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/README.md +183 -818
- package/RELEASE.md +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/verify.d.ts +2 -1
- package/dist/commands/verify.js +37 -30
- package/dist/commands/verify.js.map +1 -1
- package/dist/utils/paths.d.ts +1 -0
- package/dist/utils/paths.js +16 -9
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/version.d.ts +1 -0
- package/dist/utils/version.js +30 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,969 +1,334 @@
|
|
|
1
1
|
# AgentBell
|
|
2
2
|
|
|
3
|
-
AgentBell
|
|
3
|
+
AgentBell notifies your phone when AI coding agents finish a task.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
缁楊兛绔撮悧鍫滅喘閸忓牊鏁幐?ntfy閵嗗倸褰傞柅浣侯伂閸欘亪娓剁憰浣藉厴鐠佸潡妫舵径鏍秹楠炶泛褰傞崙?HTTP 鐠囬攱鐪伴敍宀勨偓鍌氭値閺堫剙婀撮悽浣冨壋閵嗕浇绻欑粙?SSH閵嗕箘SL閵嗕笍ev Container閵嗕浇绻欓幒褏鏁搁懘鎴犵搼閸︾儤娅欓妴?
|
|
7
|
-
## Why Not Bluetooth
|
|
5
|
+
It is a small CLI for developers who run long AI coding tasks and want a reliable phone notification when the agent stops, asks for attention, or finishes a workflow. It currently uses ntfy for Android push notifications and installs hook wrappers for Codex, Claude Code, and VS Code Copilot Agent.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
閹恒劏宕橀柧鎹愮熅閺勵垽绱?
|
|
11
|
-
1. AI coding hook 閸︺劌鐤勯梽鍛扮箥鐞?agent 閻ㄥ嫭婧€閸c劋绗傞幍褑顢戦妴?2. AgentBell 闁俺绻?HTTP 閹跺﹪鈧氨鐓¢崣鎴濆煂 ntfy閵?3. 鐎瑰宕滈幍瀣簚閺€璺哄煂 ntfy 闁氨鐓¢妴?4. 缁崵绮洪崪灞惧閻?App 鐠愮喕鐭楅幎濠団偓姘辩叀鏉烆剙褰傞崚鐗堝閻滎垬鈧?
|
|
12
|
-
鏉╂瑦鐗辨潻婊呪柤閺堝搫娅掗崣顏囶洣閸欘垯浜掔拋鍧楁6 ntfy server閿涘苯姘ㄩ懗鑺ュ絹闁辨帊缍橀惃鍕閺堟亽鈧?
|
|
13
|
-
## Android Setup
|
|
7
|
+
Core features:
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
- Phone notifications for AI coding workflows
|
|
10
|
+
- ntfy Android support
|
|
11
|
+
- `agentbell setup` first-run wizard
|
|
12
|
+
- `agentbell verify` installation and hook diagnostics
|
|
13
|
+
- Codex VS Code extension Stop hook
|
|
14
|
+
- Claude Code Stop and Notification hooks
|
|
15
|
+
- VS Code Copilot Agent Stop hook
|
|
16
|
+
- Rich notification context: machine name, project name, task name, path, branch, and time
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
## Installation
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
21
|
npm install -g @xwss/agentbell
|
|
23
|
-
agentbell setup
|
|
24
22
|
```
|
|
25
23
|
|
|
26
|
-
Although the npm package is scoped as `@xwss/agentbell`, the installed CLI command is still
|
|
27
|
-
|
|
28
|
-
For beta builds:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install -g @xwss/agentbell@beta
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
AgentBell requires Node.js 20 or newer.
|
|
35
|
-
|
|
36
|
-
## Development Install
|
|
37
|
-
|
|
38
|
-
For local development:
|
|
24
|
+
Although the npm package is scoped as `@xwss/agentbell`, the installed CLI command is still:
|
|
39
25
|
|
|
40
26
|
```bash
|
|
41
|
-
|
|
42
|
-
cd AgentBell
|
|
43
|
-
npm install
|
|
44
|
-
npm run build
|
|
45
|
-
node dist/cli.js setup
|
|
27
|
+
agentbell
|
|
46
28
|
```
|
|
47
29
|
|
|
48
|
-
|
|
30
|
+
AgentBell requires Node.js 20 or newer.
|
|
49
31
|
|
|
50
|
-
|
|
32
|
+
For beta builds:
|
|
51
33
|
|
|
52
34
|
```bash
|
|
53
|
-
npm
|
|
54
|
-
npm pack
|
|
55
|
-
npm install -g ./xwss-agentbell-0.1.0.tgz
|
|
56
|
-
agentbell --help
|
|
57
|
-
agentbell setup --dry-run --yes --targets none --no-test
|
|
35
|
+
npm install -g @xwss/agentbell@beta
|
|
58
36
|
```
|
|
59
37
|
|
|
60
|
-
## Uninstall
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
npm uninstall -g @xwss/agentbell
|
|
64
|
-
```
|
|
65
38
|
## Quick Start
|
|
66
39
|
|
|
67
|
-
|
|
68
|
-
npm install -g @xwss/agentbell
|
|
69
|
-
agentbell setup
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
閺堫剙婀村鈧崣鎴g箥鐞涘矉绱?
|
|
73
|
-
```bash
|
|
74
|
-
npm install
|
|
75
|
-
npm run build
|
|
76
|
-
npm test
|
|
77
|
-
npm run dev -- test
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Setup Wizard
|
|
81
|
-
|
|
82
|
-
`agentbell setup` is the recommended first command on a new machine. It is a guided setup flow that:
|
|
83
|
-
|
|
84
|
-
- generates a random ntfy topic
|
|
85
|
-
- writes `~/.agentbell/config.json`
|
|
86
|
-
- asks for a machine display name
|
|
87
|
-
- guides Android ntfy subscription
|
|
88
|
-
- sends a setup test notification
|
|
89
|
-
- installs selected AI coding hooks
|
|
90
|
-
|
|
91
|
-
Examples:
|
|
40
|
+
Run the setup wizard:
|
|
92
41
|
|
|
93
42
|
```bash
|
|
94
43
|
agentbell setup
|
|
95
|
-
agentbell setup --yes --targets none --no-test
|
|
96
|
-
agentbell setup --targets codex,claude-code
|
|
97
|
-
agentbell setup --dry-run
|
|
98
44
|
```
|
|
99
45
|
|
|
100
|
-
|
|
46
|
+
The wizard will:
|
|
101
47
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
- `--yes` uses defaults for prompts.
|
|
108
|
-
- `--no-test` skips the phone test notification.
|
|
109
|
-
- `--dry-run` previews setup without writing files, sending notifications, or installing hooks.
|
|
48
|
+
- Generate a random ntfy topic
|
|
49
|
+
- Write `~/.agentbell/config.json`
|
|
50
|
+
- Guide Android ntfy subscription
|
|
51
|
+
- Send a test notification
|
|
52
|
+
- Install AI coding hooks
|
|
110
53
|
|
|
111
|
-
##
|
|
54
|
+
## Android ntfy Setup
|
|
112
55
|
|
|
113
|
-
|
|
56
|
+
During `agentbell setup`, AgentBell generates a long random ntfy topic. Subscribe to that topic on your Android phone:
|
|
114
57
|
|
|
115
|
-
|
|
58
|
+
1. Install ntfy Android.
|
|
59
|
+
2. Open ntfy and subscribe to the generated topic.
|
|
60
|
+
3. Allow notification permission.
|
|
61
|
+
4. Allow background running if your phone prompts for it.
|
|
62
|
+
5. Disable battery optimization for ntfy if notifications are delayed.
|
|
116
63
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
```text
|
|
120
|
-
宸ヤ綔绔?鍙?路 Codex task finished
|
|
121
|
-
```
|
|
64
|
+
The topic is a secret transport address. Do not publish it, commit it, or share it in logs.
|
|
122
65
|
|
|
123
|
-
##
|
|
66
|
+
## Tool Compatibility Matrix
|
|
124
67
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
agentbell
|
|
129
|
-
agentbell
|
|
130
|
-
agentbell init-hooks --target codex
|
|
131
|
-
agentbell init-hooks --target claude-code
|
|
132
|
-
agentbell init-hooks --target vscode-agent
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Use manual setup when you want to provide your own topic, skip the guided Android flow, or install hooks one tool at a time.
|
|
136
|
-
## Commands
|
|
137
|
-
|
|
138
|
-
### `agentbell send`
|
|
139
|
-
|
|
140
|
-
閻劋绨悮?hook 鐠嬪啰鏁ら敍灞藉絺闁椒绔村▎锟犫偓姘辩叀閵?
|
|
141
|
-
```bash
|
|
142
|
-
agentbell send --tool codex --event stop --title "Codex 鐎瑰本鍨氭禍? --message "鏉╂粎鈻奸張鍝勬珤娑撳﹦娈?Codex 瀹歌尙绮ㄩ弶鐔告拱鏉烆喕鎹㈤崝?
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
鐢摜鏁ら崣鍌涙殶閿?
|
|
146
|
-
- `--tool`: `claude-code`閵嗕梗codex`閵嗕梗vscode-agent`閵嗕梗custom`
|
|
147
|
-
- `--event`: `stop`閵嗕梗notification`閵嗕梗error`閵嗕梗permission`閵嗕梗custom`
|
|
148
|
-
- `--title`: 闁氨鐓¢弽鍥暯閿涘苯褰查柅?- `--message`: 闁氨鐓¢崘鍛啇閿涘苯褰查柅?- `--priority`: ntfy priority閿涘苯褰查柅?- `--tags`: ntfy tags閿涘矂鈧褰块崚鍡涙閿涘苯褰查柅?- `--config`: 閹稿洤鐣鹃柊宥囩枂閺傚洣娆㈢捄顖氱窞閿涘苯褰查柅?
|
|
149
|
-
婵″倹鐏夋稉宥勭炊 `title` 閹?`message`閿涘瓑gentBell 娴兼俺鍤滈崝銊ф晸閹存劙绮拋銈呭敶鐎圭櫢绱濋獮鑸电壌閹诡噣鍘ょ純顔煎瘶閸?`tool`閵嗕梗event`閵嗕梗hostname`閵嗕梗cwd`閵嗕梗timestamp`閵?
|
|
150
|
-
### `agentbell test`
|
|
151
|
-
|
|
152
|
-
閸欐垿鈧焦绁寸拠鏇⑩偓姘辩叀閿?
|
|
153
|
-
```bash
|
|
154
|
-
agentbell test
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
閺嶅洭顣介敍姝欰gentBell 濞村鐦痐
|
|
158
|
-
|
|
159
|
-
閸愬懎顔愰敍姝氭俊鍌涚亯娴g姷婀呴崚棰佺啊鏉╂瑦娼柅姘辩叀閿涘矁顕╅弰?AgentBell 瀹歌尙绮¢柊宥囩枂閹存劕濮涢妴淇?
|
|
160
|
-
### `agentbell verify`
|
|
161
|
-
|
|
162
|
-
Checks whether AgentBell is still installed correctly: config, provider settings, hook files, wrapper files, recent wrapper logs, stale paths, and optional manual notification / wrapper execution.
|
|
68
|
+
| Tool | Surface | Hook type | Config location | Wrapper location | Status | Notes |
|
|
69
|
+
|---|---|---|---|---|---|---|
|
|
70
|
+
| Codex | VS Code extension | Stop | `~/.codex/hooks.json` | `~/.agentbell/hooks/codex-stop.cmd` | Verified on Windows | User-level hook, usually works across projects |
|
|
71
|
+
| Claude Code | CLI / VS Code terminal mode | Stop / Notification | `~/.claude/settings.json` | `<project>/.agentbell-hooks/*.sh` | Stop verified, Notification prepared | Windows requires Git Bash for `.sh` wrapper |
|
|
72
|
+
| VS Code Copilot Agent | VS Code Agent mode | Stop | `<project>/.github/hooks/agentbell.json` | `<project>/.agentbell-hooks/copilot-stop.cmd` | Verified on Windows | Project-level hook; VS Code Agent hooks are Preview |
|
|
163
73
|
|
|
164
|
-
|
|
74
|
+
## Important Differences Between Tools
|
|
165
75
|
|
|
166
|
-
|
|
167
|
-
- You moved the project directory.
|
|
168
|
-
- You renamed or moved the project and suspect stale old-project paths.
|
|
169
|
-
- You deleted or regenerated wrapper files.
|
|
170
|
-
- You reinstalled Node.js.
|
|
171
|
-
- You updated Codex, Claude Code, or VS Code.
|
|
172
|
-
- Hooks were trusted but still do not send notifications.
|
|
76
|
+
Codex:
|
|
173
77
|
|
|
174
|
-
|
|
78
|
+
- Uses a user-level hook.
|
|
79
|
+
- After setup, it usually works across projects.
|
|
80
|
+
- You do not usually need to run `init-hooks` in every project.
|
|
81
|
+
- To refresh the wrapper, run:
|
|
175
82
|
|
|
176
83
|
```bash
|
|
177
|
-
agentbell
|
|
178
|
-
agentbell verify --target codex
|
|
179
|
-
agentbell verify --target vscode-agent --run-wrapper
|
|
180
|
-
agentbell verify --send-test
|
|
181
|
-
agentbell verify --json > agentbell-verify.json
|
|
84
|
+
agentbell init-hooks --target codex
|
|
182
85
|
```
|
|
183
86
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
- `--target <target>` checks `codex`, `claude-code`, `vscode-agent`, or `all`.
|
|
187
|
-
- `--send-test` sends an `AgentBell verify test` phone notification.
|
|
188
|
-
- `--run-wrapper` manually runs the selected wrapper command to verify it can call AgentBell.
|
|
189
|
-
- `--dry-run` only inspects files and config; it does not send notifications or run wrappers.
|
|
190
|
-
- `--json` prints a structured report with masked topic values.
|
|
191
|
-
Log parsing note:
|
|
192
|
-
|
|
193
|
-
`verify` evaluates the latest hook run block, not every historical line in the log. Old failures are ignored once a newer successful wrapper run is recorded.
|
|
87
|
+
Claude Code:
|
|
194
88
|
|
|
195
|
-
|
|
196
|
-
|
|
89
|
+
- Uses `~/.claude/settings.json`.
|
|
90
|
+
- On Windows, AgentBell uses Git Bash to run project-local `.sh` wrappers.
|
|
91
|
+
- If `agentbell verify --run-wrapper` cannot find bash, set:
|
|
197
92
|
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
### `agentbell doctor`
|
|
202
|
-
|
|
203
|
-
鏉堟挸鍤悳顖氼暔鐠囧﹥鏌囨穱鈩冧紖閿涘矂鈧倸鎮庢径宥呭煑缂佹瑥鍩嗘禍鐑樺笓閺屻儻绱?
|
|
204
|
-
```bash
|
|
205
|
-
agentbell doctor
|
|
93
|
+
```cmd
|
|
94
|
+
set AGENTBELL_BASH_PATH=C:\Path\To\bash.exe
|
|
206
95
|
```
|
|
207
96
|
|
|
208
|
-
|
|
209
|
-
### `agentbell init`
|
|
97
|
+
VS Code Copilot Agent:
|
|
210
98
|
|
|
211
|
-
|
|
99
|
+
- Uses a project-level hook file.
|
|
100
|
+
- Each project needs `<project>/.github/hooks/agentbell.json`.
|
|
101
|
+
- Run this inside each project where you want Copilot Agent notifications:
|
|
212
102
|
|
|
213
103
|
```bash
|
|
214
|
-
agentbell init
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
姒涙顓婚崘娆忓弳閿?
|
|
218
|
-
```text
|
|
219
|
-
~/.agentbell/config.json
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
闁板秶鐤嗙粈杞扮伐閿?
|
|
223
|
-
```json
|
|
224
|
-
{
|
|
225
|
-
"provider": "ntfy",
|
|
226
|
-
"ntfy": {
|
|
227
|
-
"server": "https://ntfy.sh",
|
|
228
|
-
"topic": "your-long-random-topic",
|
|
229
|
-
"priority": "high",
|
|
230
|
-
"tags": ["computer"]
|
|
231
|
-
},
|
|
232
|
-
"localNotification": {
|
|
233
|
-
"enabled": true
|
|
234
|
-
},
|
|
235
|
-
"includeContext": {
|
|
236
|
-
"hostname": true,
|
|
237
|
-
"cwd": true,
|
|
238
|
-
"timestamp": true
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
閸?macOS/Linux 娑撳绱濋柊宥囩枂閺傚洣娆㈡导姘晼闁插繗顔曠純顔昏礋 `600` 閺夊啴妾洪妴淇塱ndows 娑撳﹣绱扮捄瀹犵箖 POSIX 閺夊啴妾虹拋鍓х枂閵?
|
|
244
|
-
### `agentbell init-hooks`
|
|
245
|
-
|
|
246
|
-
閻㈢喐鍨?hook 闁板秶鐤嗗Ο鈩冩緲閿?
|
|
247
|
-
```bash
|
|
248
|
-
agentbell init-hooks --target claude-code
|
|
249
|
-
agentbell init-hooks --target codex
|
|
250
104
|
agentbell init-hooks --target vscode-agent
|
|
251
|
-
agentbell init-hooks --target all
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
AgentBell 娑撳秳绱扮划妤佹瘹鐟曞棛娲婂鍙夋箒闁板秶鐤嗛妴鍌氬嚒閺?JSON 閺傚洣娆㈡导姘帥婢跺洣鍞ゆ稉?`.bak-閺冨爼妫块幋鐮㈤敍宀€鍔ч崥搴℃晼闁插繐浠?JSON merge閵嗗倸顩ч弸婊冨嚒閺堝鏋冩禒鏈电瑝閺勵垰鎮庡▔?JSON閿涘奔绱伴悽鐔稿灇 snippet 閺傚洣娆㈤獮鑸靛絹缁€杞版眽瀹搞儱鎮庨獮韬测偓?
|
|
255
|
-
Preview hook changes without writing files:
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
agentbell init-hooks --target codex --dry-run
|
|
259
|
-
agentbell init-hooks --target all --dry-run
|
|
260
105
|
```
|
|
261
106
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
## Claude Code Example
|
|
265
|
-
|
|
266
|
-
閻╊喗鐖i弬鍥︽閿?
|
|
267
|
-
```text
|
|
268
|
-
~/.claude/settings.json
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
閻╊喗鐖i弫鍫熺亯閿?
|
|
272
|
-
```json
|
|
273
|
-
{
|
|
274
|
-
"hooks": {
|
|
275
|
-
"Stop": [
|
|
276
|
-
{
|
|
277
|
-
"matcher": "",
|
|
278
|
-
"hooks": [
|
|
279
|
-
{
|
|
280
|
-
"type": "command",
|
|
281
|
-
"command": "agentbell send --tool claude-code --event stop"
|
|
282
|
-
}
|
|
283
|
-
]
|
|
284
|
-
}
|
|
285
|
-
],
|
|
286
|
-
"Notification": [
|
|
287
|
-
{
|
|
288
|
-
"matcher": "",
|
|
289
|
-
"hooks": [
|
|
290
|
-
{
|
|
291
|
-
"type": "command",
|
|
292
|
-
"command": "agentbell send --tool claude-code --event notification"
|
|
293
|
-
}
|
|
294
|
-
]
|
|
295
|
-
}
|
|
296
|
-
]
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
```
|
|
107
|
+
## Rich Notification Context
|
|
300
108
|
|
|
301
|
-
|
|
109
|
+
AgentBell can generate notifications such as:
|
|
302
110
|
|
|
303
|
-
閻╊喗鐖i弬鍥︽閿?
|
|
304
111
|
```text
|
|
305
|
-
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
閻╊喗鐖i弫鍫熺亯閿?
|
|
309
|
-
```json
|
|
310
|
-
{
|
|
311
|
-
"hooks": {
|
|
312
|
-
"stop": [
|
|
313
|
-
{
|
|
314
|
-
"command": "agentbell send --tool codex --event stop"
|
|
315
|
-
}
|
|
316
|
-
]
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
```
|
|
112
|
+
Workstation-01 · Codex audit task finished
|
|
320
113
|
|
|
321
|
-
AgentBell
|
|
322
|
-
|
|
323
|
-
|
|
114
|
+
Project: AgentBell
|
|
115
|
+
Path: G:\learning\AgentBell
|
|
116
|
+
Branch: main
|
|
117
|
+
Event: stop
|
|
118
|
+
Time: 2026-05-23 22:45
|
|
324
119
|
```
|
|
325
120
|
|
|
326
|
-
|
|
327
|
-
### Codex Windows Wrapper
|
|
328
|
-
|
|
329
|
-
On Windows, AgentBell writes a `.cmd` wrapper and points Codex to that wrapper instead of embedding a long `node.exe ... cli.js ...` command directly in `hooks.json`.
|
|
330
|
-
|
|
331
|
-
Target files:
|
|
121
|
+
Project name priority:
|
|
332
122
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
```
|
|
123
|
+
1. CLI `--project`
|
|
124
|
+
2. `.agentbell.json` `projectName`
|
|
125
|
+
3. `package.json` `name`
|
|
126
|
+
4. Current folder name
|
|
338
127
|
|
|
339
|
-
|
|
128
|
+
If you are happy with the folder name, you do not need `.agentbell.json`.
|
|
340
129
|
|
|
341
|
-
|
|
342
|
-
{
|
|
343
|
-
"hooks": {
|
|
344
|
-
"Stop": [
|
|
345
|
-
{
|
|
346
|
-
"hooks": [
|
|
347
|
-
{
|
|
348
|
-
"type": "command",
|
|
349
|
-
"commandWindows": "cmd /d /s /c \"C:\\Users\\<user>\\.agentbell\\hooks\\codex-stop.cmd\"",
|
|
350
|
-
"command": "cmd /d /s /c \"C:\\Users\\<user>\\.agentbell\\hooks\\codex-stop.cmd\"",
|
|
351
|
-
"timeout": 30,
|
|
352
|
-
"statusMessage": "Sending AgentBell notification"
|
|
353
|
-
}
|
|
354
|
-
]
|
|
355
|
-
}
|
|
356
|
-
]
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
```
|
|
130
|
+
To customize project context:
|
|
360
131
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
```text
|
|
364
|
-
~/.agentbell/codex-hook-fired.log
|
|
132
|
+
```bash
|
|
133
|
+
agentbell project init --name MyProject --task "AI coding task"
|
|
365
134
|
```
|
|
366
135
|
|
|
367
|
-
|
|
136
|
+
Example `.agentbell.json`:
|
|
368
137
|
|
|
369
|
-
## VS Code Agent Example
|
|
370
|
-
|
|
371
|
-
閻╊喗鐖i弬鍥︽閺勵垰浼愭担婊冨隘缁狙囧帳缂冾噯绱?
|
|
372
|
-
```text
|
|
373
|
-
.github/hooks/agentbell.json
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
閻╊喗鐖i弫鍫熺亯閿?
|
|
377
138
|
```json
|
|
378
139
|
{
|
|
379
|
-
"
|
|
380
|
-
"
|
|
381
|
-
"hooks": {
|
|
382
|
-
"stop": [
|
|
383
|
-
{
|
|
384
|
-
"command": "agentbell send --tool vscode-agent --event stop"
|
|
385
|
-
}
|
|
386
|
-
]
|
|
387
|
-
}
|
|
140
|
+
"projectName": "MyProject",
|
|
141
|
+
"defaultTaskName": "AI coding task"
|
|
388
142
|
}
|
|
389
143
|
```
|
|
390
144
|
|
|
391
|
-
|
|
392
|
-
## Real Hook Verification
|
|
393
|
-
|
|
394
|
-
Hook schemas can change across AI coding tools. AgentBell keeps the templates small and visible so you can verify them with the tool version you actually run.
|
|
395
|
-
|
|
396
|
-
### Codex
|
|
397
|
-
|
|
398
|
-
Preview the Codex hook first:
|
|
399
|
-
|
|
400
|
-
```bash
|
|
401
|
-
agentbell init-hooks --target codex --dry-run
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
Then write the hook:
|
|
405
|
-
|
|
406
|
-
```bash
|
|
407
|
-
agentbell init-hooks --target codex
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
Run a minimal Codex task, for example asking it to inspect a tiny file or answer a short codebase question. When the task stops, you should receive an ntfy notification from `agentbell send --tool codex --event stop`.
|
|
411
|
-
|
|
412
|
-
If no notification arrives, run:
|
|
145
|
+
## Commands
|
|
413
146
|
|
|
414
147
|
```bash
|
|
415
|
-
agentbell
|
|
416
|
-
agentbell doctor --json
|
|
148
|
+
agentbell setup
|
|
417
149
|
agentbell test
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
### Claude Code
|
|
423
|
-
|
|
424
|
-
Preview or write Claude Code hooks:
|
|
425
|
-
|
|
426
|
-
```bash
|
|
427
|
-
agentbell init-hooks --target claude-code --dry-run
|
|
428
|
-
agentbell init-hooks --target claude-code
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
To verify the Stop hook, run a small Claude Code task and let it finish normally. You should receive a notification for `--tool claude-code --event stop`.
|
|
432
|
-
|
|
433
|
-
To verify the Notification hook, trigger a Claude Code state that asks for user attention, such as waiting for input or a permission-related notification. You should receive a notification for `--tool claude-code --event notification`.
|
|
434
|
-
|
|
435
|
-
Use the event name to distinguish states:
|
|
436
|
-
|
|
437
|
-
- `stop`: the agent finished the current task or turn.
|
|
438
|
-
- `notification`: the agent is asking for attention, often because it is waiting for input or needs user action.
|
|
439
|
-
|
|
440
|
-
If the Stop hook works but Notification does not, inspect the installed Claude Code version and its hook documentation. The event name or schema may have changed.
|
|
441
|
-
|
|
442
|
-
## Claude Code Verification
|
|
443
|
-
|
|
444
|
-
AgentBell prepares Claude Code hooks with this shape:
|
|
445
|
-
|
|
446
|
-
```text
|
|
447
|
-
hooks.Stop[].hooks[]
|
|
448
|
-
hooks.Notification[].hooks[]
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
Each handler uses `type: "command"` and calls `agentbell send`. On Windows, Claude Code runs hook commands through Git Bash / shell, so AgentBell writes project-local `.sh` wrappers instead of `.cmd` wrappers:
|
|
452
|
-
|
|
453
|
-
```text
|
|
454
|
-
<projectRoot>\.agentbell-hooks\claude-stop.sh
|
|
455
|
-
<projectRoot>\.agentbell-hooks\claude-notification.sh
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
Both wrappers log to:
|
|
459
|
-
|
|
460
|
-
```text
|
|
461
|
-
<projectRoot>\.agentbell-hooks\claude-hook-fired.log
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
The generated Claude Code commands look like:
|
|
465
|
-
|
|
466
|
-
```bash
|
|
467
|
-
bash G:/learning/AgentBell/.agentbell-hooks/claude-stop.sh
|
|
468
|
-
bash G:/learning/AgentBell/.agentbell-hooks/claude-notification.sh
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
Wrapper timestamps use an ASCII-safe UTC format, `date -u +"%Y-%m-%dT%H:%M:%SZ"`, to avoid mojibake on Windows systems with non-English locale output.
|
|
472
|
-
|
|
473
|
-
Preview the files:
|
|
474
|
-
|
|
475
|
-
```bash
|
|
476
|
-
agentbell init-hooks --target claude-code --dry-run
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
Write the hooks:
|
|
480
|
-
|
|
481
|
-
```bash
|
|
482
|
-
agentbell init-hooks --target claude-code
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
After changing Claude Code hooks, trust or allow the hook if Claude Code prompts you. To verify `Stop`, run a tiny Claude Code task and let it finish. To verify `Notification`, trigger a state where Claude Code waits for user attention, such as input or permission. If no phone notification arrives, check `<projectRoot>\.agentbell-hooks\claude-hook-fired.log` first. If the log file does not exist, Claude Code did not execute or trust the hook. If the log contains `Notification sent.`, troubleshoot ntfy and Android notification delivery.
|
|
486
|
-
|
|
487
|
-
### VS Code Agent / Copilot Agent
|
|
488
|
-
|
|
489
|
-
VS Code Agent / Copilot Agent support is treated as a workspace hook. AgentBell writes:
|
|
490
|
-
|
|
491
|
-
```text
|
|
492
|
-
.github/hooks/agentbell.json
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
Preview or write it from the workspace root:
|
|
496
|
-
|
|
497
|
-
```bash
|
|
498
|
-
agentbell init-hooks --target vscode-agent --dry-run
|
|
499
|
-
agentbell init-hooks --target vscode-agent
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
This capability may vary by VS Code and Copilot Agent version. After writing the file, reload VS Code, run a small workspace agent task, and confirm whether the hook command is executed. If it is not triggered, manually compare `.github/hooks/agentbell.json` with the hook format expected by your VS Code version, then move the command into the supported location.
|
|
503
|
-
|
|
504
|
-
Use `agentbell doctor` inside the same workspace terminal to confirm the CLI path, Node version, current working directory, and config file location.
|
|
505
|
-
|
|
506
|
-
## Verified: Codex VS Code Extension on Windows
|
|
507
|
-
|
|
508
|
-
The VS Code Codex extension has been manually verified on Windows with AgentBell:
|
|
509
|
-
|
|
510
|
-
- `UserPromptSubmit` and `Stop` hooks can be triggered by the extension.
|
|
511
|
-
- `Stop` hook successfully calls AgentBell through the generated `.cmd` wrapper.
|
|
512
|
-
- The full path works: Codex Stop hook -> `.cmd` wrapper -> AgentBell -> ntfy -> Android phone notification.
|
|
513
|
-
- The successful wrapper log is written to `~/.agentbell/codex-hook-fired.log`.
|
|
514
|
-
|
|
515
|
-
After changing hooks, Codex may require you to trust the updated hook again. If you use WSL, configure AgentBell separately inside WSL because Windows, WSL, Remote SSH, and Dev Containers have different home directories, Node paths, and hook execution environments.
|
|
516
|
-
|
|
517
|
-
## Local Desktop Notifications
|
|
518
|
-
|
|
519
|
-
闂勩倓绨?ntfy 閹靛婧€閹恒劑鈧緤绱滱gentBell 閸欘垯浜掔悰銉ュ帠閺堫剙婀村宀勬桨闁氨鐓¢敍?
|
|
520
|
-
- macOS: `osascript display notification`
|
|
521
|
-
- Linux: 娴兼ê鍘?`notify-send`閿涘奔绗夌€涙ê婀崚娆掔儲鏉?- Windows: MVP 闂冭埖顔岀捄瀹犵箖閸欘垶娼幀褌绗夌搾宕囨畱閺堫剙婀?toast閿涘苯鑻熺紒娆忓毉閹绘劗銇?
|
|
522
|
-
閺堫剙婀撮柅姘辩叀婢惰精瑙︽稉宥勭窗瑜板崬鎼?ntfy 閹靛婧€閹恒劑鈧降鈧?
|
|
523
|
-
## Remote SSH / WSL / Dev Container
|
|
524
|
-
|
|
525
|
-
Hook 鎼存棁顕氶崷銊ョ杽闂勫懓绻嶇悰?AI coding agent 閻ㄥ嫭婧€閸c劋绗傞幍褑顢戦妴鍌涚槷婵″偊绱?
|
|
526
|
-
- Remote SSH: hook 閸︺劏绻欑粙?Linux 娑撶粯婧€閹笛嗩攽閵?- WSL: hook 閸?WSL 閻滎垰顣ㄩ幍褑顢戦妴?- Dev Container: hook 閸?container 閸愬懏澧界悰灞烩偓?- 鏉╂粍甯堕悽浣冨壋: hook 閸︺劏顫︽潻婊勫付閻絻鍓抽幍褑顢戦妴?
|
|
527
|
-
閸ョ姵顒濇担鐘绘付鐟曚礁婀柇锝勯嚋閻滎垰顣ㄩ柌灞界暔鐟?Node.js 20+閵嗕礁鐣ㄧ憗?AgentBell閵嗕浇绻嶇悰?`agentbell init`閿涘苯鑻熺涵顔荤箽鐠囥儳骞嗘晶鍐厴鐠佸潡妫?ntfy server閵?
|
|
528
|
-
## Troubleshooting
|
|
529
|
-
|
|
530
|
-
### 閹靛婧€閺€鏈电瑝閸掍即鈧氨鐓?
|
|
531
|
-
閸忓牐绻嶇悰宀嬬窗
|
|
532
|
-
|
|
533
|
-
```bash
|
|
150
|
+
agentbell send --tool codex --event stop --task "audit task"
|
|
151
|
+
agentbell project init --name MyProject --task "AI coding task"
|
|
152
|
+
agentbell init-hooks --target all
|
|
153
|
+
agentbell verify
|
|
534
154
|
agentbell doctor
|
|
535
|
-
agentbell test
|
|
536
155
|
```
|
|
537
156
|
|
|
538
|
-
|
|
539
|
-
### 鏉╂粎鈻奸張鍝勬珤閺冪姵纭剁拋鍧楁6 ntfy.sh
|
|
540
|
-
|
|
541
|
-
鏉╂劘顢?`agentbell doctor` 閺屻儳婀?`ntfy server access`閵嗗倸顩ч弸婊冨彆閸欏摜缍夌紒婊勫灗閺堝秴濮熼崳銊х秹缂佹粓妾洪崚鎯邦問闂?`ntfy.sh`閿涘苯褰叉禒銉ㄥ殰瀵?ntfy server閿涘瞼鍔ч崥搴℃躬 `~/.agentbell/config.json` 娑擃厺鎱ㄩ弨?`ntfy.server`閵?
|
|
542
|
-
### hook 濞屄ば曢崣?
|
|
543
|
-
绾喛顓?hook 闁板秶鐤嗛弬鍥︽閸︺劌顕惔鏂夸紣閸忓嘲鐤勯梽鍛邦嚢閸欐牜娈戞担宥囩枂閵嗗倷鎱ㄩ弨?hook 閸氬函绱濋柌宥呮儙閹?reload 鐎电懓绨?AI coding 瀹搞儱鍙块妴鍌氬帥閻劋绔存稉顏勭发鐏忓繒娈?agent 娴犺濮熸宀冪槈 stop hook閵?
|
|
544
|
-
婵″倹鐏?Windows 娑?Codex hook 濞屸剝婀佺憴锕€褰傞柅姘辩叀閿涘矁顕Λ鈧弻?`~/.agentbell/codex-hook-fired.log`閵?
|
|
545
|
-
### Windows 鐠侯垰绶為梻顕€顣?
|
|
546
|
-
婵″倹鐏夐崗銊ョ湰 `agentbell` 閸涙垝鎶ら崷?hook 閻滎垰顣ㄩ柌灞肩瑝閸欘垵顫嗛敍灞藉讲娴犮儰濞囬悽?`agentbell doctor` 鏉堟挸鍤惃?`cli invocation for hooks`閵嗗倸婀張顒€婀村鈧崣鎴炴閿涘苯鐣犻崣顖濆厴閺?`node path/to/dist/cli.js`閵?
|
|
547
|
-
### WSL / Remote SSH 娑?hook 鐎圭偤妾潻鎰攽娴e秶鐤嗛梻顕€顣?
|
|
548
|
-
鐠囧嘲婀?agent 鐎圭偤妾潻鎰攽閻滎垰顣ㄩ柌灞惧⒔鐞?`agentbell doctor`閵嗕繅indows 娑撶粯婧€閵嗕箘SL閵嗕浇绻欑粙瀣╁瘜閺堟亽鈧笍ev Container 閺勵垯绗夐崥宀€骞嗘晶鍐跨礉閸氬嫯鍤滈張澶夌瑝閸氬瞼娈?home閵嗕赋ATH閵嗕腐ode 閸滃矂鍘ょ純顔芥瀮娴犺翰鈧?
|
|
549
|
-
### Cannot find module old project dist cli.js
|
|
550
|
-
|
|
551
|
-
If a wrapper log contains an error like:
|
|
552
|
-
|
|
553
|
-
```text
|
|
554
|
-
Cannot find module '...\old-project\dist\cli.js'
|
|
555
|
-
MODULE_NOT_FOUND
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
then the hook and wrapper did execute, but the active wrapper still points to an old project path. This can happen after renaming or moving the project directory.
|
|
559
|
-
|
|
560
|
-
Fix:
|
|
157
|
+
Useful examples:
|
|
561
158
|
|
|
562
159
|
```bash
|
|
563
|
-
|
|
564
|
-
agentbell
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
If `agentbell setup` sends a test notification but the phone does not receive it:
|
|
569
|
-
|
|
570
|
-
- Check that the topic in ntfy Android exactly matches the AgentBell topic.
|
|
571
|
-
- Check the ntfy server URL.
|
|
572
|
-
- Open the ntfy app once to refresh the subscription.
|
|
573
|
-
- Allow notification permission.
|
|
574
|
-
- Allow background running / disable battery optimization.
|
|
575
|
-
- Run `agentbell doctor` and inspect warnings.
|
|
576
|
-
|
|
577
|
-
If you skipped hook installation during setup, rerun `agentbell setup` or use `agentbell init-hooks --target all` after phone delivery works.
|
|
578
|
-
|
|
579
|
-
It is safe to rerun setup. Existing hook files are backed up by the hook installer before merge/write where supported.
|
|
580
|
-
### Cannot convert argument to a ByteString
|
|
581
|
-
|
|
582
|
-
This can happen when a Node.js `fetch` header contains Chinese text, emoji, or other non-ASCII characters. ntfy supports UTF-8 header values through RFC 2047 encoded-word syntax, so AgentBell automatically encodes ntfy headers such as `Title` and `Tags`.
|
|
583
|
-
|
|
584
|
-
The notification body is not header data and remains a normal UTF-8 message.
|
|
585
|
-
|
|
586
|
-
If you still see this error, upgrade AgentBell and rebuild it. As a temporary workaround, use an English-only `--title` and ASCII-only `--tags`.
|
|
587
|
-
|
|
588
|
-
## Development
|
|
589
|
-
|
|
590
|
-
```bash
|
|
591
|
-
npm install
|
|
592
|
-
npm run build
|
|
593
|
-
npm test
|
|
594
|
-
npm run dev -- test
|
|
160
|
+
agentbell setup --yes --targets none --no-test
|
|
161
|
+
agentbell setup --dry-run
|
|
162
|
+
agentbell init-hooks --target all --dry-run
|
|
163
|
+
agentbell send --tool claude-code --event stop --project MyProject --task "README update"
|
|
595
164
|
```
|
|
596
165
|
|
|
597
|
-
|
|
598
|
-
## Compatibility / Verified Matrix
|
|
599
|
-
|
|
600
|
-
| Tool | Surface | OS | Hook event | Wrapper strategy | Status | Log path |
|
|
601
|
-
|---|---|---|---|---|---|---|
|
|
602
|
-
| Codex | VS Code extension | Windows | Stop | user `.cmd` wrapper | Verified | `~/.agentbell/codex-hook-fired.log` |
|
|
603
|
-
| Claude Code | CLI / VS Code terminal mode | Windows | Stop | project `.sh` wrapper | Verified | `<projectRoot>/.agentbell-hooks/claude-hook-fired.log` |
|
|
604
|
-
| Claude Code | CLI / VS Code terminal mode | Windows | Notification | project `.sh` wrapper | Prepared / Partially verified | `<projectRoot>/.agentbell-hooks/claude-hook-fired.log` |
|
|
605
|
-
| VS Code Copilot Agent | VS Code Agent mode | Windows | Stop | project `.cmd` wrapper | Verified | `<projectRoot>/.agentbell-hooks/copilot-hook-fired.log` |
|
|
606
|
-
| Remote SSH / WSL / Dev Container | Various | Various | TBD | TBD | Not verified | TBD |
|
|
607
|
-
|
|
608
|
-
Verified means the full chain reached Android notification on the author's Windows machine. Claude Code Notification is prepared but should not be treated as fully verified until a real Notification event is tested. VS Code Agent hooks are still a Preview capability, so re-verify after VS Code or Copilot updates.
|
|
166
|
+
## Verification
|
|
609
167
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
Verified path:
|
|
613
|
-
|
|
614
|
-
```text
|
|
615
|
-
Codex Stop hook -> ~/.agentbell/hooks/codex-stop.cmd -> AgentBell -> ntfy -> Android
|
|
616
|
-
```
|
|
617
|
-
|
|
618
|
-
Install or refresh the hook:
|
|
168
|
+
Use `verify` when a hook is not firing, a notification does not arrive, Node was reinstalled, or a project was moved.
|
|
619
169
|
|
|
620
170
|
```bash
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
~/.agentbell/codex-hook-fired.log
|
|
171
|
+
agentbell verify --dry-run
|
|
172
|
+
agentbell verify --run-wrapper --send-test
|
|
173
|
+
agentbell verify --target codex
|
|
174
|
+
agentbell verify --target claude-code --run-wrapper
|
|
175
|
+
agentbell verify --target vscode-agent --run-wrapper
|
|
176
|
+
agentbell verify --json > agentbell-verify.json
|
|
628
177
|
```
|
|
629
178
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
- `Notification sent.` plus exit code `0`: AgentBell successfully sent the ntfy request.
|
|
633
|
-
- No log file: Codex did not execute the hook or the hook was not trusted.
|
|
634
|
-
- Log exists but phone did not receive notification: troubleshoot ntfy, Android background permissions, and notification permissions.
|
|
179
|
+
Notes:
|
|
635
180
|
|
|
636
|
-
|
|
181
|
+
- `--dry-run` inspects files and logs but does not run wrappers or send notifications.
|
|
182
|
+
- Warnings are normal in dry-run mode because wrapper execution is intentionally skipped.
|
|
183
|
+
- `--send-test` sends a phone notification through the configured provider.
|
|
184
|
+
- `--run-wrapper` manually runs the generated wrapper and then re-reads the latest hook log.
|
|
185
|
+
- Topics are masked in verify output.
|
|
637
186
|
|
|
638
|
-
|
|
639
|
-
- The generated `.cmd` wrapper gives Codex a short stable command and gives AgentBell a log file for troubleshooting.
|
|
640
|
-
- Codex uses the `hooks.Stop[].hooks[]` schema and the Windows-specific `commandWindows` field.
|
|
641
|
-
- After changing hooks, Codex may ask you to trust the updated hook again.
|
|
187
|
+
Log parsing behavior:
|
|
642
188
|
|
|
643
|
-
|
|
189
|
+
`verify` evaluates the latest hook run block, not every historical line in the log. Old failures are ignored once a newer successful wrapper run is recorded.
|
|
644
190
|
|
|
645
|
-
|
|
191
|
+
Global install path behavior:
|
|
646
192
|
|
|
647
|
-
|
|
648
|
-
claude --version
|
|
649
|
-
```
|
|
193
|
+
After `npm install -g @xwss/agentbell`, AgentBell can be run from any project directory. The current working directory is the project context for `.agentbell.json`, `.agentbell-hooks`, logs, `--cwd`, project name, and git branch detection. The AgentBell CLI path is the globally installed package path. `verify` should not require the project directory to contain `dist/cli.js`.
|
|
650
194
|
|
|
651
|
-
|
|
195
|
+
If verify reports that a wrapper incorrectly points to `<project>/dist/cli.js` after global install, update AgentBell and refresh hooks:
|
|
652
196
|
|
|
653
197
|
```bash
|
|
654
|
-
|
|
198
|
+
agentbell init-hooks --target all
|
|
655
199
|
```
|
|
656
200
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
Claude Code on Windows executes hook commands through Git Bash / shell. AgentBell therefore generates project-local `.sh` wrappers, not user-home `.cmd` wrappers.
|
|
660
|
-
|
|
661
|
-
Verified path:
|
|
201
|
+
## Troubleshooting
|
|
662
202
|
|
|
663
|
-
|
|
664
|
-
Claude Code Stop hook -> <projectRoot>/.agentbell-hooks/claude-stop.sh -> AgentBell -> ntfy -> Android
|
|
665
|
-
```
|
|
203
|
+
### `agentbell` command not found
|
|
666
204
|
|
|
667
|
-
|
|
205
|
+
- Make sure the package is installed:
|
|
668
206
|
|
|
669
207
|
```bash
|
|
670
|
-
|
|
671
|
-
claude /hooks
|
|
208
|
+
npm install -g @xwss/agentbell@beta
|
|
672
209
|
```
|
|
673
210
|
|
|
674
|
-
|
|
211
|
+
- Make sure the npm global bin directory is in `PATH`.
|
|
212
|
+
- On Windows, a common npm global bin path is `%APPDATA%\npm`.
|
|
213
|
+
- PowerShell may block the `.ps1` shim. Try CMD or:
|
|
675
214
|
|
|
676
|
-
```
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
Inspect:
|
|
680
|
-
|
|
681
|
-
```text
|
|
682
|
-
<projectRoot>/.agentbell-hooks/claude-hook-fired.log
|
|
215
|
+
```cmd
|
|
216
|
+
cmd /d /s /c agentbell --help
|
|
683
217
|
```
|
|
684
218
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
The Claude Code Notification hook is prepared / partially verified. Do not treat it as fully verified until you have triggered and confirmed a real Notification event on your machine.
|
|
688
|
-
|
|
219
|
+
### Windows local desktop notification skipped
|
|
689
220
|
|
|
690
|
-
|
|
221
|
+
This is expected in the MVP. Phone push still works.
|
|
691
222
|
|
|
692
|
-
|
|
223
|
+
### Claude Code verify requires bash
|
|
693
224
|
|
|
694
|
-
|
|
695
|
-
2. `bash` found on `PATH`.
|
|
696
|
-
3. Common Git for Windows paths such as `C:\Program Files\Git\bin\bash.exe`.
|
|
225
|
+
On Windows, set the Git Bash path if auto-detection fails:
|
|
697
226
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
```bat
|
|
701
|
-
set AGENTBELL_BASH_PATH=D:\software\git\bin\bash.exe
|
|
227
|
+
```cmd
|
|
228
|
+
set AGENTBELL_BASH_PATH=C:\Program Files\Git\bin\bash.exe
|
|
702
229
|
agentbell verify --target claude-code --run-wrapper
|
|
703
230
|
```
|
|
704
231
|
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
```text
|
|
708
|
-
[Claude Code]
|
|
709
|
-
bash: D:\software\git\bin\bash.exe
|
|
710
|
-
```
|
|
711
|
-
|
|
712
|
-
If manual bash execution succeeds but verify fails, run:
|
|
713
|
-
|
|
714
|
-
```bash
|
|
715
|
-
agentbell verify --target claude-code --run-wrapper --json
|
|
716
|
-
```
|
|
717
|
-
|
|
718
|
-
Compare `bashPath`, `runWrapper`, and the latest log block status. A successful latest Claude block should include `Notification sent.` and `AgentBell exit code 0`.
|
|
719
|
-
|
|
720
|
-
## Verified: VS Code Copilot Agent on Windows
|
|
721
|
-
|
|
722
|
-
VS Code Agent hooks are still Preview, but the Windows Stop path below has been verified with Copilot Agent mode.
|
|
723
|
-
|
|
724
|
-
Verified path:
|
|
725
|
-
|
|
726
|
-
```text
|
|
727
|
-
VS Code Copilot Agent Stop hook -> <projectRoot>/.agentbell-hooks/copilot-stop.cmd -> AgentBell -> ntfy -> Android
|
|
728
|
-
```
|
|
729
|
-
|
|
730
|
-
Generated files:
|
|
731
|
-
|
|
732
|
-
- Hook file: `.github/hooks/agentbell.json`
|
|
733
|
-
- Wrapper: `<projectRoot>/.agentbell-hooks/copilot-stop.cmd`
|
|
734
|
-
- Log: `<projectRoot>/.agentbell-hooks/copilot-hook-fired.log`
|
|
232
|
+
### Hook not firing
|
|
735
233
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
```bash
|
|
739
|
-
node dist\cli.js init-hooks --target vscode-agent
|
|
740
|
-
```
|
|
234
|
+
Try:
|
|
741
235
|
|
|
742
|
-
|
|
236
|
+
1. Restart VS Code or the target AI tool.
|
|
237
|
+
2. Trust hooks if prompted.
|
|
238
|
+
3. Run `agentbell verify`.
|
|
239
|
+
4. Check logs:
|
|
743
240
|
|
|
744
241
|
```text
|
|
745
|
-
|
|
242
|
+
Codex: ~/.agentbell/codex-hook-fired.log
|
|
243
|
+
Claude Code: <project>/.agentbell-hooks/claude-hook-fired.log
|
|
244
|
+
Copilot Agent: <project>/.agentbell-hooks/copilot-hook-fired.log
|
|
746
245
|
```
|
|
747
246
|
|
|
748
|
-
|
|
247
|
+
### ntfy notification delay
|
|
749
248
|
|
|
750
|
-
|
|
249
|
+
On Android:
|
|
751
250
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
If notifications arrive only after opening the ntfy app, the usual cause is Android background restriction rather than AgentBell.
|
|
755
|
-
|
|
756
|
-
Recommended Android settings:
|
|
757
|
-
|
|
758
|
-
- Allow notifications.
|
|
759
|
-
- Allow lock-screen notifications.
|
|
251
|
+
- Allow notification permission.
|
|
760
252
|
- Allow background running.
|
|
761
253
|
- Disable battery optimization for ntfy.
|
|
762
|
-
-
|
|
763
|
-
- Allow background network access.
|
|
764
|
-
- In the watch/band companion app, allow forwarding ntfy notifications.
|
|
765
|
-
|
|
766
|
-
The F-Droid build of ntfy may rely more heavily on a background connection. If the phone has Google services, the Play Store build may be more reliable for push delivery.
|
|
767
|
-
|
|
768
|
-
Treat the ntfy topic as a secret. Do not use an easy-to-guess topic and never commit it to a public repository. Use a long random topic such as `your-long-random-topic`; when showing diagnostics publicly, mask it like `agen...q4z1`.
|
|
769
|
-
|
|
770
|
-
## Known Windows Notes
|
|
771
|
-
|
|
772
|
-
- Windows local desktop notification is intentionally skipped in this MVP. ntfy phone push is unaffected.
|
|
773
|
-
- Codex has been verified with a user-home `.cmd` wrapper.
|
|
774
|
-
- Claude Code has been verified with a project-local `.sh` wrapper.
|
|
775
|
-
- VS Code Copilot Agent has been verified with a project-local `.cmd` wrapper.
|
|
776
|
-
- Windows non-ASCII usernames, Git Bash path conversion, `cmd` quoting, and hook host behavior can all affect execution, so do not casually change wrapper strategy between tools.
|
|
777
|
-
- Git dubious ownership does not affect AgentBell notifications, but it can block `git status`, `git diff`, or commits. Users should decide whether to configure `safe.directory`.
|
|
778
|
-
- WSL, Remote SSH, Dev Containers, and Windows host shells have different home directories, Node paths, environment variables, and network behavior. Configure and verify AgentBell in the environment where the agent hook actually runs.
|
|
779
|
-
|
|
780
|
-
## Next: Verify and Rich Context
|
|
781
|
-
|
|
782
|
-
Now that `agentbell setup` exists, the next product step is a dedicated `agentbell verify` command for repeatable end-to-end checks after setup.
|
|
783
|
-
|
|
784
|
-
Planned improvements:
|
|
785
|
-
|
|
786
|
-
1. Verify config readability.
|
|
787
|
-
2. Verify ntfy delivery.
|
|
788
|
-
3. Verify installed hook files and wrapper paths.
|
|
789
|
-
4. Print tool-specific next steps for Codex, Claude Code, and VS Code Copilot Agent.
|
|
790
|
-
5. Expand notification templates with project and task context.
|
|
791
|
-
|
|
792
|
-
Example topic values in docs should stay generic, such as `your-long-random-topic` or `agen...q4z1`.
|
|
793
|
-
|
|
794
|
-
## Future: Rich Notification Context
|
|
795
|
-
|
|
796
|
-
Future AgentBell notifications can include richer context so the phone notification tells you which machine and task finished.
|
|
797
|
-
|
|
798
|
-
Possible fields:
|
|
799
|
-
|
|
800
|
-
- machine display name
|
|
801
|
-
- hostname
|
|
802
|
-
- tool
|
|
803
|
-
- event
|
|
804
|
-
- project name
|
|
805
|
-
- cwd
|
|
806
|
-
- git branch
|
|
807
|
-
- task name
|
|
808
|
-
- timestamp
|
|
809
|
-
|
|
810
|
-
Example:
|
|
254
|
+
- Confirm the phone subscribed to the same topic generated by setup.
|
|
811
255
|
|
|
812
|
-
|
|
813
|
-
宸ヤ綔绔?鍙?路 Codex 瀹¤浠诲姟缁撴潫
|
|
814
|
-
椤圭洰锛欰gentBell
|
|
815
|
-
璺緞锛欸:\learning\AgentBell
|
|
816
|
-
鍒嗘敮锛歮ain
|
|
817
|
-
```
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
## Rich Notification Context
|
|
824
|
-
|
|
825
|
-
AgentBell now builds richer default notification content when `--title` or `--message` is not provided. The default context can include:
|
|
256
|
+
## Manual Configuration
|
|
826
257
|
|
|
827
|
-
|
|
828
|
-
- hostname
|
|
829
|
-
- tool display name
|
|
830
|
-
- raw tool id
|
|
831
|
-
- event and event label
|
|
832
|
-
- task name
|
|
833
|
-
- project name
|
|
834
|
-
- cwd
|
|
835
|
-
- git branch
|
|
836
|
-
- local timestamp
|
|
837
|
-
- ISO timestamp
|
|
838
|
-
|
|
839
|
-
Example notification:
|
|
840
|
-
|
|
841
|
-
```text
|
|
842
|
-
宸ヤ綔绔?鍙?路 Codex 瀹¤浠诲姟缁撴潫
|
|
843
|
-
|
|
844
|
-
椤圭洰锛欰gentBell
|
|
845
|
-
璺緞锛欸:\learning\AgentBell
|
|
846
|
-
鍒嗘敮锛歮ain
|
|
847
|
-
浜嬩欢锛歴top
|
|
848
|
-
鏃堕棿锛?026-05-23 22:45
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
Useful `send` options:
|
|
258
|
+
`agentbell setup` is recommended. Advanced users can use lower-level commands:
|
|
852
259
|
|
|
853
260
|
```bash
|
|
854
|
-
agentbell
|
|
855
|
-
agentbell
|
|
856
|
-
agentbell
|
|
261
|
+
agentbell init
|
|
262
|
+
agentbell test
|
|
263
|
+
agentbell init-hooks --target codex
|
|
264
|
+
agentbell init-hooks --target claude-code
|
|
265
|
+
agentbell init-hooks --target vscode-agent
|
|
857
266
|
```
|
|
858
267
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
## Machine Display Name
|
|
862
|
-
|
|
863
|
-
The ntfy topic is a secret transport address, not a human-readable machine name. Do not use your topic as a display name and do not commit it to a public repository.
|
|
864
|
-
|
|
865
|
-
Use `profile.name` in `~/.agentbell/config.json` for friendly notification context:
|
|
268
|
+
Example config:
|
|
866
269
|
|
|
867
270
|
```json
|
|
868
271
|
{
|
|
272
|
+
"provider": "ntfy",
|
|
273
|
+
"ntfy": {
|
|
274
|
+
"server": "https://ntfy.sh",
|
|
275
|
+
"topic": "your-long-random-topic",
|
|
276
|
+
"priority": "high",
|
|
277
|
+
"tags": ["computer"]
|
|
278
|
+
},
|
|
869
279
|
"profile": {
|
|
870
|
-
"name": "
|
|
280
|
+
"name": "Workstation-01"
|
|
281
|
+
},
|
|
282
|
+
"localNotification": {
|
|
283
|
+
"enabled": false
|
|
284
|
+
},
|
|
285
|
+
"includeContext": {
|
|
286
|
+
"hostname": true,
|
|
287
|
+
"cwd": true,
|
|
288
|
+
"timestamp": true
|
|
871
289
|
}
|
|
872
290
|
}
|
|
873
291
|
```
|
|
874
292
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
### Hooks use rich context by default
|
|
879
|
-
|
|
880
|
-
Generated Stop wrappers now let `agentbell send` build the notification from rich context. They do not hard-code simple `--title` / `--message` values by default.
|
|
881
|
-
|
|
882
|
-
To customize hook notifications, create `.agentbell.json` in the project:
|
|
293
|
+
## Development
|
|
883
294
|
|
|
884
|
-
```
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
295
|
+
```bash
|
|
296
|
+
npm install
|
|
297
|
+
npm run build
|
|
298
|
+
npm test
|
|
299
|
+
npm run lint
|
|
300
|
+
node dist/cli.js --help
|
|
889
301
|
```
|
|
890
302
|
|
|
891
|
-
|
|
303
|
+
Useful local checks:
|
|
892
304
|
|
|
893
305
|
```bash
|
|
894
|
-
|
|
306
|
+
npm run check:package
|
|
307
|
+
npm pack --dry-run
|
|
895
308
|
```
|
|
896
309
|
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
Example hook notification:
|
|
900
|
-
|
|
901
|
-
```text
|
|
902
|
-
宸ヤ綔绔?鍙?路 Codex 瀹¤浠诲姟缁撴潫
|
|
903
|
-
椤圭洰锛欰gentBell
|
|
904
|
-
璺緞锛欸:\learning\AgentBell
|
|
905
|
-
鍒嗘敮锛歮ain
|
|
906
|
-
浜嬩欢锛歴top
|
|
907
|
-
鏃堕棿锛?026-05-23 22:45
|
|
908
|
-
```
|
|
909
|
-
## Project Config
|
|
310
|
+
## Release
|
|
910
311
|
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
{
|
|
915
|
-
"projectName": "AgentBell",
|
|
916
|
-
"defaultTaskName": "瀹¤浠诲姟"
|
|
917
|
-
}
|
|
918
|
-
```
|
|
919
|
-
|
|
920
|
-
Create it with:
|
|
312
|
+
- Package name: `@xwss/agentbell`
|
|
313
|
+
- CLI command: `agentbell`
|
|
314
|
+
- Publish command:
|
|
921
315
|
|
|
922
316
|
```bash
|
|
923
|
-
|
|
317
|
+
npm publish --access public --tag beta
|
|
924
318
|
```
|
|
925
319
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
Project name priority:
|
|
929
|
-
|
|
930
|
-
1. `agentbell send --project <name>`
|
|
931
|
-
2. `.agentbell.json` `projectName`
|
|
932
|
-
3. `package.json` `name`
|
|
933
|
-
4. current directory name
|
|
934
|
-
|
|
935
|
-
Task name priority:
|
|
936
|
-
|
|
937
|
-
1. `agentbell send --task <name>`
|
|
938
|
-
2. `.agentbell.json` `defaultTaskName`
|
|
939
|
-
3. `浠诲姟`
|
|
940
|
-
|
|
941
|
-
Project-level notification templates can override global templates:
|
|
320
|
+
Do not publish unless these pass:
|
|
942
321
|
|
|
943
|
-
```
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
"messageTemplate": "椤圭洰锛歿{project}}\n璺緞锛歿{cwd}}\n鍒嗘敮锛歿{branch}}\n浜嬩欢锛歿{event}}\n鏃堕棿锛歿{timestamp}}"
|
|
950
|
-
}
|
|
951
|
-
}
|
|
322
|
+
```bash
|
|
323
|
+
npm run build
|
|
324
|
+
npm test
|
|
325
|
+
npm run lint
|
|
326
|
+
npm run check:package
|
|
327
|
+
npm pack --dry-run
|
|
952
328
|
```
|
|
953
329
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
## Setup Project Context
|
|
957
|
-
|
|
958
|
-
`agentbell setup` remains safe by default and does not create `.agentbell.json` in `--yes` mode unless requested.
|
|
330
|
+
Before publishing, confirm no real topic, token, log, backup, local hook wrapper, `.env`, or local config file is included.
|
|
959
331
|
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
```bash
|
|
963
|
-
agentbell setup --init-project --project-name AgentBell
|
|
964
|
-
```
|
|
332
|
+
## License
|
|
965
333
|
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
334
|
+
MIT
|