Skip to content

[P4-11] graff conversation export <cid> (JSONL) + graff doctor #45

@justrach

Description

@justrach

Parent: #34
Priority: P4 (CLI polish — Hermes-parity quality of life)
Branch base: release/0.1.53

Why

graff-agent's gateway/cron sidecars need to dump conversations as JSONL transcripts (Hermes uses ~/.hermes/sessions/). And hermes doctor is a beloved feature — checks provider auth, MCP servers, FS perms.

Scope

graff conversation export <cid>

  • Output JSONL — one line per turn (system / user / assistant / tool_call / tool_result).
  • --format json keeps existing single-doc dump; --format jsonl is new (default for export).
  • Default output path: ~/.graff/sessions/<cid>.jsonl; --out <path> to override.

graff doctor

  • Provider auth check (one round-trip per configured provider).
  • MCP server probe (list tools).
  • DB integrity check (PRAGMA integrity_check).
  • Skills directory readable + parses.
  • Optional --fix that writes a sample config when none exists.
  • Exit code 0 on all-pass, 1 on any failure; concise human-readable output.

Acceptance

  • graff conversation export <cid> round-trips: export → import via --conversation <path> reproduces the conversation
  • graff doctor exits non-zero when an API key is missing
  • Both commands have --porcelain output for scripting (matches existing graff convention)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureBrand new functionality, features, pages, workflows, endpoints, etc.work: complicatedThe situation is complicated, good practices used.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions