Copied to clipboard

tapes export

Export a captured session as JSONL.

Downloads the session's derived projection from the running tapes API and writes it verbatim — the same session→traces→spans shape the API and console serve (GET /v1/sessions/{id}/export). export owns no state and no second renderer; it streams exactly what the API returns, so the CLI and API cannot drift.

Because it calls the API, a running server is required. Pass --api-target (or set client.api_target), or start one locally with tapes serve. Session ids accept unambiguous short prefixes, so you rarely need the full UUID.

The same JSONL grain is served over HTTP for downloads: GET /v1/sessions/:id/export (one session) and GET /v1/sessions/export (a time-window bundle) render from the same code path — see Inspect › Export.

Usage

# Export a whole session (traces with their full span trees) to a file
tapes export <session-id> --api-target http://127.0.0.1:8081 -o session.jsonl

# Short prefixes resolve to the full session id
tapes export 0196fdb1 -o session.jsonl

# Turn headers only — no spans or links
tapes export <session-id> --detail traces

Output

A single JSON line: the session object (identity plus its derived rollup), its traces — each carrying its spans — and the session-scoped links, stamped with the projection schema generation. This is the API's projection verbatim; the Markdown transcript that the retired checkout command produced is not part of export.

Detail

Value Description
spans Default. Traces with their full span trees (llm, tool, agent, event spans, typed input/output content blocks).
traces Turn headers only — no spans or links.

Flags

Flag Description
--detail Export granularity: spans (traces with full spans) or traces (turn headers only). Default: spans.
-a, --api-target tapes API server URL (default: http://localhost:8081)
-o, --output Write to this path instead of stdout
Last updated: