Skip to main content
The Greptile CLI can review local changes against your self-hosted deployment. Developers sign in through the browser when the deployment supports it, or with an API key. CLI reviews work with GitHub and GitLab repositories. Perforce is not supported yet; Perforce changes are still reviewed through P4 Code Review.
Requires self-hosted release v0.3.286 or later. Browser sign-in requires release 202609.10 or later.

Server setup

1

Confirm CLI reviews are on

CLI reviews are on by default in the Helm chart and Docker Compose. If the CLI says CLI reviews are not enabled, set HEADLESS_REVIEW_ENABLED=true on the api service. In Helm values, set appConfig.headlessReviewEnabled: "true".
2

Onboard the repository

Connect the repository’s organization in your deployment’s web dashboard before running CLI reviews.
3

Create API keys for CI

An org admin creates API keys in the web dashboard. Each key belongs to one organization, and reviews run as the key’s owner. Developers also need a key if your deployment doesn’t support browser sign-in.

CLI setup

Point the CLI at your deployment once per machine, then sign in:
greptile login asks you to confirm the sign-in host, then opens your browser. Browser sign-in needs auth v2, which Helm installs turn on by default from release 202609.10. Without it, the CLI tells you to sign in with an API key instead:
For unattended jobs, set GREPTILE_API_KEY instead of running the prompt. Every command that sends credentials prints the deployment it’s using, such as Using Greptile at https://greptile-api.acme.internal (from settings). If the CLI points at the wrong deployment, you’ll see it.
GREPTILE_API_BASE_URL can’t point the CLI at a new deployment by itself. The CLI refuses any deployment your settings don’t already trust. This stops a malicious repo’s .envrc or CI environment from sending your API key somewhere else. Trust a deployment with greptile settings set apiBaseUrl, or accept the prompt the first time you connect.

CI recipe

Some CI users have no entry in the system’s user database, such as in distroless images or with OpenShift random UIDs. The CLI then stores its settings under $XDG_CONFIG_HOME or $HOME. Make sure the job user owns that file, that group and other users can’t write to it, and that it sits outside the checked-out repository.

Private certificate authorities

Point Node at your CA bundle. Never turn off TLS validation:
The CLI refuses to send credentials when NODE_TLS_REJECT_UNAUTHORIZED=0 is set.

Check your setup

Troubleshooting browser sign-in

If greptile login says the deployment’s OAuth resource doesn’t match its API base, set the API’s URL to its public origin. If you override OAUTH_AUDIENCE, it must equal <api-url>/mcp.

Notes and limits

  • Providers: GitHub and GitLab only. The CLI finds the repository from its git remote, so Perforce workspaces don’t work.
  • Air-gapped installs: greptile update and the update notice use the public npm registry. Mirror the greptile npm package into your internal registry or pin a version in your image, and set GREPTILE_NO_UPDATE_CHECK=1 to turn off the notice. Diagrams install a Mermaid renderer the first time they’re used. On machines without registry access, set GREPTILE_NO_AUTO_INSTALL=1 or pre-install mmdr.
  • Network: the CLI needs direct HTTPS access to your API, your web dashboard, and, for browser sign-in, your sign-in host. Use a VPN or internal DNS as needed. The CLI doesn’t support HTTP(S)_PROXY. It never contacts Greptile Cloud when pointed at your deployment.
  • Browser sign-in port: the CLI receives the sign-in callback on localhost, on the first free port from 53682 to 53691.
  • sudo -E isn’t supported with a self-hosted deployment.
  • Windows: the CLI skips the settings-file permission check. Protect the file with NTFS permissions instead.
  • One deployment at a time: sign-ins only work with the deployment they were made for. Switching deployments means signing in again, and greptile review show only lists reviews from the current account and deployment.
  • Downgrading the CLI: older CLI versions can’t use credentials saved by this version against your deployment. They ask you to sign in again.