Automation and integration
A pull request (PR) is a proposed change in a GitHub repository.
Continuous integration (CI) runs automation without an interactive terminal.
The command-line interface (CLI) is the daydream command.
An application programming interface (API) lets software request data from another service.
A mebibyte (MiB) is 1,048,576 bytes.
Local runs
Use a review-only run when you want a report without a fix stage:
daydream --review .
Review-only mode does not apply fixes or run tests. An interactive run can offer to post the report to an associated PR.
Use the default command for an interactive review, fix, and test run:
daydream .
Daydream asks before it applies fixes and before it commits successful fixes.
Unattended runs
Use this command only in a trusted workspace:
daydream --non-interactive --yes .
The command accepts the fix gate and an available PR-post gate without prompts.
After successful fixes and tests, it accepts the commit-and-push gate.
It removes .review-output.md after a successful run unless you set --no-cleanup.
It runs one review and fix pass.
It can run one automatic repair and test retry after a test failure.
Daydream enables non-interactive behavior when standard input is not a terminal.
The CI environment variable also enables this behavior.
The values 0, false, and an empty value do not enable this behavior.
Set --non-interactive in automation to make the choice explicit.
Post directly from a review run
Use comment mode when the current branch has an associated PR:
daydream --comment --non-interactive .
Comment mode posts findings and does not run the fix or test stages. The command fails if Daydream cannot resolve a PR. The command also fails when a required post operation fails.
Separate the review and post jobs
Use two jobs when untrusted PR code must not receive posting credentials.
CI systems can pass findings.json as an artifact.
The first job reviews the PR and writes the artifact:
daydream --review --non-interactive \
--pr-number "$PR_NUMBER" \
--findings-out findings.json \
--base "origin/$BASE_REF" .
The second job validates and posts the artifact:
daydream post-findings findings.json \
--pr "$PR_NUMBER" \
--head-sha "$HEAD_SHA" \
--repo "$REPOSITORY" \
--bot-login "$BOT_LOGIN"
Set REPOSITORY to an OWNER/REPOSITORY value. The poster requires a GitHub
token that can write pull request reviews.
post-findings accepts schema version 1 artifacts up to 1 MiB.
It compares the artifact fields with --repo, --pr, and --head-sha.
Get these option values from a trusted event or a live GitHub API request.
The command completes all validation before it writes to GitHub.
A validation failure does not write comments.
A fingerprint is a hidden identifier for a finding. The poster creates inline, file-level, or review-body comments. The finding location determines the comment type. The poster skips exact fingerprints that the bot posted before. The poster also marks stale inline comments as outdated when GitHub permits this action.
Daydream can write file comments before it creates the final review. Earlier file comments remain when the final review post fails. Use the same bot identity on each run to identify earlier comments.
Add --approve-on-clean to approve a PR with no high- or medium-severity findings.
Low or omitted severity permits approval.
An unrecognized severity blocks approval.
daydream post-findings findings.json \
--pr "$PR_NUMBER" \
--head-sha "$HEAD_SHA" \
--repo "$REPOSITORY" \
--approve-on-clean
Fix feedback from another bot
Use the self-hosted review bot workflow for review feedback from another bot.
Install the bot with the setup command, and comment the review command on the
PR. See Self-hosted bot setup.
The standalone daydream feedback command is removed in this version.
A partial run can commit and push the fixes that succeeded. A response failure produces a warning after the push.
Use shared backend, model, trajectory, archive, and unattended options with the feedback command.
See the command-line interface reference for the complete option list.
Self-hosted GitHub bot
The packaged bot uses the separate review and post design. The command workflow starts an on-demand review. The review workflow handles untrusted PR code. The post workflow receives the GitHub App credentials.
Read Self-hosted bot setup for the required secrets, runner labels, and permissions.
Run data
Automation produces the same archive format as a local run. Use the archive for run summaries, corpus builds, or benchmarks. Do not publish an artifact bundle until you inspect it for source code and credentials.
Read Artifacts and evaluation for archive and upload controls.