Skip to content

Greptile CLI

Fresh

Trigger local code reviews from your terminal.

Use the Greptile CLI to run local code reviews from your terminal. This page covers Greptile CLI v3.0.1.

Review your current branch against its base branch, resume unfinished reviews, and reopen past reviews without leaving your shell.

Install

Install the CLI:

bash
npm i -g greptile

Check that the command works:

bash
greptile --version

Prerequisites

  • Sign up for a Greptile account
  • A local Git repository with commits to review

Sign in

Authenticate once on each device:

bash
greptile login

Check the signed-in account and org membership:

bash
greptile whoami

To sign out:

bash
greptile logout

Review a branch

Checkout to the branch you're working in and run a review from the repository root:

bash
git checkout new-feature
greptile review

By default, Greptile compares your current branch against the repository’s default branch, usually main, and reviews the unmerged commits on the current branch. Uncommitted changes are ignored.

Set the base branch explicitly and Greptile will compare current branch with this branch and review the unmerged commits:

bash
greptile review -b main

Resume the latest unfinished review:

bash
greptile review --resume

Show findings inline with the relevant code:

bash
greptile review --diff

!Greptile CLI review running in a terminal

Increase the surrounding code shown with inline findings (default: 15):

bash
greptile review --diff --context=25

Output formats

Use JSON when another tool needs to parse the review:

bash
greptile review --json

Use plain text for agent workflows or scripts:

bash
greptile review --agent

--agent is an alias for --text. Plain text is also used automatically when output is piped.

Reopen a past review

Open a recent review picker:

bash
greptile review show

Open a review by ID:

bash
greptile review show REVIEW_ID

Command reference

CommandWhat it does
greptile loginSign in with your Greptile account
greptile logoutSign out on this device
greptile whoamiShow account and org membership
greptile reviewReview the current branch against its base
greptile review show [ID]Reopen a past review

Review options

FlagPurpose
-b, --branch=<BRANCH>Base branch to compare against. Defaults to the repo default branch
--resumeContinue the latest unfinished review
--diffShow findings inline with the relevant code
--context=<LINES>Lines of surrounding code. Default is 15
--jsonPrint machine-readable output
--text, --agentPrint plain text. --agent is an alias for --text
--width=<COLUMNS>Set output width
--no-colorDisable colored output

Next

MCP

Use Greptile review data from your editor or coding agent.

Source

Mirrored from the official Greptile documentation. Self-contained reference copy.