GitHub Commands
Ralph integrates with GitHub for authentication and PR creation. These commands manage that integration.
Authentication Commands
ralph auth
Show current authentication status.
ralph authOutput:
GitHub Authentication:
Status: Authenticated
User: username
Method: OAuthralph auth login
Authenticate with GitHub using OAuth device flow.
ralph auth loginThis initiates the OAuth device flow:
- Ralph displays a code and URL
- You visit the URL in your browser
- Enter the code and authorize Ralph
- Ralph stores the token securely
No token needed — this is the recommended authentication method.
ralph auth logout
Disconnect from GitHub and clear credentials.
ralph auth logoutRemoves stored GitHub credentials.
GitHub Integration Commands
ralph github
Show GitHub integration status.
ralph githubOutput:
GitHub Integration:
Status: Connected
Repository: owner/repo
Default branch: mainralph github set-token
Set a personal access token (legacy method).
ralph github set-token <token>Arguments:
| Argument | Description |
|---|---|
<token> | GitHub personal access token |
Note: Using ralph auth login with OAuth is preferred over personal access tokens.
ralph github clear-token
Remove stored GitHub credentials.
ralph github clear-tokenAlias for ralph auth logout.
OAuth vs Token Authentication
OAuth (Recommended)
ralph auth login- No token to manage or rotate
- Secure device flow authentication
- Fine-grained permissions
- Automatic token refresh
Personal Access Token (Legacy)
ralph github set-token ghp_xxxxx- Requires manual token creation
- Token must be kept secure
- Need to manage expiration
Token Permissions
Ralph requires these GitHub permissions:
| Permission | Purpose |
|---|---|
repo | Access to repositories |
read:user | Read user profile |
When using ralph auth login, you’ll see exactly what permissions are requested.
PR Creation
When authenticated, Ralph can create pull requests from completed work. This happens automatically at the end of a session when configured.
See GitHub Integration: PR Creation for configuration details.
Troubleshooting
”Not authenticated” Error
Run ralph auth login to authenticate:
ralph auth loginToken Expired
If using a personal access token, generate a new one and update:
ralph github set-token <new-token>Or switch to OAuth:
ralph auth logout
ralph auth loginWrong Repository
Ralph detects the repository from your git remote. Ensure you’re in the correct directory and have a proper remote configured:
git remote -vNext Steps
- GitHub Integration: Setup — Full setup guide
- GitHub Integration: Auth Methods — Detailed auth options