CLI reference
Daydream uses verb-first dispatch
(daydream/cli.py).
A leading token that is not a known verb (a bare path, a leading flag, or empty
argv) routes through the default review shim. So daydream /path and
daydream review /path are equivalent.
Known verbs: review, feedback, summarize, corpus, bench,
post-findings, setup.
review (default verb)
Run a review and optional fix loop against a working tree or a PR diff.
daydream /path/to/project
The run ends with a Review Summary table showing issues found, fixes applied, and a tests PASSED or FAILED badge.
Common flags:
| Flag | Description |
|---|---|
--comment |
Review and post inline PR comments, then exit (no fix, no test) |
--review |
Review and write a report, then exit (no posting, no fix) |
--shallow |
Single-stack review (skip multi-stack auto-detection) |
--loop [N] |
Repeat review, fix, test until zero issues or N iterations (default 5) |
-s, --skill NAME |
Force a specific review skill (python, react, elixir, go, rust, ios) |
-b, --backend NAME |
Agent backend: claude, codex, or pi (default: config file, then claude) |
-m, --model MODEL |
Global default model across phases |
--branch BRANCH |
Branch to review (default: cwd HEAD) |
--base BASE |
Base ref to compare against (default: PR base, else origin/HEAD) |
--yes |
Auto-answer every yes/no gate with yes (apply fixes, commit) |
--non-interactive |
Run without prompting; take each gate's safe default |
--no-archive |
Disable automatic archival to ~/.daydream/archive/ |
--trajectory PATH |
Write trajectory JSON to this path |
--eval |
Run deterministic evaluation and store evaluation.json in archive |
Advanced flags (visible with --help-all): --worktree, --copy,
--plan, --findings-out, --pr-number, --start-at, --ignore-path,
--cleanup / --no-cleanup.
The --findings-out flag writes a strict-schema findings artifact (Phase A
output) and requires --review. The artifact is consumed by daydream post-findings for unattended PR comment posting.
corpus harvest
Walk the archive and append one bitemporal annotation per indexed run.
daydream corpus harvest
daydream corpus harvest --dry-run
daydream corpus harvest --session <prefix>
Flags:
| Flag | Default | Description |
|---|---|---|
--dry-run |
off | Score but do not write annotations |
--session PREFIX |
none | Restrict to runs whose session_id starts with PREFIX |
--cache-dir PATH |
~/.daydream/harvest-cache/ |
Directory for API backfill cache |
--archive-dir PATH |
~/.daydream/archive/ |
Archive root |
--repo-clone-root PATH |
<cache-dir>/repos/ |
Root for shallow repo clones |
--fix-applied-window-days N |
30 | Days to look back for fix-application evidence (min 1) |
--gh-spacing-sec SEC |
0.8 | Minimum seconds between GitHub API calls (min 0.0) |
corpus build
Project as_of-pinned annotations into JSONL training records.
daydream corpus build --out corpus.jsonl
daydream corpus build --out corpus.jsonl --as-of 2026-06-01T00:00:00Z
daydream corpus build --out corpus.jsonl --stratify-by stack --max-stack-share 0.6
Required: --out PATH.
Filter flags:
| Flag | Default | Description |
|---|---|---|
--skill NAME |
none | Match manifest skill exactly |
--repo SLUG |
none | Restrict to these repo slugs (repeatable) |
--label LABEL |
accepted | Admission labels (repeatable; default accepted-only) |
--include-all-labels |
off | Disable label filtering (conflicts with --label) |
--min-grounding FLOAT |
none | Drop runs below this grounding_rate |
--min-reward FLOAT |
none | Alternative admission: composite_reward >= threshold |
--status STATUS |
complete | Match manifest status exactly |
--allow-copyleft SLUG |
none | Permit specific GPL/AGPL repos (repeatable) |
Stratification:
| Flag | Default | Description |
|---|---|---|
--stratify-by stack |
none | Cap per-stack representation |
--max-stack-share FLOAT |
0.6 | Per-stack cap fraction, in (0, 1] |
Bitemporal and diagnostic:
| Flag | Default | Description |
|---|---|---|
--as-of ISO_TS |
none | UTC transaction-time pin for reproducible corpora |
--dry-run |
off | Print summary, write nothing |
--emit-schema-only |
off | Write schema.json, skip records |
corpus label
Record an authoritative human outcome label that overrides automated ones.
daydream corpus label <session-prefix> --outcome accepted
Required: --outcome with choices accepted, contested, rejected,
unknown. The unknown value is a deliberate "I looked and cannot decide"
label, distinct from unlabeled. The session prefix must match exactly one run.
Optional: --archive-dir PATH.
Human labels are stamped source = 'human' and take precedence over automated
labels in every projection. They are never deduplicated.
bench
Score deep-review findings against the offline benchmark.
daydream bench --benchmark-repo /path/to/code-review-benchmark
Required: --benchmark-repo PATH (path to a checkout of Martian's
code-review-benchmark).
Flags:
| Flag | Default | Description |
|---|---|---|
--model MODEL |
anthropic/claude-opus-4.5 |
Judge model id |
--only SELECTOR |
none | Restrict to PRs whose repo or URL contains this substring |
--limit N |
none | Cap the number of PRs processed (must be positive) |
--force |
off | Re-run PRs even if a daydream review already exists |
--score / --no-score |
on | Drive the scoring pipeline (use --no-score to skip) |
--cache-dir PATH |
<repo>/.daydream-bench/cache |
Blobless clone cache |
--trajectory-dir PATH |
<repo>/.daydream-bench/trajectories |
Trajectory output |
Scoring requires MARTIAN_API_KEY (an OpenRouter key works). The pipeline runs
Martian's step2, step2.5, and step3 modules via uv run and computes
micro-averaged precision and recall over summed TP/FP/FN counts.
feedback
Fetch bot review comments on a PR, apply fixes, push, and respond.
daydream feedback 42 --bot coderabbitai[bot] /path/to/project
Required: PR number (positional), --bot BOT_NAME. Optional: target directory
(defaults to cwd). Accepts shared flags (--backend, --model, --trajectory,
--no-archive, --eval, --non-interactive, --yes).
summarize
Print run-info markdown for a trajectory file or run directory.
daydream summarize /path/to/run
Outputs a rollup plus a per-phase breakdown table. The path can be a
trajectory JSON file or a run directory containing trajectory.json.
post-findings
Validate a Phase A findings artifact against event-derived facts and post new findings to a PR. This is the privileged, unattended Phase B poster for the GitHub Actions trigger surface.
daydream post-findings findings.json --pr 42 --head-sha abc123 --repo owner/repo
Required: --pr N, --head-sha SHA, --repo OWNER/REPO (must contain /).
The artifact path is positional.
setup
Install Daydream as a self-hosted review bot on a repository or organization.
daydream setup /path/to/project --repo owner/repo
daydream setup /path/to/project --org my-org --verify
Exactly one of --repo OWNER/REPO or --org NAME is required. Flags:
--verify (run a read-only doctor), --force (re-register the App even if
credentials already exist).