memo-cli
Overview
memo-cli is a capture-first memo CLI with an agent enrichment loop.
Default output is human-readable text. JSON is explicit and intended for service/agent callers.
Storage bootstrap is consolidated into one init schema (schema_v1.sql); upgrade
compatibility for pre-consolidation databases is not guaranteed after this consolidation.
Usage
Usage:
memo-cli [--db <path>] [--format <text|json> | --json] <command> [options]
Commands:
add <text> [--at <rfc3339>] Capture a raw memo entry
update <item_id> <text> Update a memo and reset downstream derived data
delete <item_id> --hard Hard-delete a memo and all dependent data
list [--limit <n>] [--offset <n>] List entries (default: newest first)
search <query> [--limit <n>] Search raw/derived/tags text
[--field <raw|derived|tags>[,...]]
[--match <fts|prefix|contains>]
report <week|month> [--tz <iana-tz>] Build period summaries
[--from <rfc3339>] [--to <rfc3339>]
fetch [--limit <n>] [--cursor <opaque>] Pull records for enrichment workers
apply (--input <file> | --stdin) Apply enrichment payloads
Commands
add: append one raw capture record.update: replace one raw memo text and clear derivations/workflow extension data for that item.delete --hard: permanently delete one item and all dependent rows (derivations/search/workflow anchors).item_idallocation is monotonic per database and IDs are not reused after hard delete.- Example: if
itm_00000001is hard-deleted, nextaddwill allocateitm_00000002or newer. add --at: optional explicit capture time (RFC3339). Without--at, system time is used.list: show records with deterministic ordering and optional state filters.search: run keyword/prefix search across capture and active enrichment.search --field: optional field scope, supports multi-select (example:--field raw,tags).search --match: matching mode (fts,prefix,contains), defaultfts.report: render weekly/monthly summaries with capture fallback when enrichment is missing.report --from/--to: optional explicit range (RFC3339). Use both together.fetch: machine-facing pull for pending enrichment work.apply: machine-facing write-back for normalized enrichment results.
JSON
- Text mode is the default for all commands.
--jsonis shorthand for--format json.fetchandapplyare machine-facing commands and support both--jsonand--format json.list,search, andreportalso support JSON mode for automation and dashboards.list/search/fetchmay include additive metadata fields:content_type,validation_status.reportmay include additive metadata aggregates:top_content_types,validation_status_totals.- In JSON mode, parse
stdoutonly.stderris diagnostic-only and not part of the data contract. - Exit code policy:
0success,64usage error,65input data error,1runtime failure.
Examples
Capture quickly
Agent enrichment loop
Example enrichment-batch.json payload:
Pagination note:
Human and machine reports
Runbooks
- Agent workflow:
crates/memo-cli/docs/runbooks/memo-cli-agent-workflow.md
Specs
- Command contract:
crates/memo-cli/docs/specs/memo-cli-command-contract-v1.md - JSON contract:
crates/memo-cli/docs/specs/memo-cli-json-contract-v1.md - Storage schema:
crates/memo-cli/docs/specs/memo-cli-storage-schema-v1.md - Workflow extension contract:
crates/memo-cli/docs/specs/memo-cli-workflow-extension-contract-v1.md - Release policy:
crates/memo-cli/docs/specs/memo-cli-release-policy.md