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

  1. 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.
  2. Confirms the App is installed on the target owner. If not, prints the install URL and blocks on a manual Install click.
  3. Deposits three secrets and one variable at the chosen scope: DAYDREAM_APP_ID, DAYDREAM_APP_PRIVATE_KEY, ANTHROPIC_API_KEY, and DAYDREAM_BOT_HANDLE.
  4. Lands three workflow templates on a branch named daydream/setup-bot and opens a PR against the default branch. The three workflows subscribe to different events: daydream-review.yml to pull_request, daydream-command.yml to issue_comment, and daydream-post.yml to workflow_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:

  1. App installed on the target owner (skipped when no local App credentials).
  2. All three secrets and the bot-handle variable present (required).
  3. App permissions are a superset of the required set (skipped when no local credentials).
  4. The three workflow files exist on the default branch (required).

Back to Daydream

Daydream overview