Skip to main content
OpenSRE connects to GitHub so the agent can work with issues, pull requests, repositories, Actions, and code — and correlate recent commits with incidents.

What you can do

Once GitHub is connected, the interactive-shell action agent uses github_cli (authenticated gh) for flexible reads and writes — create/list/view issues and PRs, assign, label, comment, merge, search, releases, workflow runs, and gh api — without a separate approval gate. Prefer this over shell gh / !gh. These requests stay on the action path (not the conversational gather/answer loop).

First launch (macOS & Windows)

The first time you launch the interactive shell on macOS or Windows, OpenSRE asks you to sign in to GitHub in your browser before the prompt appears. This runs the same browser device-flow sign-in as Option 1 below, then connects GitHub automatically. Sign in once and OpenSRE remembers it for future launches. You can bypass this step — for example if GitHub sign-in is unavailable:
The first-launch prompt never runs on Linux or in CI/automation, and is skipped when GitHub is already configured.

Prerequisites

  • GitHub account with repository access
  • One of: browser sign-in (recommended), a personal access token, or GitHub Copilot MCP access
  • For chat github_cli: the gh binary on PATH (OpenSRE supplies the token). Homebrew installs of OpenSRE pull gh via formula dependency; the curl installer soft-installs it when missing.

Setup

Option 1: Interactive CLI (browser sign-in)

Select GitHub when prompted, then choose Authorize in browser. OpenSRE opens GitHub’s device authorization page and prints a one-time code — approve it in your browser and the token is captured automatically. No personal access token is required. This uses GitHub’s OAuth device flow, which has no client secret. The public OAuth App client id ships with OpenSRE; override it with OPENSRE_GITHUB_OAUTH_CLIENT_ID if you register your own app. If you prefer, the same prompt lets you paste a token (PAT) instead.

Option 2: Environment variables

Option 3: Persistent store

Creating a personal access token

  1. In GitHub, go to SettingsDeveloper settingsPersonal access tokensTokens (classic)
  2. Click Generate new token
  3. Select the following scopes: repo, read:org (add write scopes if you want chat mutations via github_cli)
  4. Copy the token
For GitHub Enterprise Server, set GITHUB_MCP_URL to your enterprise MCP endpoint.

Transport modes

Verify

Expected output:

Troubleshooting

Security best practices

  • Prefer the least privilege that matches how you use OpenSRE (read-only for investigation-only; write scopes if you want chat to create/edit issues and PRs).
  • Limit token scope to the repositories OpenSRE needs.
  • Store the token in .env, not in source code.