--plus or --apex to each run to evaluate another tier. Unavailable tiers fail rather than falling back. Each run uses review credits.
Before you start
- Install the CLI. These examples use v3.8.0 and Bash.
- Enable the repository in Greptile with an active trial or paid plan.
- Run
greptile login, or supplyGREPTILE_API_KEYthrough your CI secret store. Do not put keys in scripts or command-line arguments. - For the GitHub examples below, install and authenticate the GitHub CLI.
Review a closed PR
ReplaceOWNER/REPO, 123, and main with your repository, PR number, and target branch.
- Closed, not merged
- Merged
Fetch the PR head even if its source branch was deleted. Choose the base, then create a local branch at the PR head:This uses the target branch’s current history. For an exact historical evaluation, use a saved base commit from before the PR closed instead.
Read the results
--json writes one review object to stdout. Progress and errors go to stderr. With jq, extract the findings:
summary, confidence, confidenceReasoning, and securitySummary. comments: [] means no findings. Exit code 0 means the review completed, not that it found no bugs. Treat any nonzero exit as an incomplete run; do not score it as a clean review.
Run a batch
Pin each case’s base and head to full commit SHAs. Use unique PR numbers and no header indataset.csv:
dataset.csv in its root. It needs jq and fetch access to each commit. Each successful case keeps its full JSON plus metadata in a JSONL file; failed cases keep a log and are skipped:
refs/pull/PR_NUMBER/head to recover the PR head before building the dataset.
Score the evaluation
- Label known bugs for each diff before reading Greptile’s output.
- Match findings by behavior and location, not exact wording. Count each bug once.
- Track precision (valid findings / all findings) and recall (known bugs found / known bugs).
- Keep the CLI version, commit SHAs, tier, instructions, and review config with the results.