Reviewate needs access to your GitHub or GitLab API to read pull requests and post review comments. There are two ways to authenticate:
| Method | Best for | Setup |
|---|---|---|
| API Token | CI pipelines, Docker, self-hosted | Set GITHUB_TOKEN or GITLAB_TOKEN env var |
| CLI Auth | Local development, quick testing | Log in with gh auth login or glab auth login |
When no token environment variable is set, Reviewate automatically falls back to the CLI tool (gh or glab), which uses your existing login session.
| Scope | Purpose |
|---|---|
repo | Full access to private repositories (read code, post comments) |
read:org | Read organization membership (optional, for org repos) |
For public repositories only, public_repo is sufficient instead of repo.
export GITHUB_TOKEN=ghp_xxxxxxxxxxxx
Fine-grained tokens offer more precise permissions:
gh)If you have the GitHub CLI installed and logged in, no token is needed:
# Log in (one-time setup)
gh auth login
# Verify your login
gh auth status
# Now run Reviewate without setting GITHUB_TOKEN
reviewate owner/repo -p 123
| Scope | Purpose |
|---|---|
api | Full API access (read MRs, post comments, read code) |
Alternatively, for read-only reviews (no comment posting):
| Scope | Purpose |
|---|---|
read_api | Read-only API access |
read_repository | Read repository code |
export GITLAB_TOKEN=glpat-xxxxxxxxxxxx
For CI/CD or shared setups, you can use group or project tokens instead of personal tokens:
apiglab)If you have the GitLab CLI installed and logged in:
# Log in (one-time setup)
glab auth login
# Verify your login
glab auth status
# Now run Reviewate without setting GITLAB_TOKEN
reviewate group/project -p 123 --platform gitlab
In CI pipelines and Docker containers, CLI tools are typically not available. You must use API tokens:
${{ secrets.GITHUB_TOKEN }} (automatic) or a custom PAT in repository secretsGITLAB_TOKEN in Settings > CI/CD > Variables-e GITHUB_TOKEN=... or --env-fileSee CI Integration for complete pipeline examples.