draft

Examples

Every capability has a runnable demo. No model, no session CLI, no API key, no network. Clone the repository and run any of them:

git clone https://github.com/sebastienrousseau/draft
cd draft
go run ./examples/dashboard
Example What it shows
dashboard The real full-screen TUI driven by an in-process engine — queue, phases, live preview and focus timer
providers Session providers in auto-selection order, install status, default models
grounding Claim verification against a source, ledger rendering, grounded prompt, house-rule validation
pipeline The five-phase pipeline end to end, merged multi-source drafting, streamed events
review Surgical-edit enhancement: body-only prompting, frontmatter re-attachment, set resync
frontmatter Metadata extraction, custom publisher identity, the three regeneration rules

Everyday recipes

Command What it does
draft paper.pdf Draft one paper, engine auto-selected
draft a.pdf b.pdf c.pdf Queue three papers, one draft each
draft --merge notes.md paper.pdf One draft from combined sources
draft --dry-run paper.pdf See the plan and the cost first
draft --resume paper.pdf Reuse the ledger from a failed attempt
draft --engine ollama paper.pdf Force the local model
draft --review draft.md paper.pdf Enhance an existing draft from its sources
draft --json paper.pdf One JSON object per job, for scripting

Scripting

--json emits one object per job, including per-phase timings, so a run is comparable across invocations rather than only readable:

{
  "source": "/papers/router-s.pdf",
  "output": "/drafts/2026-07-30/final/2026-07-30-router-s-final.md",
  "engine": "claude",
  "words": 1180,
  "ok": true,
  "duration_ms": 214301,
  "phases_ms": { "Extract claims": 198442, "Write article": 12903 }
}