hex/docs/features/transcript-cli.md

52 lines
3 KiB
Markdown

# Read retained transcripts
```ts
Agent or terminal // transcripts.cli; macOS release
├── hex history -> Timestamp, app, recorded mode, final text
│ ├── --since / --until / --app / --grep -> Filter, then limit
│ ├── --raw -> Include the stored pre-processing transcript
│ ├── --oldest-first -> Reverse timestamp order
│ └── --json -> Version 1 response, with truncation flag
└── hex meetings
├── list -> Newest first, overlapping time range, live status
├── show <id|latest> -> Markdown or versioned JSON with notes and entries
└── search <query> -> MCP's stemmed, fuzzy BM25 passages
```
Commands work beside the running app and independently of feature opt-ins.
`transcript_cli` dispatches before migration, logging, instance locking, local
API, GUI, permissions, and Hex Microphone. Read-only path resolution supports
both `hex` and legacy `voice-control` folders. Nothing is created or repaired.
Debug `meeting list/show` shares this path; recording remains debug-only.
History uses one open-file snapshot and the saved retention, so concurrent atomic
replacement cannot expose a partial write and expiry is enforced before disk
cleanup. Off retains existing entries. Missing settings default to a week;
malformed history/settings fail with an error. The same owner-only store now
holds at most 10,000 entries and 16 MiB of raw + final text, without an archive.
Already-evicted entries remain unavailable. UI search still returns at most 200;
CLI limits apply after filtering and allow up to 10,000.
Sources: [transcript_cli.rs](../../src/transcript_cli.rs),
[history.rs](../../src/history.rs), [meeting_query.rs](../../src/meeting_query.rs),
and early dispatch in [main.rs](../../src/main.rs).
[Command and JSON contracts](../transcript-cli.md) document flags and schema.
Checks in [transcript_cli_tests.rs](../../src/transcript_cli_tests.rs) cover
filters/order, retention and malformed settings, JSON snapshots, atomic-replace
reads, legacy/symlink paths, and parsing. Existing history checks cover bounded
storage, owner-only files, and expiry. Meeting query fixtures cover locks, partial
NDJSON, interrupted drafts, and search parity with MCP. These fixture checks do
not establish a signed installed-app invocation; native install evidence must be
recorded separately.
`scripts/test-transcript-cli.py <release-binary>` exercises the real command
parser against copied fixtures while holding the listener lock. It checks that
the commands create no logs or API discovery file and leave all input bytes and
modification times unchanged, with experimental microphone mode requested.
Observed October 22, 2026, on Pro before and after the Rune integration: all 35
targeted history, meeting-query, and CLI tests passed; formatting and
all-target/all-feature Clippy with `-D warnings` passed. The optimized release
binary passed the occupied-lock/no-write smoke. Claude Opus 5.5 reviewed the
implementation and integration independently and found no blockers.