Set up GitHub integration
This guide shows you how to set up the GitHub integration.
Prerequisites
Section titled “Prerequisites”- A GitHub account
- A personal access token (PAT) with
repoandread:orgscopes - Or the
ghCLI installed and authenticated
Connect during onboarding
Section titled “Connect during onboarding”When you first launch Control Center, the onboarding flow asks for your GitHub token:
- Enter your PAT
- Control Center validates it by calling the GitHub API
- Your username and organizations are resolved
- The token is stored securely in your system keychain
If gh is installed and authenticated, Control Center detects it automatically and skips the token entry.
What the integration provides
Section titled “What the integration provides”| Feature | How it works |
|---|---|
| PR management | Open, review, and merge PRs via the GitHub REST API |
| PR polling | Periodically polls for new external PRs on linked repos |
| PR checks | Shows CI check status on PRs (GitHub Checks API) |
| Inline comments | Post review comments to GitHub when finalizing a review |
| GraphQL | Some operations use the GitHub GraphQL API for efficiency |
| User profiles | View GitHub user profiles with PR filtering |
API clients
Section titled “API clients”Control Center uses specialized dio HTTP clients:
GitHubApiClient— general REST APIGitHubPrClient— PR-specific operationsGitHubContentClient— file content and repo operationsGitHubGraphqlClient— GraphQL queries
All clients inject the auth token via a dio interceptor and map errors through error_mapper.dart.
Token storage
Section titled “Token storage”Tokens are stored via flutter_secure_storage:
- macOS: Keychain
- Windows: Credential Store
- Linux: libsecret
Never stored in shared_preferences or plain files.
GitHub service health
Section titled “GitHub service health”The GitHub status indicator in the sidebar shows the current health of GitHub’s services:
- Polls the public Statuspage API
- Shows overall indicator (none, minor, major, critical)
- Lists active incidents
This is stateless HTTP polling — no configuration needed.
Troubleshooting
Section titled “Troubleshooting”Token not working
Section titled “Token not working”- Ensure the token has
reposcope - Check if the token has expired (GitHub PATs can have expiration dates)
- Verify the token works:
curl -H "Authorization: token YOUR_TOKEN" https://api.github.com/user
gh CLI not detected
Section titled “gh CLI not detected”- Ensure
ghis in your PATH - Run
gh auth statusto verify it’s authenticated - Control Center checks for
ghduring onboarding and in Settings
Rate limiting
Section titled “Rate limiting”GitHub API has rate limits. Control Center:
- Respects rate limit headers
- Retries on 429 responses
- Uses conditional requests (ETags) where possible
If you see rate limit errors, check your token’s rate limit status.