caveat-cli 0.14.2 → 0.14.4
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 +22 -5
- package/dist/{chunk-CSXD73IX.js → chunk-EH3S6X6X.js} +9 -3
- package/dist/{chunk-CSXD73IX.js.map → chunk-EH3S6X6X.js.map} +1 -1
- package/dist/index.js +205 -37
- package/dist/index.js.map +1 -1
- package/dist/{server-BP54BTEL.js → server-P4FQZD2N.js} +2 -2
- package/package.json +16 -13
- /package/dist/{server-BP54BTEL.js.map → server-P4FQZD2N.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# caveat-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Long-term memory CLI for Claude Code and Codex — markdown + SQLite FTS5 + MCP server + agent hooks. Personal / group knowledge tool, no central shared DB.
|
|
4
4
|
|
|
5
5
|
**Source / full docs**: https://github.com/kitepon-rgb/Caveat
|
|
6
6
|
|
|
@@ -8,17 +8,28 @@ External spec gotcha knowledge base CLI — markdown + SQLite FTS5 + MCP server
|
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
npm install -g caveat-cli
|
|
11
|
-
caveat init
|
|
11
|
+
caveat init # Claude Code MCP + hooks
|
|
12
|
+
caveat codex-hook install # optional: native Codex hooks
|
|
12
13
|
```
|
|
13
14
|
|
|
14
|
-
`caveat init` (idempotent, `--dry-run` supported) does
|
|
15
|
+
`caveat init` (idempotent, `--dry-run` supported) does the Claude Code setup:
|
|
15
16
|
|
|
16
17
|
1. Scaffolds `~/.caveat/own/` (your personal knowledge repo) + `~/.caveat/index/caveat.db`
|
|
17
18
|
2. Registers the MCP server with Claude Code (`claude mcp add --scope user`)
|
|
18
|
-
3. Merges `UserPromptSubmit` / `Stop` hooks into `~/.claude/settings.json` (existing entries preserved, backup written before any change)
|
|
19
|
+
3. Merges `UserPromptSubmit` / `PostToolUse` / `PostToolUseFailure` / `Stop` hooks into `~/.claude/settings.json` (existing entries preserved, backup written before any change)
|
|
19
20
|
|
|
20
21
|
Opt-out: `--skip-claude`. `caveat uninstall` reverses the Claude Code changes without touching `~/.caveat/`. **No central DB is auto-subscribed** — add knowledge sources explicitly with `caveat community add`.
|
|
21
22
|
|
|
23
|
+
For Codex, run `caveat codex-hook diagnostics` first if you want a health check,
|
|
24
|
+
then `caveat codex-hook install`. It registers Caveat-owned
|
|
25
|
+
`UserPromptSubmit`, `PostToolUse`, and `Stop` entries in `~/.codex/hooks.json`
|
|
26
|
+
and enables Codex's native hook runtime.
|
|
27
|
+
|
|
28
|
+
With either host enabled, Caveat surfaces matching entries at three moments:
|
|
29
|
+
before prompts, after failed tools, and after struggle-heavy sessions. Stop
|
|
30
|
+
reminders are queued for the next context-capable hook tick so the agent's final
|
|
31
|
+
answer is not cluttered by hook output.
|
|
32
|
+
|
|
22
33
|
## Basic usage
|
|
23
34
|
|
|
24
35
|
```sh
|
|
@@ -31,6 +42,7 @@ caveat community remove <handle> # unsubscribe + purge db rows
|
|
|
31
42
|
caveat pull # community pull + re-index everything
|
|
32
43
|
caveat serve # http://localhost:4242 read-only portal
|
|
33
44
|
caveat uninstall # reverse `caveat init` Claude integration
|
|
45
|
+
caveat codex-hook diagnostics # inspect Codex hook availability/install state
|
|
34
46
|
```
|
|
35
47
|
|
|
36
48
|
## Sharing with a team
|
|
@@ -51,6 +63,10 @@ Exposed to Claude Code via the MCP server that `caveat init` registers:
|
|
|
51
63
|
|
|
52
64
|
Claude can autonomously pull subscribed-repo updates (safe, idempotent). Recording / updating writes to your local `~/.caveat/own/` only — sharing is done by you via `git push` to your group repo.
|
|
53
65
|
|
|
66
|
+
Codex uses native hooks rather than MCP for automatic surfacing. The optional
|
|
67
|
+
`codex-sidecar` commands remain available for bounded second opinions, review,
|
|
68
|
+
risk-check, and isolated work.
|
|
69
|
+
|
|
54
70
|
## Pointing at a different knowledge repo
|
|
55
71
|
|
|
56
72
|
If you want `~/.caveat/own/` to live elsewhere (e.g. a git-tracked directory you sync to a team repo), override in `~/.caveatrc.json`:
|
|
@@ -63,7 +79,8 @@ If you want `~/.caveat/own/` to live elsewhere (e.g. a git-tracked directory you
|
|
|
63
79
|
|
|
64
80
|
- Node 22.5+ (for built-in `node:sqlite`)
|
|
65
81
|
- `git` for `caveat community add` / `caveat community pull`
|
|
66
|
-
- Claude Code installed if you want MCP / hooks integration. Without it, `caveat init --skip-claude` still provisions local state.
|
|
82
|
+
- Claude Code installed if you want Claude MCP / hooks integration. Without it, `caveat init --skip-claude` still provisions local state.
|
|
83
|
+
- Codex installed if you want native Codex hooks via `caveat codex-hook install`.
|
|
67
84
|
|
|
68
85
|
## License
|
|
69
86
|
|
|
@@ -14404,7 +14404,9 @@ function findCaveatsForPrompt(db, prompt, opts = {}) {
|
|
|
14404
14404
|
entry = {
|
|
14405
14405
|
groups: /* @__PURE__ */ new Set(),
|
|
14406
14406
|
symptomTokens: /* @__PURE__ */ new Set(),
|
|
14407
|
+
topicalTokens: /* @__PURE__ */ new Set(),
|
|
14407
14408
|
symptomLower: typeof row.symptom_text === "string" && row.symptom_text.length > 0 ? row.symptom_text.toLowerCase() : null,
|
|
14409
|
+
topicalLower: typeof row.topical_text === "string" && row.topical_text.length > 0 ? row.topical_text.toLowerCase() : null,
|
|
14408
14410
|
row
|
|
14409
14411
|
};
|
|
14410
14412
|
perEntry.set(row.rowid, entry);
|
|
@@ -14413,6 +14415,9 @@ function findCaveatsForPrompt(db, prompt, opts = {}) {
|
|
|
14413
14415
|
if (entry.symptomLower !== null && tokenAppearsIn(tokLower, entry.symptomLower)) {
|
|
14414
14416
|
entry.symptomTokens.add(tokLower);
|
|
14415
14417
|
}
|
|
14418
|
+
if (entry.topicalLower !== null && tokenAppearsIn(tokLower, entry.topicalLower)) {
|
|
14419
|
+
entry.topicalTokens.add(tokLower);
|
|
14420
|
+
}
|
|
14416
14421
|
}
|
|
14417
14422
|
}
|
|
14418
14423
|
const validDfs = [...tokenDf.entries()].filter(([, df]) => df > 0);
|
|
@@ -14421,9 +14426,10 @@ function findCaveatsForPrompt(db, prompt, opts = {}) {
|
|
|
14421
14426
|
for (const [, df] of validDfs) if (df < minDf) minDf = df;
|
|
14422
14427
|
const rareTokens = new Set(validDfs.filter(([, df]) => df === minDf).map(([t2]) => t2));
|
|
14423
14428
|
const limit = opts.limit ?? DEFAULT_REMINDER_HIT_LIMIT;
|
|
14424
|
-
return [...perEntry.values()].filter(({ groups, symptomTokens }) => {
|
|
14429
|
+
return [...perEntry.values()].filter(({ groups, symptomTokens, topicalTokens }) => {
|
|
14425
14430
|
if (groups.size < minMatches) return false;
|
|
14426
|
-
|
|
14431
|
+
if (symptomTokens.size === 0) return false;
|
|
14432
|
+
for (const t2 of topicalTokens) if (rareTokens.has(t2)) return true;
|
|
14427
14433
|
return false;
|
|
14428
14434
|
}).sort((a, b2) => b2.groups.size - a.groups.size).slice(0, limit).map(({ row }) => toSearchResult2(row));
|
|
14429
14435
|
}
|
|
@@ -15312,4 +15318,4 @@ strip-bom-string/index.js:
|
|
|
15312
15318
|
js-yaml/dist/js-yaml.mjs:
|
|
15313
15319
|
(*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
|
|
15314
15320
|
*/
|
|
15315
|
-
//# sourceMappingURL=chunk-
|
|
15321
|
+
//# sourceMappingURL=chunk-EH3S6X6X.js.map
|