Skip to content

cli/sdk: burn export ledger --format jsonl #407

@willwashburn

Description

@willwashburn

Parent: #240
Split out from: #248 (scope update originally proposed in #259)

Context

burn export ledger --format jsonl was added to the CLI scope in the #259-driven scope update on #248 but never landed. Neither the SDK verb nor the CLI presenter exists today:

  • No export_ledger / equivalent symbol in crates/relayburn-sdk/src/lib.rs.
  • No Export variant in crates/relayburn-cli/src/cli.rs::Command.

Scope

SDK (relayburn-sdk)

  • New verb (e.g. relayburn_sdk::export_ledger) that streams the canonical event stream out of burn.sqlite as JSONL records.
  • Caller-supplied Write sink (so the CLI can stream straight to stdout / a file without buffering the whole ledger in memory).
  • Stable record shape — document it as the cross-version interchange format.

CLI (relayburn-cli)

  • New burn export ledger --format jsonl [--out -] subcommand.
  • --out - (default) streams to stdout; --out <path> writes to a file.
  • Honors global --ledger-path.

Acceptance

  • relayburn_sdk::export_ledger produces JSONL with one event per line against the cli-golden fixture.
  • burn export ledger --format jsonl golden-output test passes (--out - and --out <path>).
  • Output is streaming — large fixture ledger does not load fully into memory before the first line is emitted.
  • Record shape is documented (README or a doc-comment on the SDK verb) as a stable interchange format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions