Documentation / CLI

transcript-lake compact

Rebuild per-runtime Parquet mirrors from authoritative NDJSON partitions.

Invocation#

sh
transcript-lake [--data-dir <path>] compact [--source <runtime>] [--json]

Purpose#

Rebuild per-runtime Parquet mirrors from authoritative NDJSON partitions.

Inputs and options#

  • Optional --source <runtime> selects one of claude, codex, omp, droid, kimi, or hooks; absence selects all existing partitions.
  • --json emits the report array.
  • Requires DuckDB and the single state-writer lease.

Output and state effect#

Mutates only derived Parquet files under the selected Lake. Reports runtime, source bytes, output path, status, and successful Parquet bytes. NDJSON remains authoritative and is never removed; a DuckDB failure is returned as the command status.

Exact refusals#

  • No selected partitions: no matching partitions under <data-dir>/events (start the stream first).
  • An unsupported source is refused as unknown source "bogus" (expected one of: claude, codex, omp, droid, kimi, jeden, …, aider, hooks; `transcript-lake sources` shows each with its roots on this machine), the list being every runtime of the adapter registry.
  • Writer contention is refused as state writer lock is held by <host> pid <pid>.
  • Any positional argument is refused as compact accepts flags only.
  • An unrecognized --wat is refused as unknown compact flag: --wat.
  • Repeating --json is refused as compact received duplicate --json.

All long flags are exact and single-use. A value flag never consumes another --flag. Global --data-dir may appear anywhere in the invocation, must appear once, and selects an absolute root.

Back to the complete CLI command tree.