reviewtask requires GitHub authentication to access your repositories and pull request data. This guide covers all authentication methods and troubleshooting.
The easiest way to set up authentication:
reviewtask auth loginThis interactive command will guide you through creating and configuring a GitHub token.
reviewtask checks for authentication in this priority order:
export GITHUB_TOKEN="your_token_here"This method is recommended for:
- CI/CD environments
- Docker containers
- Temporary authentication
Stored in .pr-review/auth.json (automatically gitignored):
{
"github_token": "your_token_here"
}This file is created automatically when you run reviewtask auth login.
If you have the GitHub CLI installed and authenticated:
gh auth loginreviewtask will automatically use the GitHub CLI token as a fallback.
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Set expiration and select scopes:
For private repositories:
repo(Full control of private repositories)
For public repositories:
public_repo(Access public repositories)
For organization repositories:
read:org(Read org and team membership)
- Go to GitHub Settings > Developer settings > Personal access tokens > Fine-grained tokens
- Select repository access
- Set permissions:
- Repository permissions:
- Pull requests: Read
- Contents: Read
- Metadata: Read
- Account permissions:
- Organization permissions: Read (if applicable)
- Repository permissions:
reviewtask auth loginInteractive setup that:
- Prompts for GitHub token
- Tests token permissions
- Saves to local configuration
- Verifies repository access
reviewtask auth statusShows:
- Current authentication source
- Authenticated user information
- Token expiration (if available)
reviewtask auth checkPerforms detailed validation:
- Token validity
- Required permissions
- Repository access
- Rate limit status
reviewtask auth logoutRemoves local authentication configuration.
reviewtask needs access to:
- Pull requests: Read pull request data and reviews
- Issues: Access to issue comments (if reviewing issue-linked PRs)
- Repository contents: Basic repository information
- Organization membership: For organization repositories
# Check token permissions
reviewtask auth check
# Common solutions:
# 1. Verify token hasn't expired
# 2. Check required scopes are selected
# 3. Ensure token has repository access# For private repositories
# Ensure token has 'repo' scope
# For organization repositories
# Ensure token has 'read:org' scope
# Check organization's third-party access settings# Check current rate limit status
reviewtask auth check
# GitHub API rate limits:
# - Authenticated: 5,000 requests/hour
# - Unauthenticated: 60 requests/hourIf you have multiple authentication methods configured, reviewtask uses the highest priority source. To debug:
# Check which source is being used
reviewtask auth status
# Remove local config to use environment variable
reviewtask auth logout
# Unset environment variable to use GitHub CLI
unset GITHUB_TOKEN- Use minimal required scopes: Only grant necessary permissions
- Set expiration dates: Use tokens with reasonable expiration periods
- Rotate regularly: Update tokens periodically
- Monitor usage: Check GitHub's token usage in settings
- Don't commit tokens: Never commit
.pr-review/auth.jsonor tokens to git - Use secrets in CI: Store tokens in CI/CD secret management
- Limit token exposure: Avoid logging or displaying tokens
- Revoke unused tokens: Clean up old or unused tokens
For organization repositories:
- Third-party access: Ensure your organization allows personal access tokens
- SSO requirements: Enable SSO for tokens if required
- Repository permissions: Verify token has access to specific repositories
# GitHub Actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GitLab CI
variables:
GITHUB_TOKEN: $CI_GITHUB_TOKENdocker run -e GITHUB_TOKEN="$GITHUB_TOKEN" reviewtask# Add to your shell profile (.bashrc, .zshrc, etc.)
export GITHUB_TOKEN="your_token_here"For working with multiple GitHub organizations, you may need different tokens:
# Project-specific token
cd /path/to/org1/project
export GITHUB_TOKEN="org1_token"
reviewtask
# Different organization
cd /path/to/org2/project
export GITHUB_TOKEN="org2_token"
reviewtaskFor GitHub Enterprise instances:
# Set enterprise API endpoint
export GITHUB_API_URL="https://github.company.com/api/v3"
export GITHUB_TOKEN="enterprise_token"Note: reviewtask currently supports GitHub.com. Enterprise support may require additional configuration.
If you're still having authentication issues:
- Check the logs: Run with verbose mode in
.pr-review/config.json - Verify permissions: Use
reviewtask auth checkfor detailed validation - Test manually: Try accessing the GitHub API directly with your token
- Check GitHub status: Verify GitHub API is operational
For additional help, see the Troubleshooting Guide or open an issue on the GitHub repository.