Prerequisites
Before using the GitHub integration, you need:- A Potpie account
- A GitHub account with access to the repositories you want to connect
- Admin permissions on the repository or organization to install the GitHub App
Overview
The GitHub integration enables Potpie agents to interact with GitHub repositories through a GitHub App installation. The app provides secure, fine-grained access to code, pull requests, branches, and issues.Quick Start
Prerequisites
- GitHub account with repository access
- Repository admin permissions (for app installation)
- Potpie account
Setup Steps
Install Potpie GitHub App
Open Potpie GitHub App and click Install. Select repositories:
- All repositories, or
- Specific repositories only
Verify Installation
Parse a repository in Potpie to verify the connection:
- Go to New Chat
- Select the repository dropdown
- GitHub repos appear in the list
Available Tools
The GitHub integration provides 6 tools. See GitHub Tools in the Tools Reference for full documentation.| Tool | Description |
|---|---|
| Issue Fetcher | Fetch issues and pull requests |
| File Reader | Read file contents |
| Branch Creator | Create branches |
| File Committer | Modify and commit files |
| PR Creator | Create pull requests |
| PR Commenter | Add PR comments |
Self-Hosted Setup
For self-hosted Potpie instances, configure GitHub App credentials and authentication in addition to the cloud installation steps above.Backend Configuration
Add these environment variables to your deployment:GITHUB_PRIVATE_KEY— the raw PEM content of the private key generated in your GitHub App settingsCODE_PROVIDER_TOKEN— a personal access token used as a fallback for unauthenticated operationsCODE_PROVIDER_TOKEN_POOL— optional comma-separated list of tokens for distributing API rate limits
GitHub App Setup
Installation Process
-
Navigate to App Installation
- Go to github.com/apps/potpie-ai
- Or in repository: Settings → GitHub Apps
-
Grant Permissions
The Potpie GitHub App requests:
- Read: Repository contents, pull requests, issues
- Write: Pull requests, branches, commit status
- Admin: Webhooks (optional)
-
Select Repositories
- Installation ID After installation, GitHub provides an installation ID. Potpie uses this to authenticate API calls.
Authentication Flow
Key Concepts
GitHub App vs OAuth App:- GitHub App: Installation-based, fine-grained permissions, app-level auth
- OAuth App: User-based, broader permissions, user-level auth
- Short-lived (1 hour)
- Generated from a JWT signed with the private key
- Scoped to installed repositories only

