Every environment variable Mira reads, what it does, and which deployments need it.
Environment variables are how you wire Mira's secrets into your
infrastructure: GitHub App credentials, OpenRouter key, database URL,
admin password.
Non-secret review behaviour (model defaults, filter thresholds, walkthrough
toggles, etc.) now lives in the deployment-wide
mira.yaml. The env vars below are mostly
for things you don't want in a checked-in YAML file. MIRA_MODEL and
DATABASE_URL are kept as fallbacks for backwards compatibility, but
mira.yaml is the recommended place for them.
Credentials for at least one platform — GitHub, GitLab, or Forgejo — are
required. LLM credentials depend on the backend: an OpenRouter/API key for the
default OpenAI-compatible provider, the AWS credential chain for Bedrock, or a
Codex login for codex-cli. mira serve won't start without one platform
configured.
Variable
Description
OPENROUTER_API_KEY
Your OpenRouter key when using the default provider. Mira also accepts OPENAI_API_KEY as a fallback name. Not required for Bedrock, Codex CLI, or a custom unauthenticated endpoint.
MIRA_GITHUB_APP_ID
GitHub: numeric ID from your GitHub App settings page.
MIRA_GITHUB_PRIVATE_KEY
GitHub: contents of the .pem file generated when you created the GitHub App. The CLI also accepts @/path/to/key.pem syntax.
MIRA_WEBHOOK_SECRET
GitHub: random 32+ byte string. Must match the value you set in the GitHub App's webhook settings.
MIRA_GITLAB_TOKEN
GitLab: a group or project access token with the api scope. See the GitLab setup guide.
MIRA_GITLAB_WEBHOOK_SECRET
GitLab: secret token, matching the one set on the project/group webhook.
MIRA_FORGEJO_TOKEN
Forgejo: an access token with repository read/write. See the Forgejo setup guide.
MIRA_FORGEJO_WEBHOOK_SECRET
Forgejo: webhook secret, matching the one set on the repo/org webhook.
Configure these to review Forgejo (or Codeberg) pull requests. GitHub and
GitLab variables become optional when Forgejo is set. Full walkthrough:
Set up Forgejo.
Variable
Default
Description
MIRA_FORGEJO_TOKEN
—
Required for Forgejo. Access token with repository read/write. The token's user is who Mira comments as.
MIRA_FORGEJO_WEBHOOK_SECRET
—
Required for Forgejo. HMAC-SHA256 secret compared against each webhook's X-Forgejo-Signature.
MIRA_FORGEJO_API_URL
https://codeberg.org/api/v1
API base for self-hosted instances, e.g. https://git.acme.com/api/v1.
Required for the default OpenRouter setup. Not used by Bedrock or Codex CLI.
OPENAI_API_KEY
—
Accepted as a fallback for OPENROUTER_API_KEY. Don't set both.
MIRA_MODEL
anthropic/claude-sonnet-4-6
Deployment-wide default model. Per-repo .mira.yaml overrides this. See Choosing a model.
MIRA_MODELS_JSON_PATH
unset (bundled registry)
Path to your own models.json to add custom models or override bundled pricing/labels/recommendations — entries merge over the bundled list by id. See Custom pricing and recommendations.
CODEX_HOME
Codex CLI default
Directory containing auth.json from codex login when llm.provider: codex-cli. Can instead be set with deployment-only llm.codex_home. Mount it read-only in containers.
Initial admin password. Leave unset and Mira generates a random one on first start and writes it to <MIRA_INDEX_DIR>/initial_admin_password (mode 0600) — log in, change it, then delete the file. There is no built-in default account.
MIRA_DASHBOARD_URL
unset
Public URL of the dashboard, used in PR comment links so reviewers can jump to context pages.
MIRA_UI_DIST
/app/ui_dist (Docker)
Path to the built React UI. Don't change unless you're hacking on the UI.
Comma-separated hostnames that outbound notification webhooks may target even though they resolve to a private/internal address. By default any URL resolving to a private, loopback, link-local, reserved, or metadata address is blocked (SSRF guard); list a self-hosted Slack/Mattermost/etc. host here to allow it.
# GitHub App (or use GitLab/Forgejo below — at least one platform required)export MIRA_GITHUB_APP_ID=123456export MIRA_GITHUB_PRIVATE_KEY="$(cat ./private-key.pem)"export MIRA_WEBHOOK_SECRET=replace-with-32-bytes-of-random# GitLab (alternative or in addition to GitHub)# export MIRA_GITLAB_TOKEN=glpat-your-access-token# export MIRA_GITLAB_WEBHOOK_SECRET=replace-with-32-bytes-of-random# Forgejo / Codeberg (alternative or in addition to the above)# export MIRA_FORGEJO_TOKEN=your-access-token# export MIRA_FORGEJO_WEBHOOK_SECRET=replace-with-32-bytes-of-random# LLMexport OPENROUTER_API_KEY=sk-or-v1-your-key-hereexport MIRA_MODEL=anthropic/claude-sonnet-4-6# Database (Postgres recommended for production; omit for SQLite)export DATABASE_URL=postgresql://mira:mira@db.internal:5432/mira?sslmode=require# Dashboard — omit ADMIN_PASSWORD to get a generated one written to# <MIRA_INDEX_DIR>/initial_admin_password on first startexport ADMIN_PASSWORD=replace-meexport MIRA_DASHBOARD_URL=https://mira.your-org.com
Never commit .env or private-key.pem. Use your platform's secret manager
(Fly secrets, Railway variables, Render env groups, AWS Secrets Manager,
Doppler, etc.). See the security hardening checklist.