Skip to content

The five subcommands

The CLI exposes five subcommands. They compose in a stable order: extract produces a draft, write consumes a draft and produces claim files, verify-refs operates on claim files, run chains the first three for batch use, and evaluate is the round-trip benchmarking harness.

Terminal window
elife-extract extract \
--doi 10.7554/eLife.95562 \
--corpus-dir <path> \
--output-dir <path>

Fetches the paper PDF, slices into agent inputs, runs the three extraction agents, reconciles. Writes draft-<slug>.json and agents-<slug>.json to --output-dir. No claim files are written.

FlagMeaningDefault
--doi (required)eLife paper DOI (e.g., 10.7554/eLife.95562)
--corpus-dirRequired (read-only at this phase, used downstream)env ELIFE_CORPUS_DIR
--output-dirWhere draft JSON landsenv ELIFE_EXTRACT_OUTPUT, then ./out
--paper-slugOverride slug derived from DOIderived from PDF metadata
--prompt-variantNamed directory under prompts/<variant>/default
--reconcile-strategyconfidence-tagged / union / intersection-only / majority-voteconfidence-tagged
--max-claimsHard cap on per-paper claim count (cost control)unlimited
--no-retry-on-thinDisable retrying agents whose output looks thinretry enabled
--model-resultsOverride Results-reader modelclaude-sonnet-4-6
--model-captionOverride Caption-reader modelclaude-sonnet-4-6
--model-structureOverride Structure-reader modelclaude-sonnet-4-6
--model-reconcileOverride reconciliation modelclaude-opus-4-6
--vertex-projectGCP projectcr-mainen
--vertex-regionVertex regioneurope-west1

Cost: ~$4-5. Time: ~5 min.

Terminal window
elife-extract write \
--draft <path>/draft-<slug>.json \
--corpus-dir <path> \
--review-mode interactive

Loads the draft, runs the chosen review mode, then writes per-claim .md files into <corpus-dir>/<slug>/.

FlagMeaningDefault
--draft (required)Path to the draft JSON from extract
--corpus-dir (required)Where claim files landenv ELIFE_CORPUS_DIR
--review-modeinteractive / external / auto-approve / dry-runinteractive

The four review modes have very different cost/quality profiles. See review modes — when to use each for the operational decision tree.

Cost: $0 (auto-approve, dry-run, interactive) or ~$2 (external). Time: <1s (auto-approve), ~5 min (external), variable (interactive based on analyst time).

Terminal window
elife-extract verify-refs \
--paper <slug> \
--corpus-dir <path>

For each role: literature-context claim in <corpus-dir>/<slug>/, queries CrossRef. Two paths:

  • confirm: claim already has a doi: at top-level frontmatter (per the schema for literature-context claims). CrossRef confirms the DOI resolves to a real paper (anti-hallucination check).
  • found: no DOI yet. Extract Author (Year) hints from claim text and slug; query CrossRef; write the highest-scoring match (score > 15) back to top-level doi:.
FlagMeaningDefault
--paperSingle paper slug. Omit to sweep entire corpus.none (sweeps all)
--corpus-dir (required)Where claim files liveenv ELIFE_CORPUS_DIR
--dry-runShow resolutions without writing backwrite enabled

Cost: $0 (CrossRef is free, polite mailto). Time: ~1s per cited paper.

Terminal window
elife-extract run \
--doi 10.7554/eLife.95562 \
--corpus-dir <path>

Chains extract + write --review-mode auto-approve + verify-refs. Useful for tests, demos, and unattended batch runs where curator-quality output isn’t needed.

Note: run defaults to --review-mode auto-approve, not external. For bulk operation with the Opus reviewer, run extract and write --review-mode external separately, or use evaluate (which exposes --review-mode).

FlagMeaningDefault
--doi (required)eLife paper DOI
--corpus-dir (required)Where claim files landenv ELIFE_CORPUS_DIR
--paper-slugOverride slugderived
--max-claimsHard cap on claimsunlimited
--reconcile-strategyReconciliation strategyconfidence-tagged
(model flags)Per-agent model overridesas in extract

Cost: ~$5 (extract) + $0 (auto-approve write) = ~$5. Time: ~5-7 min.

Terminal window
elife-extract evaluate \
--reference-dir <path-to-curated-corpus> \
--work-dir <path> \
--paper headley-2026-inhibitory-rhythms \
--review-mode external

For each named (or all) paper in the reference corpus, runs the full pipeline, scores the CLI output against the reference (claim recovery, panel agreement, role agreement, match quality), and produces a per-paper scorecard. After all papers, renders an aggregate scorecard with mean/median per metric.

FlagMeaningDefault
--reference-dir (required)Path to curated reference corpus (e.g., ~/Projects/mainenlab/elife-claim-trees/claims/)
--work-dir (required)Where per-paper artifacts and scorecards land
--paper / --papers / --allSingle paper slug, comma-separated list, or all paper-dirsnone (one required)
--review-modeauto-approve / externalexternal
--skip-existingSkip papers that already have a scorecard.jsonre-runs
(model flags)Per-agent model overridesas in extract

Use evaluate to validate prompt iterations, model substitutions, or new review modes empirically before deployment. See the iteration discipline for the workflow.

Cost: ~$10 per paper (extract + review + matcher). Time: ~15-20 min per paper sequential.

The five subcommands compose into a few standard operational shapes:

OperationCommand sequence
Curated single-paper extractionextract → analyst review → write --review-mode interactiveverify-refs
Bulk batch with Opus reviewper paper: extractwrite --review-mode externalverify-refs
Test/demo runrun --doi <DOI> (auto-approve all the way through)
Validate prompt changeevaluate --all (compares to baseline scorecard)
Inspect without writingextractwrite --review-mode dry-run
  • elife_extract/cli.py — argparse definition; ~300 lines
  • Each subcommand handler is ~30-100 lines