Self-hosted bot setup
daydream setup installs Daydream as a self-hosted review bot on a GitHub
repository or organization
(daydream/bot_setup.py).
Prerequisites
- The GitHub CLI (
gh) installed and authenticated. - An Anthropic API key (passed as an argument, read from
ANTHROPIC_API_KEY, or prompted interactively).
What setup does
- Registers a GitHub App via the manifest flow. Opens a browser to an auto-submitting form that creates the App with the name "Daydream Review Bot", the required permissions, and the three webhook events. The manifest callback is bound to a 5-minute timeout.
- Confirms the App is installed on the target owner. If not, prints the install URL and blocks on a manual Install click.
- Deposits three secrets and one variable at the chosen scope:
DAYDREAM_APP_ID,DAYDREAM_APP_PRIVATE_KEY,ANTHROPIC_API_KEY, andDAYDREAM_BOT_HANDLE. - Lands three workflow templates on a branch named
daydream/setup-botand opens a PR against the default branch. The three workflows subscribe to different events:daydream-review.ymltopull_request,daydream-command.ymltoissue_comment, anddaydream-post.ymltoworkflow_run. Setup never touches the default branch directly.
The App permissions are: pull_requests: write, contents: read,
metadata: read, actions: write.
Verify
daydream setup --verify runs a read-only doctor with four checks:
- App installed on the target owner (skipped when no local App credentials).
- All three secrets and the bot-handle variable present (required).
- App permissions are a superset of the required set (skipped when no local credentials).
- The three workflow files exist on the default branch (required).