@cerefox/memory 0.8.3 → 0.9.1

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.
@@ -10,20 +10,22 @@ Every command reads configuration from `.env` in the working directory (or envir
10
10
 
11
11
  - `CEREFOX_SUPABASE_URL` and `CEREFOX_SUPABASE_KEY` for any command that talks to Supabase
12
12
  - `OPENAI_API_KEY` (or `CEREFOX_FIREWORKS_API_KEY`) for any command that embeds (ingest, search)
13
- - `CEREFOX_DATABASE_URL` only for the `scripts/db_*.py` deployment scripts (not the `cerefox` CLI itself)
13
+ - `CEREFOX_DATABASE_URL` for `cerefox server deploy` and the contributor scripts (`bun scripts/db_*.ts`)
14
14
 
15
- Invoke any command with `uv run cerefox <subcommand>`. Inside an activated venv, `cerefox <subcommand>` works too but `uv run` is preferred (no venv activation needed; see Decision Log Q2 lesson on `uv` installation).
15
+ The CLI is the TypeScript `@cerefox/memory` package. Invoke any command as plain `cerefox <subcommand>` (installed via the installer or `npm install -g @cerefox/memory` see [`quickstart.md`](quickstart.md#1-install)).
16
+
17
+ > **v0.9 verb rename**: commands now follow a `resource verb` shape (e.g. `cerefox document get`, `cerefox project list`). The old flat verbs (`get-doc`, `list-docs`, `ingest`, `list-versions`, `config-get`, `deploy-server`, `docs`, …) are husks and have been removed — use the new forms below.
16
18
 
17
19
  ## Commands
18
20
 
19
- ### `cerefox ingest`
21
+ ### `cerefox document ingest`
20
22
 
21
- **Purpose**: ingest a markdown / PDF / DOCX file (or stdin) into the knowledge base.
23
+ **Purpose**: ingest a markdown / plain-text file (or stdin) into the knowledge base. (PDF/DOCX conversion was dropped in v0.7 — markdown/text only.)
22
24
 
23
25
  **Synopsis**:
24
26
  ```
25
- cerefox ingest [OPTIONS] [PATH]
26
- cerefox ingest --paste --title "<title>" [OPTIONS] # stdin
27
+ cerefox document ingest [OPTIONS] [PATH]
28
+ cerefox document ingest --paste --title "<title>" [OPTIONS] # stdin
27
29
  ```
28
30
 
29
31
  **Options**:
@@ -45,18 +47,18 @@ cerefox ingest --paste --title "<title>" [OPTIONS] # stdin
45
47
  **Examples**:
46
48
  ```bash
47
49
  # Minimal: ingest a file
48
- cerefox ingest notes.md
50
+ cerefox document ingest notes.md
49
51
 
50
52
  # Paste from stdin
51
- printf '# Title\n\nbody' | cerefox ingest --paste --title "Title"
53
+ printf '# Title\n\nbody' | cerefox document ingest --paste --title "Title"
52
54
 
53
55
  # Agent ingestion with full attribution
54
- cerefox ingest notes.md \
56
+ cerefox document ingest notes.md \
55
57
  --author "claude-code" --author-type "agent" \
56
58
  --project-name "research" --metadata '{"type":"design-doc"}'
57
59
 
58
60
  # Deterministic update (preferred — agents should search → grab ID → ingest)
59
- cerefox ingest --paste --title "Same Title" \
61
+ cerefox document ingest --paste --title "Same Title" \
60
62
  --document-id "abc12345-..." \
61
63
  --author "claude-code" --author-type "agent"
62
64
  ```
@@ -69,20 +71,20 @@ cerefox ingest --paste --title "Same Title" \
69
71
 
70
72
  ---
71
73
 
72
- ### `cerefox ingest-dir`
74
+ ### `cerefox document ingest-dir`
73
75
 
74
76
  **Purpose**: bulk-ingest every matching file in a directory.
75
77
 
76
78
  **Synopsis**:
77
79
  ```
78
- cerefox ingest-dir [OPTIONS] DIRECTORY
80
+ cerefox document ingest-dir [OPTIONS] DIRECTORY
79
81
  ```
80
82
 
81
83
  **Options**:
82
84
 
83
85
  | Flag | Type | Default | Description |
84
86
  |---|---|---|---|
85
- | `--pattern TEXT` | glob | `*.md` | Glob pattern. Examples: `**/*.md`, `*.pdf`. |
87
+ | `--pattern TEXT` | glob | `*.md` | Glob pattern. Examples: `**/*.md`, `*.txt`. |
86
88
  | `--project-name TEXT` (alias: `--project`, `-p`) | str | _none_ | Project to assign every document to. |
87
89
  | `--recursive / --no-recursive` | flag | `--no-recursive` | Recurse into sub-directories. |
88
90
  | `--dry-run` | flag | off | Print files that would be ingested; do nothing. |
@@ -94,11 +96,11 @@ cerefox ingest-dir [OPTIONS] DIRECTORY
94
96
  **Examples**:
95
97
  ```bash
96
98
  # Bulk import research notes with shared metadata
97
- cerefox ingest-dir ./research-notes --recursive \
99
+ cerefox document ingest-dir ./research-notes --recursive \
98
100
  --project-name "research" --metadata '{"type":"research","status":"active"}'
99
101
 
100
102
  # Re-ingest after editing files
101
- cerefox ingest-dir ./notes --update-if-exists
103
+ cerefox document ingest-dir ./notes --update-if-exists
102
104
  ```
103
105
 
104
106
  **Output**: one line per file showing `✓` (ingested), `↑` (updated), `⏭` (skipped: hash match), or `❌` (error); summary at the end.
@@ -126,6 +128,7 @@ cerefox search [OPTIONS] QUERY
126
128
  | `--alpha FLOAT` | float | `0.7` | FTS/semantic weight (hybrid only). |
127
129
  | `--min-score FLOAT` | float | `CEREFOX_MIN_SEARCH_SCORE` or `0.50` | Minimum cosine similarity (hybrid/semantic only). |
128
130
  | `--metadata-filter TEXT` (alias: `--filter`, `-f`) | JSON | _none_ | JSONB metadata containment filter, e.g. `'{"type":"decision"}'`. |
131
+ | `--only-metadata` | flag | off | Return only document titles + metadata (no chunk content / previews) — a compact listing. |
129
132
  | `--requestor TEXT` | str | `CEREFOX_REQUESTOR_NAME` or `user` | Identity recorded in the usage log. |
130
133
 
131
134
  **Examples**:
@@ -133,6 +136,7 @@ cerefox search [OPTIONS] QUERY
133
136
  cerefox search "OAuth design"
134
137
  cerefox search "decisions" --metadata-filter '{"type":"decision-log"}' --match-count 5
135
138
  cerefox search "what we tried" --mode semantic --requestor "claude-code"
139
+ cerefox search "design docs" --only-metadata
136
140
  ```
137
141
 
138
142
  **Output**: numbered result list with title, score, and 300-char preview per hit. Final line shows total results + bytes.
@@ -143,27 +147,27 @@ cerefox search "what we tried" --mode semantic --requestor "claude-code"
143
147
 
144
148
  ---
145
149
 
146
- ### `cerefox get-doc`
150
+ ### `cerefox document get`
147
151
 
148
152
  **Purpose**: print the full markdown content of a document to stdout.
149
153
 
150
154
  **Synopsis**:
151
155
  ```
152
- cerefox get-doc [OPTIONS] DOCUMENT_ID
156
+ cerefox document get [OPTIONS] DOCUMENT_ID
153
157
  ```
154
158
 
155
159
  **Options**:
156
160
 
157
161
  | Flag | Type | Default | Description |
158
162
  |---|---|---|---|
159
- | `--version-id TEXT` (alias: `--version`) | UUID | _none_ (current) | Archived version UUID — get from `cerefox list-versions`. |
163
+ | `--version-id TEXT` (alias: `--version`) | UUID | _none_ (current) | Archived version UUID — get from `cerefox document version list`. |
160
164
  | `--requestor TEXT` | str | `CEREFOX_REQUESTOR_NAME` or `user` | Identity recorded in the usage log. |
161
165
 
162
166
  **Examples**:
163
167
  ```bash
164
- cerefox get-doc abc12345-...
165
- cerefox get-doc abc12345-... --version-id <version-uuid> # archived
166
- cerefox get-doc abc12345-... | bat -l md # pipe to viewer
168
+ cerefox document get abc12345-...
169
+ cerefox document get abc12345-... --version-id <version-uuid> # archived
170
+ cerefox document get abc12345-... | bat -l md # pipe to viewer
167
171
  ```
168
172
 
169
173
  **Output**: title + metadata line, blank line, then raw markdown.
@@ -172,13 +176,13 @@ cerefox get-doc abc12345-... | bat -l md # pipe to viewer
172
176
 
173
177
  ---
174
178
 
175
- ### `cerefox list-docs`
179
+ ### `cerefox document list`
176
180
 
177
181
  **Purpose**: list documents in the knowledge base.
178
182
 
179
183
  **Synopsis**:
180
184
  ```
181
- cerefox list-docs [OPTIONS]
185
+ cerefox document list [OPTIONS]
182
186
  ```
183
187
 
184
188
  **Options**:
@@ -192,13 +196,59 @@ cerefox list-docs [OPTIONS]
192
196
 
193
197
  ---
194
198
 
195
- ### `cerefox list-versions`
199
+ ### `cerefox document edit`
200
+
201
+ **Purpose**: update a document's title and/or metadata in place, without re-ingesting content.
202
+
203
+ **Synopsis**:
204
+ ```
205
+ cerefox document edit [OPTIONS] DOCUMENT_ID
206
+ ```
207
+
208
+ **Options**:
209
+
210
+ | Flag | Type | Default | Description |
211
+ |---|---|---|---|
212
+ | `--title TEXT` | str | _unchanged_ | New document title. |
213
+ | `--set-meta TEXT` | `key=value` (repeatable) | _none_ | Set/overwrite a metadata key, e.g. `--set-meta type=decision --set-meta status=active`. |
214
+ | `--unset-meta TEXT` | key (repeatable) | _none_ | Remove a metadata key, e.g. `--unset-meta status`. |
215
+ | `--author TEXT` | str | `CEREFOX_AUTHOR_NAME` or `unknown` | Identity recorded in the audit log. |
216
+ | `--author-type [user\|agent]` | choice | `CEREFOX_AUTHOR_TYPE` or `user` | Caller type. |
217
+
218
+ Metadata-only edits do **not** create a new version. A title change re-derives the FTS vector and re-embeds current chunks.
219
+
220
+ **Examples**:
221
+ ```bash
222
+ cerefox document edit <doc-id> --title "Renamed Doc"
223
+ cerefox document edit <doc-id> --set-meta status=archived --unset-meta draft
224
+ ```
225
+
226
+ ---
227
+
228
+ ### `cerefox document restore`
229
+
230
+ **Purpose**: restore a soft-deleted (trashed) document back to active.
231
+
232
+ **Synopsis**: `cerefox document restore [OPTIONS] DOCUMENT_ID`
233
+
234
+ **Options**:
235
+
236
+ | Flag | Type | Default | Description |
237
+ |---|---|---|---|
238
+ | `--author TEXT` | str | `CEREFOX_AUTHOR_NAME` or `unknown` | Identity recorded in the audit log. |
239
+ | `--author-type [user\|agent]` | choice | `CEREFOX_AUTHOR_TYPE` or `user` | Caller type. |
240
+
241
+ Clears `deleted_at`, returning the document to search and `cerefox document list`, and writes a `restore` audit entry.
242
+
243
+ ---
244
+
245
+ ### `cerefox document version list`
196
246
 
197
247
  **Purpose**: list all archived versions of a document.
198
248
 
199
249
  **Synopsis**:
200
250
  ```
201
- cerefox list-versions [OPTIONS] DOCUMENT_ID
251
+ cerefox document version list [OPTIONS] DOCUMENT_ID
202
252
  ```
203
253
 
204
254
  **Options**:
@@ -207,19 +257,33 @@ cerefox list-versions [OPTIONS] DOCUMENT_ID
207
257
  |---|---|---|---|
208
258
  | `--requestor TEXT` | str | `CEREFOX_REQUESTOR_NAME` or `user` | Identity recorded in the usage log. |
209
259
 
210
- **Output**: table with version number, created timestamp, source, chunk/char counts, and version UUID. Pass the UUID to `cerefox get-doc --version-id <uuid>` to retrieve the archived content.
260
+ **Output**: table with version number, created timestamp, source, chunk/char counts, and version UUID. Pass the UUID to `cerefox document get --version-id <uuid>` to retrieve the archived content.
211
261
 
212
262
  **MCP equivalent**: [`cerefox_list_versions`](../../AGENT_GUIDE.md).
213
263
 
214
264
  ---
215
265
 
216
- ### `cerefox list-projects`
266
+ ### `cerefox document version archive` / `cerefox document version unarchive`
267
+
268
+ **Purpose**: mark a specific version as `archived` (protecting it from automatic version-retention cleanup), or remove that protection.
269
+
270
+ **Synopsis**:
271
+ ```
272
+ cerefox document version archive [OPTIONS] DOCUMENT_ID VERSION_ID
273
+ cerefox document version unarchive [OPTIONS] DOCUMENT_ID VERSION_ID
274
+ ```
275
+
276
+ An archived version is never deleted by the lazy version-retention sweep (see [`configuration.md` → Versioning](configuration.md#versioning)). `unarchive` makes it eligible for cleanup again. Both write an `archive` / `unarchive` audit entry.
277
+
278
+ ---
279
+
280
+ ### `cerefox project list`
217
281
 
218
282
  **Purpose**: list all projects.
219
283
 
220
284
  **Synopsis**:
221
285
  ```
222
- cerefox list-projects [OPTIONS]
286
+ cerefox project list [OPTIONS]
223
287
  ```
224
288
 
225
289
  **Options**:
@@ -232,23 +296,51 @@ cerefox list-projects [OPTIONS]
232
296
 
233
297
  ---
234
298
 
235
- ### `cerefox list-metadata-keys`
299
+ ### `cerefox project create` / `cerefox project edit` / `cerefox project delete`
300
+
301
+ **Purpose**: manage projects (the grouping documents are assigned to). CLI/web-only — there is no MCP equivalent for mutations.
302
+
303
+ **Synopsis**:
304
+ ```
305
+ cerefox project create [OPTIONS] NAME
306
+ cerefox project edit [OPTIONS] PROJECT # by id or name
307
+ cerefox project delete [OPTIONS] PROJECT
308
+ ```
309
+
310
+ **Options** (common):
311
+
312
+ | Flag | Type | Default | Description |
313
+ |---|---|---|---|
314
+ | `--description TEXT` | str | _none_ | Project description (`create` / `edit`). |
315
+ | `--name TEXT` | str | _unchanged_ | New name (`edit`). |
316
+ | `-y, --yes` | flag | off | Skip confirmation (`delete`; required for non-interactive use). |
317
+
318
+ **Examples**:
319
+ ```bash
320
+ cerefox project create research --description "Literature and design notes"
321
+ cerefox project edit research --name research-archive
322
+ cerefox project delete research-archive --yes
323
+ ```
324
+
325
+ ---
326
+
327
+ ### `cerefox metadata keys`
236
328
 
237
329
  **Purpose**: discover metadata keys used across all documents (with example values and document counts).
238
330
 
239
- **Synopsis**: `cerefox list-metadata-keys`
331
+ **Synopsis**: `cerefox metadata keys`
240
332
 
241
333
  **MCP equivalent**: [`cerefox_list_metadata_keys`](../../AGENT_GUIDE.md).
242
334
 
243
335
  ---
244
336
 
245
- ### `cerefox metadata-search`
337
+ ### `cerefox metadata search`
246
338
 
247
339
  **Purpose**: find documents by metadata key-value criteria (no text query needed).
248
340
 
249
341
  **Synopsis**:
250
342
  ```
251
- cerefox metadata-search --metadata-filter '<json>' [OPTIONS]
343
+ cerefox metadata search --metadata-filter '<json>' [OPTIONS]
252
344
  ```
253
345
 
254
346
  **Options**:
@@ -265,21 +357,21 @@ cerefox metadata-search --metadata-filter '<json>' [OPTIONS]
265
357
 
266
358
  **Examples**:
267
359
  ```bash
268
- cerefox metadata-search --metadata-filter '{"type":"decision-log"}' --updated-since 2026-05-01
269
- cerefox metadata-search --metadata-filter '{"status":"active"}' --project-name "research" --include-content
360
+ cerefox metadata search --metadata-filter '{"type":"decision-log"}' --updated-since 2026-05-01
361
+ cerefox metadata search --metadata-filter '{"status":"active"}' --project-name "research" --include-content
270
362
  ```
271
363
 
272
364
  **MCP equivalent**: [`cerefox_metadata_search`](../../AGENT_GUIDE.md).
273
365
 
274
366
  ---
275
367
 
276
- ### `cerefox get-audit-log`
368
+ ### `cerefox audit list`
277
369
 
278
370
  **Purpose**: query the immutable audit log (who changed what, when).
279
371
 
280
372
  **Synopsis**:
281
373
  ```
282
- cerefox get-audit-log [OPTIONS]
374
+ cerefox audit list [OPTIONS]
283
375
  ```
284
376
 
285
377
  **Options**:
@@ -298,24 +390,24 @@ cerefox get-audit-log [OPTIONS]
298
390
  **Examples**:
299
391
  ```bash
300
392
  # All audit entries in the last week
301
- cerefox get-audit-log --since 2026-05-11
393
+ cerefox audit list --since 2026-05-11
302
394
 
303
395
  # All edits by a specific agent
304
- cerefox get-audit-log --author "claude-code" --operation update-content
396
+ cerefox audit list --author "claude-code" --operation update-content
305
397
 
306
398
  # JSON output, piped to jq
307
- cerefox get-audit-log --json --limit 1000 | jq 'select(.author_type == "agent")'
399
+ cerefox audit list --json --limit 1000 | jq 'select(.author_type == "agent")'
308
400
  ```
309
401
 
310
402
  **MCP equivalent**: [`cerefox_get_audit_log`](../../AGENT_GUIDE.md).
311
403
 
312
404
  ---
313
405
 
314
- ### `cerefox delete-doc`
406
+ ### `cerefox document delete`
315
407
 
316
408
  **Purpose**: **soft-delete** a document — moves it to trash, recoverable. The CLI cannot permanently delete or restore; see [Destructive operations and the trust model](access-paths.md#destructive-operations-and-the-trust-model) for the rationale.
317
409
 
318
- **Synopsis**: `cerefox delete-doc [OPTIONS] DOCUMENT_ID`
410
+ **Synopsis**: `cerefox document delete [OPTIONS] DOCUMENT_ID`
319
411
 
320
412
  **Options**:
321
413
 
@@ -327,7 +419,7 @@ cerefox get-audit-log --json --limit 1000 | jq 'select(.author_type == "agent")'
327
419
 
328
420
  **What this command does:**
329
421
  - Sets `deleted_at` on the document row. The document stays in the database.
330
- - Excludes the document from search and from `cerefox list-docs`.
422
+ - Excludes the document from search and from `cerefox document list`.
331
423
  - Writes an immutable `delete` audit-log entry with the resolved author / author_type and timestamp.
332
424
 
333
425
  **What this command does NOT do:**
@@ -340,7 +432,7 @@ cerefox get-audit-log --json --limit 1000 | jq 'select(.author_type == "agent")'
340
432
  **Agent usage**:
341
433
  ```bash
342
434
  # Required: --yes (no TTY for confirmation) + identity flags
343
- cerefox delete-doc <doc-id> --yes \
435
+ cerefox document delete <doc-id> --yes \
344
436
  --author "claude-code" --author-type "agent"
345
437
  ```
346
438
  The success message echoes the resolved author / author_type back so you can surface it to the user in your response.
@@ -349,11 +441,29 @@ The success message echoes the resolved author / author_type back so you can sur
349
441
 
350
442
  ---
351
443
 
352
- ### `cerefox reindex`
444
+ ### `cerefox server deploy`
445
+
446
+ **Purpose**: stand up *or update* the server side — schema + RPCs and all 9 Edge Functions — from the npm-bundled assets (no source clone). This is the end-user deploy path.
447
+
448
+ **Synopsis**: `cerefox server deploy [OPTIONS]`
449
+
450
+ **Options**:
451
+
452
+ | Flag | Type | Default | Description |
453
+ |---|---|---|---|
454
+ | `--schema-only` | flag | off | Deploy only schema + RPCs (skip Edge Functions). |
455
+ | `--functions-only` | flag | off | Deploy only the 9 Edge Functions (skip schema). |
456
+ | `--dry-run` | flag | off | Preview what would happen; make no changes. |
457
+
458
+ Detects fresh vs. existing databases: a fresh DB gets schema + RPCs + migration stamps; an existing DB gets pending migrations applied and `rpcs.sql` re-applied in place. There is deliberately **no `--reset`** here — the destructive wipe lives only in the contributor script `bun scripts/db_deploy.ts --reset`. See [`setup-supabase.md`](setup-supabase.md).
459
+
460
+ ---
461
+
462
+ ### `cerefox server reindex`
353
463
 
354
464
  **Purpose**: re-embed chunks (e.g. after switching embedding models or pulling a schema change like title-boosting).
355
465
 
356
- **Synopsis**: `cerefox reindex [OPTIONS]`
466
+ **Synopsis**: `cerefox server reindex [OPTIONS]`
357
467
 
358
468
  **Options**:
359
469
 
@@ -365,14 +475,15 @@ The success message echoes the resolved author / author_type back so you can sur
365
475
 
366
476
  ---
367
477
 
368
- ### `cerefox config-get` / `cerefox config-set`
478
+ ### `cerefox config list` / `cerefox config get` / `cerefox config set`
369
479
 
370
- **Purpose**: read/write runtime config in `cerefox_config` (e.g. `usage_tracking_enabled`).
480
+ **Purpose**: read/write runtime config in `cerefox_config` (e.g. `usage_tracking_enabled`, `require_requestor_identity`).
371
481
 
372
482
  **Synopsis**:
373
483
  ```
374
- cerefox config-get KEY
375
- cerefox config-set KEY VALUE
484
+ cerefox config list # all current key/value pairs
485
+ cerefox config get KEY
486
+ cerefox config set KEY VALUE
376
487
  ```
377
488
 
378
489
  Used for toggling features at runtime without a redeploy — see [Decision Log Q1 Part 2 — usage tracking opt-in](https://github.com/fstamatelopoulos/cerefox) entry.
@@ -381,7 +492,7 @@ Used for toggling features at runtime without a redeploy — see [Decision Log Q
381
492
 
382
493
  ### `cerefox web`
383
494
 
384
- **Purpose**: start the FastAPI web UI (React SPA + JSON API).
495
+ **Purpose**: start the web UI — a TypeScript Hono backend serving the React/Mantine SPA + JSON API.
385
496
 
386
497
  **Synopsis**: `cerefox web [OPTIONS]`
387
498
 
@@ -391,9 +502,8 @@ Used for toggling features at runtime without a redeploy — see [Decision Log Q
391
502
  |---|---|---|---|
392
503
  | `--host TEXT` | str | `127.0.0.1` | Bind address. |
393
504
  | `--port INTEGER` | int | `8000` | Listen port. |
394
- | `--reload` | flag | off | Auto-reload on source changes (dev). |
395
505
 
396
- Requires the frontend to be built: `cd frontend && npm install && npm run build`.
506
+ The SPA assets are bundled in the npm package; no separate build step is needed for installed users. Contributors building from source can rebuild the frontend with `cd frontend && bun install && bun run build`.
397
507
 
398
508
  ---
399
509
 
@@ -407,6 +517,38 @@ No options. See [`connect-agents.md` → Path A-Local](connect-agents.md#path-a-
407
517
 
408
518
  ---
409
519
 
520
+ ### `cerefox guides`
521
+
522
+ **Purpose**: work with the bundled Cerefox self-docs that ship inside the npm package.
523
+
524
+ **Synopsis**:
525
+ ```
526
+ cerefox guides list # list the bundled guide names
527
+ cerefox guides show <name> # print a guide to stdout
528
+ cerefox guides open <name> # open a guide in your pager / browser
529
+ cerefox guides ingest # ingest the bundled self-docs into the knowledge base
530
+ ```
531
+
532
+ `cerefox guides ingest` loads the bundled guides into the `_cerefox-self-docs` project so agents can search Cerefox usage guidance (the same step `cerefox init` offers). It replaces the old `cerefox docs` / `sync-self-docs` / `sync-docs` commands.
533
+
534
+ ---
535
+
536
+ ### Setup & maintenance commands
537
+
538
+ These flat commands handle install, configuration, and health. Run any with `--help` for details:
539
+
540
+ | Command | Purpose |
541
+ |---|---|
542
+ | `cerefox init` | Interactive first-run setup; writes `~/.cerefox/.env`, offers `server deploy` + self-docs ingest. |
543
+ | `cerefox doctor` | Diagnose the install (credentials, DB reachability, schema version). |
544
+ | `cerefox status` | Show connection + schema status. |
545
+ | `cerefox configure-agent --tool <client>` | Write MCP client config (`claude-code`, `claude-desktop`, `cursor`, `codex`, `gemini`). |
546
+ | `cerefox self-update` | Update the installed `@cerefox/memory` package. |
547
+ | `cerefox completion` | Emit a shell completion script. |
548
+ | `cerefox backup create` / `cerefox backup restore` | File-system backup / restore of the knowledge base (see [`ops-scripts.md`](ops-scripts.md)). |
549
+
550
+ ---
551
+
410
552
  ## Environment variables
411
553
 
412
554
  The CLI reads its own runtime config from environment (or `.env`). See [`configuration.md`](configuration.md) for the full list. Most relevant to CLI behaviour:
@@ -425,7 +567,7 @@ Precedence: **CLI flag > env var > built-in default**.
425
567
  |---|---|
426
568
  | `0` | Success |
427
569
  | `1` | Validation error, missing config, document-not-found, etc. — see error message |
428
- | `2` | Click argument-parsing error (invalid Choice value, missing required arg) |
570
+ | `2` | Argument-parsing error (invalid choice value, missing required arg) |
429
571
 
430
572
  ## MCP tool ↔ CLI command mapping
431
573
 
@@ -436,14 +578,14 @@ Every MCP parameter has an exact-name CLI flag (kebab-cased). Short forms exist
436
578
  | MCP tool | CLI command |
437
579
  |---|---|
438
580
  | `cerefox_search(query, match_count, project_name, metadata_filter, requestor)` | `cerefox search "<q>" --match-count N --project-name <name> --metadata-filter '<json>' --requestor <name>` |
439
- | `cerefox_ingest(title, content, project_name, metadata, update_if_exists, document_id, source, author, author_type)` (file) | `cerefox ingest <path> --title <t> --project-name <n> --metadata '<json>' --update-if-exists\|--document-id <uuid> --source <s> --author <a> --author-type <t>` |
440
- | `cerefox_ingest(...)` (paste) | `printf '...' \| cerefox ingest --paste --title "<t>"` (same flags) |
441
- | `cerefox_get_document(document_id, version_id, requestor)` | `cerefox get-doc <id> --version-id <vid> --requestor <name>` |
442
- | `cerefox_list_versions(document_id, requestor)` | `cerefox list-versions <id> --requestor <name>` |
443
- | `cerefox_list_projects(requestor)` | `cerefox list-projects --requestor <name>` |
444
- | `cerefox_list_metadata_keys()` | `cerefox list-metadata-keys` |
445
- | `cerefox_metadata_search(metadata_filter, project_name, updated_since, created_since, limit, include_content, requestor)` | `cerefox metadata-search --metadata-filter '<json>' --project-name <n> --updated-since <iso> --created-since <iso> --limit N --include-content --requestor <name>` |
446
- | `cerefox_get_audit_log(document_id, author, operation, since, until, limit, requestor)` | `cerefox get-audit-log --document-id <id> --author <a> --operation <op> --since <iso> --until <iso> --limit N --requestor <name>` |
581
+ | `cerefox_ingest(title, content, project_name, metadata, update_if_exists, document_id, source, author, author_type)` (file) | `cerefox document ingest <path> --title <t> --project-name <n> --metadata '<json>' --update-if-exists\|--document-id <uuid> --source <s> --author <a> --author-type <t>` |
582
+ | `cerefox_ingest(...)` (paste) | `printf '...' \| cerefox document ingest --paste --title "<t>"` (same flags) |
583
+ | `cerefox_get_document(document_id, version_id, requestor)` | `cerefox document get <id> --version-id <vid> --requestor <name>` |
584
+ | `cerefox_list_versions(document_id, requestor)` | `cerefox document version list <id> --requestor <name>` |
585
+ | `cerefox_list_projects(requestor)` | `cerefox project list --requestor <name>` |
586
+ | `cerefox_list_metadata_keys()` | `cerefox metadata keys` |
587
+ | `cerefox_metadata_search(metadata_filter, project_name, updated_since, created_since, limit, include_content, requestor)` | `cerefox metadata search --metadata-filter '<json>' --project-name <n> --updated-since <iso> --created-since <iso> --limit N --include-content --requestor <name>` |
588
+ | `cerefox_get_audit_log(document_id, author, operation, since, until, limit, requestor)` | `cerefox audit list --document-id <id> --author <a> --operation <op> --since <iso> --until <iso> --limit N --requestor <name>` |
447
589
 
448
590
  ## Known issues
449
591
 
@@ -453,7 +595,7 @@ None outstanding as of v0.1.17 (cerefox#27 — the `cerefox search` NameError
453
595
 
454
596
  ### Bulk-import a directory with shared metadata
455
597
  ```bash
456
- cerefox ingest-dir ./papers --recursive --pattern '*.pdf' \
598
+ cerefox document ingest-dir ./papers --recursive --pattern '*.md' \
457
599
  --project-name "literature" \
458
600
  --metadata '{"type":"paper","status":"reviewed"}'
459
601
  ```
@@ -465,7 +607,7 @@ cerefox search "the OAuth design doc" --match-count 1
465
607
 
466
608
  # Step 2: copy the id from `Doc: ... (id: <uuid>)` line
467
609
  # Step 3: update in place
468
- printf '%s' "$NEW_CONTENT" | cerefox ingest --paste \
610
+ printf '%s' "$NEW_CONTENT" | cerefox document ingest --paste \
469
611
  --title "OAuth 2.1 Design Document" \
470
612
  --document-id "<uuid>" \
471
613
  --author "claude-code" --author-type "agent"
@@ -474,7 +616,7 @@ printf '%s' "$NEW_CONTENT" | cerefox ingest --paste \
474
616
  ### Unattended sync job
475
617
  ```bash
476
618
  # In a cron job / launchd plist. Set CEREFOX_AUTHOR_NAME=sync-script in env.
477
- cd /path/to/cerefox && uv run cerefox ingest-dir ~/notes --recursive --update-if-exists
619
+ cerefox document ingest-dir ~/notes --recursive --update-if-exists
478
620
  ```
479
621
 
480
622
  ### Use the CLI from an agent's Bash tool