Set up GitHub

Create a GitHub App for Mira, configure permissions and events, generate the private key.

Mira runs as a GitHub App you own. Creating it takes ~5 minutes and is a one-time setup per organization.

Using GitLab, Forgejo, or Bitbucket Cloud? This page covers the GitHub App. All three are fully supported too — see the GitLab, Forgejo, and Bitbucket setup guides, which use an access token instead of an app.

Already have a deployment URL? Great. If not, you can fill in the webhook URL with a placeholder, deploy Mira, and then come back to update it.

1. Create the app

Go to github.com/settings/apps/new (for a personal app) or your organization's /settings/apps/new page (for an org app).

General

FieldValue
GitHub App nameWhatever you'd like users to see: Mira, acme-mira, etc. The slug becomes the bot's @mention handle.
Homepage URLYour deployment URL, or https://github.com/miracodeai/mira.
Webhook URLhttps://your-server.com/github/webhook
Webhook secretA random 32+ byte string. Save it as MIRA_WEBHOOK_SECRET.

Pick a strong webhook secret. Mira validates every webhook with HMAC-SHA256 against this value, so without it anyone who finds your webhook URL can forge events.

Permissions

Repository permissions:

PermissionAccessWhy
Pull requestsRead & writePost inline comments and walkthroughs.
ContentsRead & writeRead source files for indexing/review context, and resolve review threads — GitHub's resolveReviewThread requires contents: write, not just pull_requests: write. With only contents: read, Mira can post and minimize comments but silently fails to auto-resolve threads.
IssuesRead & writeReceive @mention comments and post replies.
MetadataReadRequired by GitHub for any app.
ChecksRead & writePublish review progress and results as a check on the PR's head commit.

Subscribe to events

  • Pull request
  • Pull request review comment
  • Issue comment
  • Push

Where can this GitHub App be installed?

Choose Any account if you want to share the app, or Only on this account if it's just for your org.

2. Generate a private key

Scroll to the bottom of the app settings page and click Generate a private key. A .pem file will download. Keep it safe, you cannot re-download it.

You'll pass the contents of this file to Mira via the MIRA_GITHUB_PRIVATE_KEY environment variable. Two formats are supported:

# Inline (good for Docker / shell)
export MIRA_GITHUB_PRIVATE_KEY="$(cat private-key.pem)"

# File reference (good for CLI invocation — note the leading @)
mira serve --private-key @./private-key.pem

3. Note the App ID

At the top of the app settings page you'll see a numeric App ID. Save it as MIRA_GITHUB_APP_ID.

4. Install the app on repositories

From your app's settings page, click Install App in the left sidebar, pick the org/account, and either select repos or install on all of them. Mira will start indexing on first install. This is normal and only happens once per repo.

5. Bot mention name (auto-detected)

Mira figures out its own @mention handle at startup: it calls GET /app once and uses the GitHub App's slug as its bot name. So if you named the app acme-mira, people mention it as @acme-mira and Mira already knows.

You only need to override this in two cases:

  • The slug lookup is failing (network restrictions, GHES proxy quirks). Mira falls back to miracodeai and logs a warning. Set MIRA_BOT_NAME to your actual slug to silence it.
  • You want Mira to listen for a different handle than its slug (e.g. a short alias).
export MIRA_BOT_NAME=acme-mira

Review status on pull requests

From Mira version 0.11.0, reviews publish a check named Mira. It appears in the checks section near the PR's merge button and in the Checks tab, with the app's bot avatar and a link back to the PR.

Review stateCheck titleResult
RunningCode Review In ProgressIn progress
Finished successfullyCode Review CompleteSuccess (green)
Stopped due to an unexpected errorCode Review FailedFailure (red)
Finished, but the enabled walkthrough summary could not be generatedCode Review Completed with WarningsNeutral

The completed check's expanded details show the number of files reviewed and comments, including the severity breakdown. A disabled walkthrough or a review skipped before walkthrough generation completes successfully without a warning.

The check reports whether the review process succeeded. A review can finish green even when it finds blockers; read the PR and inline comments for findings and the walkthrough for merge confidence.

If no check appears, confirm that the deployed version includes the change and the installation has accepted Checks: Read & write, then trigger a new review. Dry runs and reviews without a head commit SHA publish no check. Errors publishing or updating checks are logged and do not stop the review.

Upgrading from 0.10.x? The Checks permission is new in 0.11.0, so GitHub asks each installation's owner to approve it. Until they do, Mira logs a missing-permission warning and the review proceeds without a status row.

GitHub Enterprise Server

If you're running on GitHub Enterprise Server, set:

export MIRA_GITHUB_API_URL=https://github.acme-corp.com/api/v3
export MIRA_GITHUB_GRAPHQL_URL=https://github.acme-corp.com/api/graphql

Mira will route all GitHub API calls through your enterprise endpoint.

Next

On this page