GitHub Integration Setup
Ralph integrates with GitHub to authenticate users and create pull requests from completed work. This guide walks through the setup process.
Quick Setup
The fastest way to set up GitHub integration:
ralph auth loginThis initiates OAuth device flow authentication — no token creation needed.
Prerequisites
- A GitHub account
- Git configured with a remote pointing to a GitHub repository
Verify your remote:
git remote -vYou should see something like:
origin git@github.com:owner/repo.git (fetch)
origin git@github.com:owner/repo.git (push)Authentication
OAuth Device Flow (Recommended)
ralph auth login- Ralph displays a code and URL
- Open the URL in your browser
- Enter the code when prompted
- Authorize the Ralph application
- Return to your terminal — authentication is complete
Benefits:
- No manual token creation
- Secure OAuth flow
- Automatic token refresh
- Fine-grained permissions
Personal Access Token (Alternative)
If you prefer using a personal access token:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate a new token with
reposcope - Set the token:
ralph github set-token ghp_xxxxxVerify Setup
Check that everything is configured:
ralph authShould show:
GitHub Authentication:
Status: Authenticated
User: your-username
Method: OAuthAlso verify the repository detection:
ralph githubShould show:
GitHub Integration:
Status: Connected
Repository: owner/repo
Default branch: mainPermissions Required
Ralph requests these GitHub permissions:
| Permission | Purpose |
|---|---|
repo | Read/write access to repositories |
read:user | Read your user profile |
These permissions allow Ralph to:
- Create branches
- Create pull requests
- Push commits
- Read repository information
Project Detection
Ralph automatically detects the GitHub repository from your git remote configuration. It looks for:
- Remote named
origin - Remote URL matching
github.com
If your setup is different, ensure at least one remote points to GitHub.
Multiple Projects
Each project can have its own GitHub configuration. Ralph stores credentials globally but detects the repository per-project based on the git remote.
Disconnecting
To remove GitHub integration:
ralph auth logoutThis clears stored credentials. You can reconnect at any time with ralph auth login.
Next Steps
- Auth Methods — Detailed authentication options
- PR Creation — Configure automatic PR creation