agentrem 1.5.1 → 1.6.0
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/README.md +87 -7
- package/dist/check-watch.d.ts +45 -0
- package/dist/check-watch.d.ts.map +1 -0
- package/dist/check-watch.js +122 -0
- package/dist/check-watch.js.map +1 -0
- package/dist/db.js +1 -1
- package/dist/db.js.map +1 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/notifier.js +1 -1
- package/dist/notifier.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/llms-full.txt +484 -106
- package/llms.txt +103 -70
- package/package.json +1 -1
package/llms-full.txt
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# agentrem — Full API Reference
|
|
1
|
+
# agentrem v1.5.2 — Full API Reference
|
|
2
|
+
|
|
3
|
+
444 tests passing. SQLite-backed structured reminders for AI agents.
|
|
2
4
|
|
|
3
5
|
## Installation
|
|
4
6
|
|
|
@@ -22,6 +24,8 @@ agentrem init # Create ~/.agentrem/reminders.db
|
|
|
22
24
|
agentrem init --force # Recreate (backs up existing)
|
|
23
25
|
```
|
|
24
26
|
|
|
27
|
+
---
|
|
28
|
+
|
|
25
29
|
### agentrem add <content>
|
|
26
30
|
|
|
27
31
|
Create a reminder.
|
|
@@ -35,15 +39,15 @@ Create a reminder.
|
|
|
35
39
|
| `--context, -c <ctx>` | Additional context string | `--context "PR #42 needs review"` |
|
|
36
40
|
| `--category <cat>` | Category | `--category work` |
|
|
37
41
|
| `--keywords, -k <kw>` | Keywords for keyword trigger | `--keywords "deploy,release,ship"` |
|
|
38
|
-
| `--match <mode>` | Keyword match mode: any/all/regex | `--match any` |
|
|
42
|
+
| `--match <mode>` | Keyword match mode: any/all/regex (default: any) | `--match any` |
|
|
39
43
|
| `--check <cmd>` | Shell command for condition trigger | `--check "curl -s http://localhost:3000/health"` |
|
|
40
44
|
| `--expect <output>` | Expected output for condition trigger | `--expect "ok"` |
|
|
41
45
|
| `--decay <datetime>` | Auto-expire after this datetime | `--decay "+7d"` |
|
|
42
46
|
| `--max-fires <n>` | Auto-complete after N triggers | `--max-fires 3` |
|
|
43
47
|
| `--recur, -r <rule>` | Recurrence: 1d, 2d, 1w, 2w, 1m | `--recur 1w` |
|
|
44
|
-
| `--agent, -a <name>` | Agent namespace | `--agent jarvis` |
|
|
45
|
-
| `--depends-on <id>` | Dependency reminder ID | `--depends-on abc12345` |
|
|
46
|
-
| `--source <src>` | Source: agent/user/system | `--source user` |
|
|
48
|
+
| `--agent, -a <name>` | Agent namespace (default: main) | `--agent jarvis` |
|
|
49
|
+
| `--depends-on <id>` | Dependency reminder ID (waits until it's completed) | `--depends-on abc12345` |
|
|
50
|
+
| `--source <src>` | Source: agent/user/system (default: agent) | `--source user` |
|
|
47
51
|
| `--dry-run` | Preview without creating | |
|
|
48
52
|
|
|
49
53
|
```bash
|
|
@@ -57,23 +61,33 @@ agentrem add "Send report" --due "in 30 minutes"
|
|
|
57
61
|
# Keyword trigger
|
|
58
62
|
agentrem add "Review security" --trigger keyword --keywords "deploy,release" --match any
|
|
59
63
|
|
|
60
|
-
# Session reminder
|
|
61
|
-
agentrem add "Check CI" --trigger session
|
|
64
|
+
# Session reminder (fires every check --type session)
|
|
65
|
+
agentrem add "Check CI" --trigger session --priority 3
|
|
62
66
|
|
|
63
67
|
# Recurring weekly
|
|
64
68
|
agentrem add "Team sync prep" --due "2026-02-24T09:00:00" --recur 1w
|
|
65
69
|
|
|
66
|
-
# With dependency
|
|
70
|
+
# With dependency (Deploy won't surface until abc12345 is completed)
|
|
67
71
|
agentrem add "Deploy" --due "+4h" --depends-on abc12345
|
|
68
72
|
|
|
69
73
|
# With auto-expire
|
|
70
74
|
agentrem add "Sale ends soon" --due "+1h" --decay "+24h"
|
|
75
|
+
|
|
76
|
+
# Condition trigger (fires when shell command returns expected output)
|
|
77
|
+
agentrem add "Service is down" --trigger condition --check "curl -s http://localhost:3000/health" --expect "ok"
|
|
78
|
+
|
|
79
|
+
# Dry run — preview without creating
|
|
80
|
+
agentrem add "Test" --due "+1h" --dry-run
|
|
71
81
|
```
|
|
72
82
|
|
|
83
|
+
---
|
|
84
|
+
|
|
73
85
|
### agentrem check
|
|
74
86
|
|
|
75
87
|
Check for triggered reminders. This is the primary integration command.
|
|
76
88
|
|
|
89
|
+
#### One-shot mode (default)
|
|
90
|
+
|
|
77
91
|
| Flag | Description |
|
|
78
92
|
|------|-------------|
|
|
79
93
|
| `--type <types>` | Comma-separated trigger types to check |
|
|
@@ -81,51 +95,154 @@ Check for triggered reminders. This is the primary integration command.
|
|
|
81
95
|
| `--budget <n>` | Token budget limit (default: 800) |
|
|
82
96
|
| `--format <fmt>` | Output format: full/compact/inline |
|
|
83
97
|
| `--json` | Output structured JSON |
|
|
84
|
-
| `--agent, -a <name>` | Agent namespace |
|
|
98
|
+
| `--agent, -a <name>` | Agent namespace (default: main) |
|
|
85
99
|
| `--escalate` | Run escalation (P3→P2 after 48h, P2→P1 after 24h) |
|
|
86
100
|
| `--dry-run` | Preview without updating fire counts |
|
|
87
101
|
|
|
88
102
|
```bash
|
|
89
|
-
agentrem check
|
|
90
|
-
agentrem check --type time,session --budget 800
|
|
103
|
+
agentrem check # All triggers
|
|
104
|
+
agentrem check --type time,session --budget 800 # Session start
|
|
91
105
|
agentrem check --type keyword --text "deploy now" # Keyword scan
|
|
92
106
|
agentrem check --escalate # With escalation
|
|
93
107
|
agentrem check --json # Structured output
|
|
108
|
+
agentrem check --format compact # One-line summary
|
|
109
|
+
agentrem check --format inline # Ultra-compact
|
|
94
110
|
```
|
|
95
111
|
|
|
96
|
-
JSON output example:
|
|
112
|
+
JSON output example (`agentrem check --json`):
|
|
97
113
|
```json
|
|
98
114
|
{
|
|
99
115
|
"included": [
|
|
100
116
|
{
|
|
101
|
-
"id": "
|
|
117
|
+
"id": "8f103c9c-1234-5678-abcd-ef0123456789",
|
|
102
118
|
"content": "Deploy v2",
|
|
119
|
+
"context": null,
|
|
103
120
|
"trigger_type": "time",
|
|
104
121
|
"trigger_at": "2026-02-21T15:00:00",
|
|
105
122
|
"priority": 2,
|
|
106
123
|
"tags": "deploy",
|
|
124
|
+
"category": null,
|
|
107
125
|
"status": "active",
|
|
108
|
-
"
|
|
126
|
+
"snoozed_until": null,
|
|
127
|
+
"decay_at": null,
|
|
128
|
+
"fire_count": 1,
|
|
129
|
+
"last_fired": "2026-02-21T15:00:05",
|
|
130
|
+
"max_fires": null,
|
|
131
|
+
"recur_rule": null,
|
|
132
|
+
"depends_on": null,
|
|
133
|
+
"source": "agent",
|
|
134
|
+
"agent": "main",
|
|
135
|
+
"created_at": "2026-02-21T12:00:00",
|
|
136
|
+
"updated_at": "2026-02-21T15:00:05",
|
|
137
|
+
"completed_at": null,
|
|
138
|
+
"notes": null
|
|
109
139
|
}
|
|
110
140
|
],
|
|
111
|
-
"overflowCounts": { "2": 0, "3": 0, "4": 1 }
|
|
141
|
+
"overflowCounts": { "1": 0, "2": 0, "3": 0, "4": 1, "5": 0 },
|
|
142
|
+
"totalTriggered": 2
|
|
112
143
|
}
|
|
113
144
|
```
|
|
114
145
|
|
|
146
|
+
#### check --watch (blocking mode)
|
|
147
|
+
|
|
148
|
+
Blocks until the next due reminder fires. Does NOT update fire counts or change any state — it only surfaces what is due. Use a regular `agentrem check` after to actually mark reminders as fired.
|
|
149
|
+
|
|
150
|
+
| Flag | Description |
|
|
151
|
+
|------|-------------|
|
|
152
|
+
| `--watch` | Enable blocking watch mode |
|
|
153
|
+
| `--timeout <seconds>` | Seconds before giving up. If no reminder fires, exits with code 1. Omit for indefinite wait. |
|
|
154
|
+
| `--json` | Output full reminder JSON instead of human-readable text |
|
|
155
|
+
| `--type <types>` | Trigger type filter (default: `time`) |
|
|
156
|
+
| `--agent, -a <name>` | Agent filter (default: `main`) |
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Wait indefinitely for next time trigger
|
|
160
|
+
agentrem check --watch
|
|
161
|
+
|
|
162
|
+
# Exit 1 if nothing fires within 5 minutes
|
|
163
|
+
agentrem check --watch --timeout 300
|
|
164
|
+
|
|
165
|
+
# Structured JSON output (full Reminder object)
|
|
166
|
+
agentrem check --watch --json
|
|
167
|
+
|
|
168
|
+
# Filter trigger types
|
|
169
|
+
agentrem check --watch --type time,heartbeat
|
|
170
|
+
|
|
171
|
+
# Filter by agent
|
|
172
|
+
agentrem check --watch --agent jarvis --timeout 60
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Exit codes:**
|
|
176
|
+
- `0` — A reminder fired (output on stdout), OR SIGINT/SIGTERM received (no output)
|
|
177
|
+
- `1` — `--timeout` elapsed with no reminder found
|
|
178
|
+
|
|
179
|
+
**Human-readable output (without --json):**
|
|
180
|
+
```
|
|
181
|
+
🔔 Reminder due: "Deploy v2" (P2, due 5m ago)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**JSON output (`--watch --json`):** Full Reminder object (same schema as `agentrem list --json` entries):
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"id": "8f103c9c-1234-5678-abcd-ef0123456789",
|
|
188
|
+
"content": "Deploy v2",
|
|
189
|
+
"context": null,
|
|
190
|
+
"trigger_type": "time",
|
|
191
|
+
"trigger_at": "2026-02-22T09:00:00",
|
|
192
|
+
"priority": 2,
|
|
193
|
+
"tags": "deploy",
|
|
194
|
+
"category": null,
|
|
195
|
+
"status": "active",
|
|
196
|
+
"snoozed_until": null,
|
|
197
|
+
"decay_at": null,
|
|
198
|
+
"fire_count": 0,
|
|
199
|
+
"last_fired": null,
|
|
200
|
+
"max_fires": null,
|
|
201
|
+
"recur_rule": null,
|
|
202
|
+
"recur_parent_id": null,
|
|
203
|
+
"depends_on": null,
|
|
204
|
+
"related_ids": null,
|
|
205
|
+
"source": "agent",
|
|
206
|
+
"agent": "main",
|
|
207
|
+
"created_at": "2026-02-22T08:00:00",
|
|
208
|
+
"updated_at": "2026-02-22T08:00:00",
|
|
209
|
+
"completed_at": null,
|
|
210
|
+
"notes": null
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Implementation details:**
|
|
215
|
+
- Polls the database every 5 seconds
|
|
216
|
+
- First poll is immediate — returns instantly if a reminder is already due
|
|
217
|
+
- Handles SIGINT/SIGTERM cleanly (exits 0, no output)
|
|
218
|
+
- Only surfaces `time` trigger type by default; use `--type` to include others
|
|
219
|
+
- Does not modify reminders in any way
|
|
220
|
+
|
|
221
|
+
**Usage pattern (poll-then-act):**
|
|
222
|
+
```bash
|
|
223
|
+
# Wait for a reminder, then act on it
|
|
224
|
+
if agentrem check --watch --timeout 120 --json > /tmp/due.json; then
|
|
225
|
+
cat /tmp/due.json # full reminder object
|
|
226
|
+
agentrem check # now actually mark it as fired
|
|
227
|
+
fi
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
115
232
|
### agentrem list
|
|
116
233
|
|
|
117
234
|
List reminders with filters.
|
|
118
235
|
|
|
119
236
|
| Flag | Description |
|
|
120
237
|
|------|-------------|
|
|
121
|
-
| `--status, -s <statuses>` | Filter by status (comma-separated) |
|
|
238
|
+
| `--status, -s <statuses>` | Filter by status: active/snoozed/completed/expired/deleted/failed (comma-separated) |
|
|
122
239
|
| `--priority <priorities>` | Filter by priority (comma-separated) |
|
|
123
|
-
| `--tag <tag>` | Filter by tag |
|
|
240
|
+
| `--tag <tag>` | Filter by tag (substring match) |
|
|
124
241
|
| `--trigger <type>` | Filter by trigger type |
|
|
125
|
-
| `--due <filter>` | Due filter: today/tomorrow/overdue/week
|
|
126
|
-
| `--agent, -a <name>` | Agent namespace |
|
|
242
|
+
| `--due <filter>` | Due filter: today/tomorrow/overdue/week/\<date\> |
|
|
243
|
+
| `--agent, -a <name>` | Agent namespace (default: main) |
|
|
127
244
|
| `--category <cat>` | Category filter |
|
|
128
|
-
| `--limit <n>` | Max results |
|
|
245
|
+
| `--limit <n>` | Max results (default: 20) |
|
|
129
246
|
| `--format <fmt>` | Output: table/json/compact |
|
|
130
247
|
| `--json` | Output structured JSON |
|
|
131
248
|
| `--all` | Include all statuses (not just active) |
|
|
@@ -135,42 +252,53 @@ agentrem list # All active
|
|
|
135
252
|
agentrem list --priority 1,2 # Critical + High
|
|
136
253
|
agentrem list --tag deploy # By tag
|
|
137
254
|
agentrem list --due overdue # Overdue only
|
|
255
|
+
agentrem list --due today # Due today
|
|
256
|
+
agentrem list --status snoozed # Snoozed only
|
|
257
|
+
agentrem list --all # All statuses
|
|
138
258
|
agentrem list --json # Structured output
|
|
139
259
|
agentrem list --format compact # One line per reminder
|
|
260
|
+
agentrem list --limit 50 # More results
|
|
140
261
|
```
|
|
141
262
|
|
|
263
|
+
---
|
|
264
|
+
|
|
142
265
|
### agentrem search <query>
|
|
143
266
|
|
|
144
|
-
Full-text search across content, context, tags, and notes.
|
|
267
|
+
Full-text search across content, context, tags, and notes (SQLite FTS5).
|
|
145
268
|
|
|
146
269
|
| Flag | Description |
|
|
147
270
|
|------|-------------|
|
|
148
|
-
| `--status <statuses>` | Filter by status |
|
|
149
|
-
| `--limit <n>` | Max results |
|
|
271
|
+
| `--status <statuses>` | Filter by status (default: active) |
|
|
272
|
+
| `--limit <n>` | Max results (default: 10) |
|
|
150
273
|
| `--format <fmt>` | Output: table/json |
|
|
151
274
|
| `--json` | Output structured JSON |
|
|
152
275
|
|
|
153
276
|
```bash
|
|
154
277
|
agentrem search "deploy staging"
|
|
155
278
|
agentrem search "deploy" --json
|
|
279
|
+
agentrem search "PR review" --status active,snoozed --limit 20
|
|
156
280
|
```
|
|
157
281
|
|
|
282
|
+
---
|
|
283
|
+
|
|
158
284
|
### agentrem complete <id>
|
|
159
285
|
|
|
160
286
|
Mark a reminder as completed. If it has `--recur`, automatically creates the next instance.
|
|
161
287
|
|
|
162
288
|
| Flag | Description |
|
|
163
289
|
|------|-------------|
|
|
164
|
-
| `--notes <text>` | Completion notes |
|
|
290
|
+
| `--notes <text>` | Completion notes (appended to existing notes) |
|
|
165
291
|
|
|
166
292
|
```bash
|
|
167
293
|
agentrem complete 8f103c9c
|
|
168
294
|
agentrem complete 8f103c9c --notes "Deployed successfully"
|
|
169
295
|
```
|
|
170
296
|
|
|
297
|
+
---
|
|
298
|
+
|
|
171
299
|
### agentrem snooze <id>
|
|
172
300
|
|
|
173
|
-
Snooze a reminder.
|
|
301
|
+
Snooze a reminder until a specific time or for a duration.
|
|
174
302
|
|
|
175
303
|
| Flag | Description |
|
|
176
304
|
|------|-------------|
|
|
@@ -179,50 +307,63 @@ Snooze a reminder.
|
|
|
179
307
|
|
|
180
308
|
```bash
|
|
181
309
|
agentrem snooze abc12345 --for 2h
|
|
310
|
+
agentrem snooze abc12345 --for 1d
|
|
182
311
|
agentrem snooze abc12345 --until "tomorrow"
|
|
312
|
+
agentrem snooze abc12345 --until "2026-02-25T09:00:00"
|
|
183
313
|
```
|
|
184
314
|
|
|
315
|
+
---
|
|
316
|
+
|
|
185
317
|
### agentrem edit <id>
|
|
186
318
|
|
|
187
|
-
Edit reminder fields.
|
|
319
|
+
Edit one or more reminder fields.
|
|
188
320
|
|
|
189
321
|
| Flag | Description |
|
|
190
322
|
|------|-------------|
|
|
191
323
|
| `--content <text>` | New content |
|
|
192
324
|
| `--context <ctx>` | New context |
|
|
193
|
-
| `--priority, -p <n>` | New priority |
|
|
325
|
+
| `--priority, -p <n>` | New priority (1-5) |
|
|
194
326
|
| `--due, -d <datetime>` | New due date (natural language or ISO) |
|
|
195
327
|
| `--tags <tags>` | Replace all tags |
|
|
196
|
-
| `--add-tags <tags>` | Add tags |
|
|
197
|
-
| `--remove-tags <tags>` | Remove tags |
|
|
328
|
+
| `--add-tags <tags>` | Add tags (merges with existing) |
|
|
329
|
+
| `--remove-tags <tags>` | Remove specific tags |
|
|
198
330
|
| `--category <cat>` | New category |
|
|
199
331
|
| `--decay <datetime>` | New decay date |
|
|
200
332
|
| `--max-fires <n>` | New max fires |
|
|
201
|
-
| `--keywords, -k <kw>` | New keywords |
|
|
202
|
-
| `--agent, -a <name>` |
|
|
333
|
+
| `--keywords, -k <kw>` | New keywords (for keyword trigger) |
|
|
334
|
+
| `--agent, -a <name>` | Move to different agent |
|
|
203
335
|
|
|
204
336
|
```bash
|
|
205
337
|
agentrem edit abc12345 --priority 1
|
|
206
338
|
agentrem edit abc12345 --due "+4h" --add-tags "urgent"
|
|
207
339
|
agentrem edit abc12345 --due "in 2 hours"
|
|
340
|
+
agentrem edit abc12345 --content "Updated task description"
|
|
341
|
+
agentrem edit abc12345 --tags "deploy,prod" # replace all tags
|
|
342
|
+
agentrem edit abc12345 --add-tags "critical" # add to existing
|
|
343
|
+
agentrem edit abc12345 --remove-tags "low-priority" # remove specific
|
|
208
344
|
```
|
|
209
345
|
|
|
346
|
+
---
|
|
347
|
+
|
|
210
348
|
### agentrem delete [id]
|
|
211
349
|
|
|
212
|
-
Delete a reminder (soft delete by default).
|
|
350
|
+
Delete a reminder (soft delete by default — recoverable via `undo`).
|
|
213
351
|
|
|
214
352
|
| Flag | Description |
|
|
215
353
|
|------|-------------|
|
|
216
354
|
| `--permanent` | Hard delete (cannot be undone) |
|
|
217
355
|
| `--status <status>` | Bulk delete by status |
|
|
218
|
-
| `--older-than <days>` |
|
|
356
|
+
| `--older-than <days>` | Combined with `--status` to filter by age |
|
|
219
357
|
|
|
220
358
|
```bash
|
|
221
|
-
agentrem delete abc12345 # Soft delete
|
|
359
|
+
agentrem delete abc12345 # Soft delete (recoverable)
|
|
222
360
|
agentrem delete abc12345 --permanent # Hard delete
|
|
223
|
-
agentrem delete --status expired # Bulk delete expired
|
|
361
|
+
agentrem delete --status expired # Bulk soft-delete all expired
|
|
362
|
+
agentrem delete --status completed --older-than 30 # Bulk delete old completed
|
|
224
363
|
```
|
|
225
364
|
|
|
365
|
+
---
|
|
366
|
+
|
|
226
367
|
### agentrem stats
|
|
227
368
|
|
|
228
369
|
Show statistics.
|
|
@@ -240,21 +381,29 @@ JSON output example:
|
|
|
240
381
|
```json
|
|
241
382
|
{
|
|
242
383
|
"totalActive": 12,
|
|
243
|
-
"byPriority": [
|
|
384
|
+
"byPriority": [
|
|
385
|
+
{"priority": 1, "count": 2, "label": "critical"},
|
|
386
|
+
{"priority": 3, "count": 10, "label": "normal"}
|
|
387
|
+
],
|
|
244
388
|
"overdue": 1,
|
|
245
389
|
"snoozed": 0,
|
|
246
390
|
"completedWeek": 5,
|
|
247
391
|
"expired": 0,
|
|
248
|
-
"byTrigger": [
|
|
392
|
+
"byTrigger": [
|
|
393
|
+
{"type": "time", "count": 8},
|
|
394
|
+
{"type": "session", "count": 4}
|
|
395
|
+
],
|
|
249
396
|
"nextDue": {"content": "Deploy v2", "triggerAt": "2026-02-21T15:00:00"},
|
|
250
397
|
"lastCreated": "2026-02-21T12:00:00",
|
|
251
398
|
"dbSizeBytes": 65536
|
|
252
399
|
}
|
|
253
400
|
```
|
|
254
401
|
|
|
402
|
+
---
|
|
403
|
+
|
|
255
404
|
### agentrem history [id]
|
|
256
405
|
|
|
257
|
-
View audit trail.
|
|
406
|
+
View audit trail of reminder changes.
|
|
258
407
|
|
|
259
408
|
| Flag | Description |
|
|
260
409
|
|------|-------------|
|
|
@@ -266,20 +415,25 @@ View audit trail.
|
|
|
266
415
|
agentrem history # All recent
|
|
267
416
|
agentrem history abc12345 # For specific reminder
|
|
268
417
|
agentrem history --json # Structured output
|
|
418
|
+
agentrem history --limit 50
|
|
269
419
|
```
|
|
270
420
|
|
|
421
|
+
---
|
|
422
|
+
|
|
271
423
|
### agentrem undo <history_id>
|
|
272
424
|
|
|
273
425
|
Revert a specific change from the audit history.
|
|
274
426
|
|
|
275
427
|
```bash
|
|
276
|
-
agentrem history abc12345
|
|
277
|
-
agentrem undo 42
|
|
428
|
+
agentrem history abc12345 # Find the history ID
|
|
429
|
+
agentrem undo 42 # Revert change #42
|
|
278
430
|
```
|
|
279
431
|
|
|
432
|
+
---
|
|
433
|
+
|
|
280
434
|
### agentrem gc
|
|
281
435
|
|
|
282
|
-
Garbage collect old completed/expired/deleted reminders.
|
|
436
|
+
Garbage collect old completed/expired/deleted reminders and VACUUM the database.
|
|
283
437
|
|
|
284
438
|
| Flag | Description |
|
|
285
439
|
|------|-------------|
|
|
@@ -292,29 +446,36 @@ agentrem gc --older-than 7 # Remove >7 days old
|
|
|
292
446
|
agentrem gc --dry-run # Preview
|
|
293
447
|
```
|
|
294
448
|
|
|
449
|
+
---
|
|
450
|
+
|
|
295
451
|
### agentrem export / import
|
|
296
452
|
|
|
297
453
|
```bash
|
|
298
|
-
agentrem export
|
|
299
|
-
agentrem export --out backup.json
|
|
300
|
-
agentrem
|
|
301
|
-
agentrem import backup.json
|
|
302
|
-
agentrem import backup.json --
|
|
303
|
-
agentrem import backup.json --
|
|
454
|
+
agentrem export # Export to ~/.agentrem/export-TIMESTAMP.json
|
|
455
|
+
agentrem export --out backup.json # Export to specific file
|
|
456
|
+
agentrem export --status active # Export only active reminders
|
|
457
|
+
agentrem import backup.json # Import (default: overwrite)
|
|
458
|
+
agentrem import backup.json --merge # Skip duplicates
|
|
459
|
+
agentrem import backup.json --replace # Replace all existing
|
|
460
|
+
agentrem import backup.json --dry-run # Preview import
|
|
304
461
|
```
|
|
305
462
|
|
|
463
|
+
---
|
|
464
|
+
|
|
306
465
|
### agentrem setup
|
|
307
466
|
|
|
308
467
|
Print integration snippets.
|
|
309
468
|
|
|
310
469
|
```bash
|
|
311
|
-
agentrem setup # Print CLAUDE.md snippet
|
|
312
|
-
agentrem setup --mcp # Print Claude Desktop MCP config
|
|
470
|
+
agentrem setup # Print CLAUDE.md / AGENTS.md snippet
|
|
471
|
+
agentrem setup --mcp # Print Claude Desktop MCP config JSON
|
|
313
472
|
```
|
|
314
473
|
|
|
474
|
+
---
|
|
475
|
+
|
|
315
476
|
### agentrem doctor
|
|
316
477
|
|
|
317
|
-
Self-diagnostic
|
|
478
|
+
Self-diagnostic. Checks DB exists, schema is valid, warns about overdue reminders and large DB size.
|
|
318
479
|
|
|
319
480
|
| Flag | Description |
|
|
320
481
|
|------|-------------|
|
|
@@ -350,29 +511,17 @@ JSON output example:
|
|
|
350
511
|
}
|
|
351
512
|
```
|
|
352
513
|
|
|
514
|
+
---
|
|
515
|
+
|
|
353
516
|
### agentrem quickstart
|
|
354
517
|
|
|
355
|
-
Interactive first-run walkthrough. Initializes the database (if needed), creates a sample reminder, runs a check, and cleans up
|
|
518
|
+
Interactive first-run walkthrough. Initializes the database (if needed), creates a sample reminder, runs a check, and cleans up.
|
|
356
519
|
|
|
357
520
|
```bash
|
|
358
521
|
agentrem quickstart
|
|
359
522
|
```
|
|
360
523
|
|
|
361
|
-
|
|
362
|
-
```
|
|
363
|
-
📦 Step 1/4: Initializing database...
|
|
364
|
-
📝 Step 2/4: Creating a sample reminder...
|
|
365
|
-
🔔 Step 3/4: Checking triggered reminders...
|
|
366
|
-
✅ Step 4/4: Completing the test reminder...
|
|
367
|
-
|
|
368
|
-
🎉 Quickstart complete! agentrem is working.
|
|
369
|
-
|
|
370
|
-
Next steps:
|
|
371
|
-
agentrem add "My first real reminder" --due "+1h" --priority 2
|
|
372
|
-
agentrem check
|
|
373
|
-
agentrem setup # Get your CLAUDE.md snippet
|
|
374
|
-
agentrem doctor # Run diagnostics anytime
|
|
375
|
-
```
|
|
524
|
+
---
|
|
376
525
|
|
|
377
526
|
### agentrem watch
|
|
378
527
|
|
|
@@ -405,8 +554,8 @@ agentrem watch --status # Show installed/running status
|
|
|
405
554
|
|
|
406
555
|
#### How polling works
|
|
407
556
|
|
|
408
|
-
- Runs
|
|
409
|
-
- Per-reminder **dedup cooldown**: once
|
|
557
|
+
- Runs check with types `time,heartbeat,session,condition` and escalation on every tick
|
|
558
|
+
- Per-reminder **dedup cooldown**: once notified, won't fire again for 5 minutes
|
|
410
559
|
- Handles SIGINT/SIGTERM for clean shutdown
|
|
411
560
|
- First check runs immediately on start
|
|
412
561
|
|
|
@@ -415,7 +564,6 @@ agentrem watch --status # Show installed/running status
|
|
|
415
564
|
**macOS (launchd):**
|
|
416
565
|
- Writes a LaunchAgent plist to `~/Library/LaunchAgents/com.agentrem.watch.plist`
|
|
417
566
|
- Logs to `~/.agentrem/logs/watch.log` and `watch.error.log`
|
|
418
|
-
- Service label: `com.agentrem.watch`
|
|
419
567
|
- `KeepAlive: true` — restarts automatically on crash
|
|
420
568
|
|
|
421
569
|
**Linux (systemd):**
|
|
@@ -433,19 +581,245 @@ agentrem watch --status # Show installed/running status
|
|
|
433
581
|
Detail: launchctl: ...
|
|
434
582
|
```
|
|
435
583
|
|
|
436
|
-
|
|
584
|
+
---
|
|
437
585
|
|
|
438
|
-
|
|
586
|
+
### agentrem schema
|
|
587
|
+
|
|
588
|
+
Print the database schema (useful for debugging).
|
|
439
589
|
|
|
440
590
|
```bash
|
|
441
|
-
agentrem
|
|
442
|
-
# [agentrem watch] started — interval=30s agent=main
|
|
443
|
-
# [agentrem watch] 🔔 [8f103c9c] Deploy v2
|
|
444
|
-
# [agentrem watch] checked at 2026-02-22T09:00:00.000Z — 1 triggered, 1 notified
|
|
591
|
+
agentrem schema
|
|
445
592
|
```
|
|
446
593
|
|
|
447
594
|
---
|
|
448
595
|
|
|
596
|
+
## Programmatic JavaScript / TypeScript API
|
|
597
|
+
|
|
598
|
+
Import directly from the package. The DB is auto-initialized on first call.
|
|
599
|
+
|
|
600
|
+
```bash
|
|
601
|
+
npm install agentrem
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
```typescript
|
|
605
|
+
import { add, check, list, complete, snooze, search, stats } from 'agentrem';
|
|
606
|
+
import type { Reminder, CheckResult, StatsResult } from 'agentrem';
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
### add(content, opts?)
|
|
610
|
+
|
|
611
|
+
Create a new reminder.
|
|
612
|
+
|
|
613
|
+
```typescript
|
|
614
|
+
async function add(content: string, opts?: {
|
|
615
|
+
due?: string; // Natural language or ISO datetime
|
|
616
|
+
priority?: number; // 1-5 (default: 3)
|
|
617
|
+
tags?: string; // Comma-separated tags
|
|
618
|
+
agent?: string; // Agent namespace (default: 'main')
|
|
619
|
+
context?: string; // Additional context
|
|
620
|
+
trigger?: string; // time/keyword/session/heartbeat/condition/manual
|
|
621
|
+
category?: string;
|
|
622
|
+
keywords?: string; // Comma-separated, for keyword trigger
|
|
623
|
+
recur?: string; // Recurrence: 1d, 2w, 1m
|
|
624
|
+
}): Promise<Reminder>
|
|
625
|
+
|
|
626
|
+
// Example
|
|
627
|
+
const rem = await add('Review PR #42', { due: 'tomorrow', priority: 2, tags: 'pr,review' });
|
|
628
|
+
console.log(rem.id); // UUID
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### check(opts?)
|
|
632
|
+
|
|
633
|
+
Check for triggered reminders within a token budget.
|
|
634
|
+
|
|
635
|
+
```typescript
|
|
636
|
+
async function check(opts?: {
|
|
637
|
+
type?: string; // Comma-separated trigger types (default: all)
|
|
638
|
+
budget?: number; // Token budget (default: 800)
|
|
639
|
+
agent?: string; // Agent namespace (default: 'main')
|
|
640
|
+
format?: 'text' | 'json';
|
|
641
|
+
}): Promise<{
|
|
642
|
+
included: Reminder[]; // Reminders that fired within budget
|
|
643
|
+
overflowCounts: Record<number, number>; // Count of reminders outside budget by priority
|
|
644
|
+
totalTriggered: number; // Total triggered (before budget trim)
|
|
645
|
+
}>
|
|
646
|
+
|
|
647
|
+
// Example
|
|
648
|
+
const { included, totalTriggered } = await check({ type: 'time,session', budget: 500 });
|
|
649
|
+
for (const rem of included) {
|
|
650
|
+
console.log(`[${rem.priority}] ${rem.content}`);
|
|
651
|
+
}
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
### list(opts?)
|
|
655
|
+
|
|
656
|
+
List reminders.
|
|
657
|
+
|
|
658
|
+
```typescript
|
|
659
|
+
async function list(opts?: {
|
|
660
|
+
filter?: string; // Tag substring filter (alias for tag)
|
|
661
|
+
agent?: string;
|
|
662
|
+
limit?: number; // default: 20
|
|
663
|
+
status?: string; // Comma-separated statuses (default: 'active')
|
|
664
|
+
priority?: string; // Comma-separated priorities
|
|
665
|
+
tag?: string; // Tag filter
|
|
666
|
+
}): Promise<Reminder[]>
|
|
667
|
+
|
|
668
|
+
// Example
|
|
669
|
+
const reminders = await list({ limit: 10, priority: '1,2' });
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
### complete(id, notes?)
|
|
673
|
+
|
|
674
|
+
Mark a reminder as completed.
|
|
675
|
+
|
|
676
|
+
```typescript
|
|
677
|
+
async function complete(id: string, notes?: string): Promise<Reminder>
|
|
678
|
+
|
|
679
|
+
// Example
|
|
680
|
+
const done = await complete('abc12345', 'Deployed successfully');
|
|
681
|
+
console.log(done.completed_at);
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
### snooze(id, opts)
|
|
685
|
+
|
|
686
|
+
Snooze a reminder.
|
|
687
|
+
|
|
688
|
+
```typescript
|
|
689
|
+
async function snooze(id: string, opts: { for: string }): Promise<Reminder>
|
|
690
|
+
|
|
691
|
+
// Example
|
|
692
|
+
const snoozed = await snooze('abc12345', { for: '2h' });
|
|
693
|
+
console.log(snoozed.snoozed_until);
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
### search(query, opts?)
|
|
697
|
+
|
|
698
|
+
Full-text search across content, context, tags, and notes.
|
|
699
|
+
|
|
700
|
+
```typescript
|
|
701
|
+
async function search(query: string, opts?: {
|
|
702
|
+
limit?: number; // default: 10
|
|
703
|
+
agent?: string;
|
|
704
|
+
}): Promise<Reminder[]>
|
|
705
|
+
|
|
706
|
+
// Example
|
|
707
|
+
const results = await search('deploy staging', { limit: 5 });
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
### stats(opts?)
|
|
711
|
+
|
|
712
|
+
Get reminder statistics.
|
|
713
|
+
|
|
714
|
+
```typescript
|
|
715
|
+
async function stats(opts?: { agent?: string }): Promise<{
|
|
716
|
+
totalActive: number;
|
|
717
|
+
byPriority: { priority: number; count: number; label: string }[];
|
|
718
|
+
overdue: number;
|
|
719
|
+
snoozed: number;
|
|
720
|
+
completedWeek: number;
|
|
721
|
+
expired: number;
|
|
722
|
+
byTrigger: { type: string; count: number }[];
|
|
723
|
+
nextDue: { content: string; triggerAt: string } | null;
|
|
724
|
+
lastCreated: string | null;
|
|
725
|
+
dbSizeBytes: number;
|
|
726
|
+
}>
|
|
727
|
+
|
|
728
|
+
// Example
|
|
729
|
+
const s = await stats();
|
|
730
|
+
console.log(`${s.totalActive} active, ${s.overdue} overdue`);
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
### Reminder type
|
|
734
|
+
|
|
735
|
+
```typescript
|
|
736
|
+
interface Reminder {
|
|
737
|
+
id: string; // UUID
|
|
738
|
+
content: string;
|
|
739
|
+
context: string | null;
|
|
740
|
+
trigger_type: 'time' | 'keyword' | 'condition' | 'session' | 'heartbeat' | 'manual';
|
|
741
|
+
trigger_at: string | null; // ISO datetime string (YYYY-MM-DDTHH:MM:SS)
|
|
742
|
+
trigger_config: string | null; // JSON string for keyword/condition configs
|
|
743
|
+
priority: number; // 1-5
|
|
744
|
+
tags: string | null; // Comma-separated
|
|
745
|
+
category: string | null;
|
|
746
|
+
status: 'active' | 'snoozed' | 'completed' | 'expired' | 'failed' | 'deleted';
|
|
747
|
+
snoozed_until: string | null;
|
|
748
|
+
decay_at: string | null;
|
|
749
|
+
escalation: string | null;
|
|
750
|
+
fire_count: number;
|
|
751
|
+
last_fired: string | null;
|
|
752
|
+
max_fires: number | null;
|
|
753
|
+
recur_rule: string | null; // JSON string e.g. {"interval":1,"unit":"w"}
|
|
754
|
+
recur_parent_id: string | null;
|
|
755
|
+
depends_on: string | null;
|
|
756
|
+
related_ids: string | null;
|
|
757
|
+
source: string; // 'agent' | 'user' | 'system'
|
|
758
|
+
agent: string; // default: 'main'
|
|
759
|
+
created_at: string;
|
|
760
|
+
updated_at: string;
|
|
761
|
+
completed_at: string | null;
|
|
762
|
+
notes: string | null;
|
|
763
|
+
}
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
---
|
|
767
|
+
|
|
768
|
+
## MCP Server
|
|
769
|
+
|
|
770
|
+
```bash
|
|
771
|
+
agentrem-mcp # Start MCP server (stdio transport)
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
14 tools, 4 resources, 3 prompts.
|
|
775
|
+
|
|
776
|
+
### Claude Desktop Config
|
|
777
|
+
|
|
778
|
+
```json
|
|
779
|
+
{
|
|
780
|
+
"mcpServers": {
|
|
781
|
+
"agentrem": {
|
|
782
|
+
"command": "agentrem-mcp",
|
|
783
|
+
"args": []
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
No global install:
|
|
790
|
+
|
|
791
|
+
```json
|
|
792
|
+
{
|
|
793
|
+
"mcpServers": {
|
|
794
|
+
"agentrem": {
|
|
795
|
+
"command": "npx",
|
|
796
|
+
"args": ["-y", "agentrem", "mcp"]
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
### MCP Tools
|
|
803
|
+
|
|
804
|
+
| Tool | Description |
|
|
805
|
+
|------|-------------|
|
|
806
|
+
| `add_reminder` | Create a new reminder |
|
|
807
|
+
| `check_reminders` | Check for triggered reminders |
|
|
808
|
+
| `list_reminders` | List reminders with filters |
|
|
809
|
+
| `search_reminders` | Full-text search |
|
|
810
|
+
| `complete_reminder` | Complete a reminder (handles recurrence) |
|
|
811
|
+
| `snooze_reminder` | Snooze a reminder |
|
|
812
|
+
| `edit_reminder` | Edit reminder fields |
|
|
813
|
+
| `delete_reminder` | Delete (soft or hard) |
|
|
814
|
+
| `get_stats` | Get statistics |
|
|
815
|
+
| `get_history` | View audit trail |
|
|
816
|
+
| `undo_change` | Revert a change by history ID |
|
|
817
|
+
| `garbage_collect` | Clean up old reminders + VACUUM |
|
|
818
|
+
| `export_reminders` | Export as JSON |
|
|
819
|
+
| `import_reminders` | Import from JSON |
|
|
820
|
+
|
|
821
|
+
---
|
|
822
|
+
|
|
449
823
|
## Native Notifications
|
|
450
824
|
|
|
451
825
|
agentrem ships a custom Swift app (`Agentrem.app`) bundled in `assets/`. When present, it is preferred over all other backends.
|
|
@@ -468,12 +842,10 @@ agentrem ships a custom Swift app (`Agentrem.app`) bundled in `assets/`. When pr
|
|
|
468
842
|
| P3 Normal | Pop |
|
|
469
843
|
| P4–P5 | (no sound) |
|
|
470
844
|
|
|
471
|
-
### Overdue Messages
|
|
472
|
-
|
|
473
|
-
The notification subtitle changes based on how overdue a reminder is:
|
|
845
|
+
### Overdue Messages (notification subtitle)
|
|
474
846
|
|
|
475
|
-
| Overdue
|
|
476
|
-
|
|
847
|
+
| Overdue | Subtitle |
|
|
848
|
+
|---------|----------|
|
|
477
849
|
| < 2 min | "just now" |
|
|
478
850
|
| < 30 min | "X min ago" |
|
|
479
851
|
| < 1 hour | "about an hour, no biggie" |
|
|
@@ -483,6 +855,8 @@ The notification subtitle changes based on how overdue a reminder is:
|
|
|
483
855
|
| < 48 hours | "it's been a whole day, dude" |
|
|
484
856
|
| 2+ days | "I've been here for N days. just saying." |
|
|
485
857
|
|
|
858
|
+
Notifications include a **Complete** button (macOS) that lets you complete the reminder from the notification banner without opening a terminal.
|
|
859
|
+
|
|
486
860
|
### Rebuilding Agentrem.app
|
|
487
861
|
|
|
488
862
|
```bash
|
|
@@ -493,7 +867,7 @@ npm run build:notify # Recompile Swift source in assets/notify-src/
|
|
|
493
867
|
|
|
494
868
|
## Date/Time Formats
|
|
495
869
|
|
|
496
|
-
All date inputs (`--due`, `--until`, `--decay`, etc.) accept:
|
|
870
|
+
All date inputs (`--due`, `--until`, `--decay`, `--snooze`, etc.) accept:
|
|
497
871
|
|
|
498
872
|
### Natural language
|
|
499
873
|
```
|
|
@@ -516,11 +890,11 @@ in 1 week
|
|
|
516
890
|
|
|
517
891
|
### ISO 8601
|
|
518
892
|
```
|
|
519
|
-
2026-02-22T09:00:00 # Full datetime
|
|
893
|
+
2026-02-22T09:00:00 # Full datetime with T separator
|
|
520
894
|
2026-02-22T09:00 # Without seconds
|
|
521
895
|
2026-02-22 09:00:00 # Space separator
|
|
522
896
|
2026-02-22 09:00 # Space, no seconds
|
|
523
|
-
2026-02-22 # Date only (00:00:00)
|
|
897
|
+
2026-02-22 # Date only (time: 00:00:00)
|
|
524
898
|
```
|
|
525
899
|
|
|
526
900
|
---
|
|
@@ -534,34 +908,38 @@ in 1 week
|
|
|
534
908
|
|
|
535
909
|
---
|
|
536
910
|
|
|
537
|
-
##
|
|
911
|
+
## Recurrence Rules
|
|
538
912
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
913
|
+
| Pattern | Meaning |
|
|
914
|
+
|---------|---------|
|
|
915
|
+
| `1d` | Daily |
|
|
916
|
+
| `2d` | Every 2 days |
|
|
917
|
+
| `1w` | Weekly |
|
|
918
|
+
| `2w` | Every 2 weeks |
|
|
919
|
+
| `1m` | Monthly (~30 days) |
|
|
543
920
|
|
|
544
|
-
|
|
921
|
+
On `agentrem complete <id>`, if the reminder has a `--recur` rule, a new reminder is automatically created with the next occurrence date.
|
|
545
922
|
|
|
546
|
-
|
|
923
|
+
---
|
|
547
924
|
|
|
548
|
-
|
|
549
|
-
{
|
|
550
|
-
"mcpServers": {
|
|
551
|
-
"agentrem": {
|
|
552
|
-
"command": "agentrem-mcp",
|
|
553
|
-
"args": []
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
```
|
|
925
|
+
## Token Budget System
|
|
558
926
|
|
|
559
|
-
|
|
927
|
+
`agentrem check --budget <n>` limits context injection to fit within your token window.
|
|
560
928
|
|
|
561
|
-
|
|
929
|
+
| Priority | Budget allocation | Truncation |
|
|
930
|
+
|----------|------------------|------------|
|
|
931
|
+
| P1 Critical | Always included | 200 chars |
|
|
932
|
+
| P2 High | Up to 60% of budget | 100 chars |
|
|
933
|
+
| P3 Normal | Up to 85% of budget | 60 chars |
|
|
934
|
+
| P4 Low | Never shown in output (counted in overflow) | — |
|
|
935
|
+
| P5 Someday | Skipped entirely | — |
|
|
562
936
|
|
|
563
|
-
|
|
937
|
+
Overflow counts are returned in the JSON output's `overflowCounts` field.
|
|
564
938
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
939
|
+
---
|
|
940
|
+
|
|
941
|
+
## Escalation
|
|
942
|
+
|
|
943
|
+
Run `agentrem check --escalate` to auto-escalate overdue reminders:
|
|
944
|
+
- P3 Normal overdue > 48h → promoted to P2 High
|
|
945
|
+
- P2 High overdue > 24h → promoted to P1 Critical
|