Before you begin
Make sure you have:Connect your GitHub account
Open Integrations
Go to Potpie → Settings → Integrations.
A GitHub account already connected to a different Potpie user cannot be merged or transferred.
How Potpie authenticates repository requests
Every repository request resolves authentication using the following priority order. Potpie tries each source in sequence and uses the first one that succeeds:GitHub App installation token — used when a GitHub App is installed on the target organization or repository. A short-lived token is generated fresh per request and never stored.
2
GH_TOKEN_LIST — a comma-separated list of personal access tokens. One is picked at random per request to distribute load across GitHub rate limits. GitHub only.3
CODE_PROVIDER_TOKEN — a single personal access token. Works across all provider types (GitHub, GitBucket, GitLab, Bitbucket).CODE_PROVIDER_USERNAME / CODE_PROVIDER_PASSWORD — basic auth, used only when no token source is available. Primarily for self-hosted GitBucket installs.List accessible repositories
Returns all repositories accessible to the authenticated user.
Filter repositories by name. Returns only repositories whose name contains the search string.
Maximum number of repositories to return in a single response.
Number of results to skip. Use with
limit to paginate through results.Create a pull request from agent changes
PR creation happens through a conversation with the Code Generation Agent — not through a direct API call. You ask the agent to make code changes, then explicitly ask it to open a PR.The agent only creates a PR when you explicitly ask for one. It will not open one automatically after making changes.
Request your code change
Send a message describing what you want changed. The agent will analyze the codebase and prepare the modification.
How tokens are stored
Encrypted at rest using Fernet symmetric encryption. Linked to your Potpie account on connection.
Stored in the
GITHUB_PRIVATE_KEY environment variable on the server. Never exposed to clients.Generated fresh per request and never persisted. Scoped to the specific installation.
Stored in the
GH_TOKEN_LIST env var. Tokens are rotated automatically across requests.Stored in the
CODE_PROVIDER_TOKEN env var. Used as a single fallback when no other source resolves.
