CI Setup

This page covers CI mode: automated reviews on PRs/MRs. For local/pre-commit reviews use the CLI: revue activate <key>.

New to the CLI? See the CLI activation guide to get started in your terminal.

CI mode needs four pieces: your Revue license key, an AI-provider API key, a pipeline YAML step, and provider/model config. Across all three platforms Revue uses one provider-key variable name: AI_API_KEY. The setup is identical regardless of which AI provider you pick.

1

Add your license key as a repository variable

Go to Repository settings → Repository variables and add REVUE_LICENSE_KEY (mark it Secured).

2

Add your AI-provider API key

In the same Repository variables screen add AI_API_KEY (Secured). This one variable name works for every provider.

3

Add bitbucket-pipelines.yml

image: python:3.12-slim

pipelines:
  pull-requests:
    "**":
      - step:
          name: "Revue AI Code Review"
          script:
            - pip install revue-ci --quiet
            - |
              AUTH=$(echo -n "${BITBUCKET_USERNAME}:${BITBUCKET_API_TOKEN}" | base64)
              curl -s \
                -H "Authorization: Basic ${AUTH}" \
                -H "Accept: text/plain" \
                "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}/pullrequests/${BITBUCKET_PR_ID}/diff" \
                -o /tmp/revue_pr.diff
            - |
              revue-ci review \
                --diff /tmp/revue_pr.diff \
                --platform bitbucket \
                --pr-id "${BITBUCKET_PR_ID}" \
                --workspace "${BITBUCKET_WORKSPACE}" \
                --repo-slug "${BITBUCKET_REPO_SLUG}" \
                --bb-username "${BITBUCKET_USERNAME}" \
                --bb-token "${BITBUCKET_API_TOKEN}" \
                --provider "${AI_PROVIDER:-anthropic}" \
                --model "${AI_MODEL:-claude-sonnet-4-5}" \
                --config .revue.yml
4

Choose your AI provider

Add AI_PROVIDER and AI_MODEL as repository variables alongside your AI_API_KEY. Copy the snippet for your provider:

Recommended

OpenRouter (DeepSeek-V4-Pro)

AI_PROVIDER=openrouter
AI_MODEL=deepseek/deepseek-v4-pro

Most cost-efficient. Get a key at openrouter.ai.

Anthropic (Claude)

AI_PROVIDER=anthropic
AI_MODEL=claude-sonnet-4-5

Highest quality. Uses your Anthropic API key.

OpenAI

AI_PROVIDER=openai
AI_MODEL=gpt-4o

Use your OpenAI API key.

Azure OpenAI

AI_PROVIDER=azure
AI_MODEL=gpt-4o

Set AI_API_KEY to your Azure endpoint key.

Prefer local reviews? Run revue activate <key> and review before you even open a PR. See the CLI activation guide.