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 or Forgejo? This page covers the GitHub App. Both are fully supported too — see the GitLab and Forgejo setup guides, which use an access token instead of an app. Bitbucket is on the roadmap.

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 & write (optional)Surface review status as a check.

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

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