# Organization Settings Source: https://www.greptile.com/docs/account/organization-settings Manage your organization's name, handle, Enterprise SSO, permissions and roles, data sharing, feature tips, and deletion from Settings → Organization. Open **Settings → Organization** to manage the organization itself. Members, repositories, and code providers are covered in [Organizations & Teams](/docs/code-review/team-setup-basics). Only organization **admins** can change these settings. The one exception is **Leave**, which any member can use. ## Organization details Click **Edit** to rename the organization, then **Save Changes**. The name is a display label. URLs use the handle instead. To change the handle, see [Change organization handle](#change-organization-handle). ## Enterprise SSO Verify your domain, connect your identity provider, and optionally turn on Auto Join, Require SSO, and directory sync. Available on the Enterprise plan; other plans see **Talk to sales**. See [SSO & Identity](/docs/security/sso-and-identity). ## Permissions (Beta) Choose who Greptile responds to. **Who can use Greptile** sets all four at once; **Advanced permissions** sets them separately: * **Trigger reviews by authoring** — whose pull requests and pushes start automatic reviews * **Trigger reviews by tagging** — who can ask for a review * **Chat with Greptile** — who gets a reply * **Teach Greptile** — whose feedback becomes a memory Each defaults to everyone, including people outside your organization. Someone outside a permission gets no reply and no error. If Greptile goes quiet for part of your team, check here first. Permissions decide who Greptile answers. Review filters still decide which pull requests it reviews. ## Roles (Beta) Custom roles start from Member or Viewer and add permissions on top. They never remove one, so a role keeps whatever its base gains later. Create a role here, then assign it under **Settings → People** or from a [directory group mapping](/docs/security/sso-and-identity). Available on the Enterprise plan; other plans see **Talk to sales**. ## Data & privacy **Help us improve Greptile** is on by default. Greptile learns from your organization's review activity (comments, replies, reactions) to improve the code review agent. Turn it off to exclude your organization. Changes save automatically. ## Feature tips **New feature tips in PR comments** is on by default. When on, Greptile adds a short tip to a review comment the first time a feature is likely to help. * The first time a user replies to Greptile in a repo: a tip about [`.greptile/rules` and `.greptile/config`](/docs/code-review/greptile-config) * After repeated re-reviews of a user's pushes: a tip about fixing all findings with your coding agent Turn it off to remove tips from all review comments in the organization. ## Danger zone ### Change organization handle The handle appears in every Greptile URL for the organization. Click **Change Handle**, enter the new handle, and save. Old URLs stop working as soon as you save. There is no redirect. Every member must update bookmarks and links. ### Leave this organization Any member can leave. Click **Leave** and confirm. You lose access to the organization and all its resources, and Greptile switches you to another organization you belong to. Two rules apply: * You cannot leave your last organization. Create or join another one first. * If you are the only admin, promote another member first. The **Leave** dialog lets you pick a member and transfer admin permissions before leaving. The **Leave** card is hidden when you are the organization's only member. ### Delete this organization Admins only. Click **Delete Organization**, type `confirm deletion of organization`, and confirm. This permanently deletes the organization, cancels its subscription, and removes all its data for every member. It cannot be undone. ## Self-hosted deployments Self-hosted Greptile differs from cloud on this page in two ways: * **Enterprise SSO** is configured through the SSO service, not this page. See [SSO/SAML](/docs/security/sso). * **Feature tips** can also be disabled for the whole deployment by setting `TIPS_ENABLED=false` on the worker. ## What's next? * [Manage members and roles](/docs/code-review/team-setup-basics) * [Billing and seats](/docs/code-review-bot/billing-seats) # Analytics Dashboard Source: https://www.greptile.com/docs/analytics Track code review metrics across your organization: PRs reviewed, merge times, addressed rates, critical bugs caught, and upvote/downvote ratios. The Analytics dashboard gives you visibility into review activity, comment quality, and team performance. Access it from the **Analytics** tab. Analytics dashboard overview
Analytics dashboard
## Filters Use the filter bar at the top to scope analytics data. | Filter | Options | Notes | | - | - | - | | Teams | All teams, or select specific teams | Organization level only | | Repositories | All repositories, or select specific repos | | | Authors | All authors, or select specific authors | | | Time period | Last 7 days, Last 30 days, Last 60 days, Last 90 days | | Click **Export** to download the current analytics data. At the team level, the Teams filter is hidden since data is already scoped to that team. ## Summary cards Four headline metrics appear at the top: | Metric | Description | | - | - | | **PRs Reviewed** | Total pull requests reviewed by Greptile in the selected period | | **Avg Merge Time** | Average time from PR open to merge | | **Addressed rate** | Percentage of Greptile comments that were addressed by authors | | **Critical bugs caught** | Number of critical issues flagged by Greptile | ## Charts Each chart includes a time series and a leaderboard sidebar showing the top repositories for that metric. ### PRs reviewed A time series of pull requests reviewed per day. The leaderboard shows **Top repos by review count**. ### Critical bugs caught Tracks critical issues flagged over time. Filter by severity level: | Severity | Description | | - | - | | All Severity | All issues regardless of priority | | P0 | Highest severity | | P1 | High severity | | P2 | Medium severity | The leaderboard shows **Repos with most critical bugs**. ### Addressed rate Shows the percentage of Greptile comments addressed by PR authors over time, with an average trend line. The leaderboard shows **Top repos by addressed rate**. ### Average time to merge Tracks how long PRs take to merge. Toggle between **Mean** and other aggregation methods. The leaderboard shows **Top repos by merge time**. ### Greptile comments Displays upvote and downvote percentages for Greptile's review comments, with a ratio chart over time. Switch between **Upvote/Downvote Ratio** and other comment metrics. The leaderboard shows **Most upvoted comments**. ## Using analytics to improve reviews * **Low addressed rate?** Your rules may be too noisy. [Adjust strictness](/docs/code-review/controlling-nitpickiness) or refine [custom standards](/docs/code-review/custom-standards). * **High critical bug count in a repo?** Consider lowering the strictness threshold for that repo to catch more issues early. * **High downvote ratio?** Review your [custom context](/docs/code-review/custom-standards) rules and [train the learning system](/docs/code-review/training-the-learning-system) with consistent reactions. * **Long merge times?** Identify bottleneck repos from the leaderboard and investigate process or review load issues. # Changelog Source: https://www.greptile.com/docs/changelog The latest updates and improvements to Greptile ## Review Tiers Choose how much work Greptile puts into each review: * **Base** (1 credit) — thorough code review with full codebase context. * **Plus** (3 credits) — a deeper review for PRs that need extra scrutiny. * **Apex** (10 credits) — our most intensive review for large, complex PRs. * **Auto** — Greptile picks a tier for each PR. Set the tier for the organization in **Settings → Code Review → Greptile Review Configuration**, per repository or directory in `.greptile/config.json`, or per PR with `@greptileai review this at apex`. Tier rules set the tier for PRs that match them, and the CLI takes `--plus` and `--apex`. [Learn about review tiers →](/docs/code-review/review-tiers) ## Reorganized Dashboard Navigation New navigation bar on Greptile Dashboard * **Unified Settings page** — All of your settings now live in one place. * **Simplified top-bar** — The top bar is simplified to four tabs: Analytics, Memory, Pull Requests, and Settings — making space for new features. Settings that have moved to new places: * **Code review settings** — now in **Settings → Code Review** * **T-Rex** — now in **Settings → T-Rex** * **Enable/disable repos** — now in **Settings → Add/Remove Repos** * **Code providers** — now in **Settings → Code Providers** [Go to Dashboard →](https://app.greptile.com/) ## Usage Limits You can now set a dollar cap for additional review spend. Reviews beyond the 50 credits included per active developer in a billing period are billed at \$1/credit. When projected spend reaches the cap, Greptile skips new reviews until the next billing period or until you raise the limit. [Learn about billing and usage limits →](/docs/code-review-bot/billing-seats#usage-limits) ## Redesigned Web App The Greptile dashboard has been rebuilt with a new organization and team hierarchy. Key changes: * **Breadcrumb navigation** — Switch between organizations and teams from a single dropdown. The sidebar adapts to show organization-level or team-level pages. * **Auto-enable repositories** — Toggle in Code Review Settings to automatically enable Greptile on new repos as they're created in a GitHub org or GitLab group. * **Inheritance & Sync** — Team-level settings inherit from the organization. Sync a team back to org defaults with one click. * **Analytics dashboard** — Track PRs reviewed, addressed rate, critical bugs caught, merge times, and upvote/downvote ratios. Filter by team, repository, author, and time period. Export data. * **Redesigned onboarding** — New users joining an existing organization get a guided setup in Personal Settings: link a GitHub/GitLab profile, install the bridge app, and choose coding agents. Personal review preferences (summary, diagram, collapsible sections) are configured in the same flow. [Learn about organizations & teams →](/docs/code-review/team-setup-basics) [View the analytics dashboard →](/docs/analytics) ## Multi-Repo Context You can now give Greptile read-only access to related repositories during reviews. Add a `context.repos` field to your `.greptile/config.json` or `greptile.json` to reference shared libraries, SDKs, or other repos that help Greptile understand your code. ```json theme={} { "context": { "repos": ["acme/shared-types", "acme/payment-sdk"] } } ``` [.greptile/ reference →](/docs/code-review/greptile-config-reference#cross-repository-context) | [greptile.json reference →](/docs/code-review/greptile-json-reference#cross-repository-context) ## Severity Badges Inline review comments now display a severity badge — **P0** (critical), **P1** (high), or **P2** (medium) — so you can triage feedback at a glance. [Learn about severity levels →](/docs/code-review/first-pr-review#severity-badges) ## Review Footer Updates The review summary footer has been updated with new controls: * **Review counter** — Shows how many times Greptile has reviewed the PR (e.g. "Reviews (2)") * **Longer commit messages** — The "Last reviewed commit" link now shows more of the commit message for easier identification * **Re-trigger button** — Click "Re-trigger Greptile" in the footer to re-run a review without tagging @greptileai [See the anatomy of a review →](/docs/code-review/first-pr-review#review-footer) ## Greptile v4 Major upgrade to the review engine. v4 delivers significantly more actionable feedback across the board: | Metric | Before | After | Change | | - | - | - | - | | Addressed comments per PR | 0.92 | 1.60 | **+74%** | | Comments addressed by author | 30% | 43% | **+43%** | | Positive replies per PR | 0.31 | 0.52 | **+68%** | | Upvote reactions per PR | 0.05 | 0.08 | **+60%** | "Addressed" is determined by an LLM-as-judge evaluating whether the author acted on each comment. ## Fix in Claude Code, Codex, and Cursor Every Greptile review comment now includes a **Fix in X** button. Click it, and the issue gets sent straight to your coding agent — Claude Code, OpenAI Codex, or Cursor — with full context: file paths, line numbers, the review comment, and suggested fixes. Your agent opens, applies the fix, and you review the diff. A **Fix All** button in the review summary sends every issue at once. Greptile PR summary with Fix All button [Set up Fix in X →](/docs/integrations/fix-with-your-agent) ## Cascading Config Files `greptile.json` files can now be placed in subdirectories to override parent-level review configuration. Settings cascade from root to subdirectory, allowing teams to define org-wide defaults while customizing review behavior for specific folders or modules. [Read the configuration reference →](/docs/code-review/greptile-config-reference) ## Greptile Plugin for Claude Code Address Greptile review comments, manage custom context, and trigger reviews directly from Claude Code. Available in the official Anthropic plugin marketplace. ## Feature Discovery Code reviews now surface contextual tips highlighting relevant Greptile features based on the content of each review, such as custom rules, `greptile.json` configuration options, and integration capabilities. ## Wildcard Repository Scopes Apply rules across all repositories in an organization or group using wildcards (e.g., `myorg/*` or `groupa/subgroupb/*`). Wildcard options are automatically generated based on your connected repositories. [Learn about custom standards →](/docs/code-review/custom-standards) ## Rule Optimization Rules can now be generated and refined using AI directly from the custom context dashboard. Try it in the **+ Add Context** dialog at [app.greptile.com/review/custom-context](https://app.greptile.com/review/custom-context). ## greptile.json v3 Support `greptile.json` configuration file now supports v3 code review settings, including custom instructions, skip rules, comment types, and review triggers. [See the full configuration reference →](/docs/code-review/greptile-json-reference) ## GitLab Reverse Proxy Support Greptile can now connect to self-hosted GitLab instances routed through reverse proxies, supporting environments where GitLab is not directly accessible from the public internet. Configure your reverse proxy URL in your integration settings. [View deployment options →](/docs/deployment-options) ## Clarification Questions Reviews can now append a clarification question to an inline comment when change intent is ambiguous. Follow-up discussion happens in the same thread via implicit thread replies, with no retrigger required. [See developer essentials →](/docs/code-review/developer-essentials) ## Thread Replies Greptile now responds to follow-up comments in review threads. Ask a question, request a revision, or push back on a suggestion and Greptile replies in-thread. A classifier decides whether to respond and skips acknowledgments, approvals, or human-to-human discussion. [See developer essentials →](/docs/code-review/developer-essentials) ## Configurable Models and Turns Choose which AI model powers your reviews and set the maximum number of agentic turns per review. Configure both in your review settings to balance speed, depth, and cost. [Configure your review settings →](/docs/code-review/greptile-config) ## Code Review v3 Completely rebuilt review engine around an agentic workflow. Reviews now learn your team's standards from past GitHub and GitLab PR comments, pull context from tools like Jira and Notion, auto-detect project rule files (e.g., `CLAUDE.md`, `.cursor/rules`), and include a copy-prompt action on each comment for quick fixes in your editor. [Explore key features →](/docs/code-review/key-features) ## Greptile MCP Server Greptile is now available as an MCP server, bringing code reviews into your AI-powered development environment. Trigger and re-run reviews, inspect results, manage custom context, and update repository rules without leaving your editor. [Get started with the MCP server →](/docs/mcp-v2/overview) # Billing Source: https://www.greptile.com/docs/code-review-bot/billing-seats Understand Greptile's per-developer billing model, flex usage, credit limits, review counts, and subscription management. ## Pricing | Unit | Price | | - | - | | Active developer / month | **\$30/seat** (includes 50 credits) | | Additional credits (flex usage) | **\$1/credit** | **1 credit = 1 Base review.** Plus reviews cost 3 credits and Apex reviews cost 10. See [Review tiers](/docs/code-review/review-tiers). **3 credits = 1 [T-Rex](/docs/code-review/key-features#runtime-validation-with-t-rex-beta) review.** An **active developer** is anyone with at least one completed review charged to them in the billing period. Overages are per-author, not pooled across the team. ## Additional credits Each active developer gets 50 included credits per billing period. A completed review uses 1, 3, or 10 credits, depending on its [review tier](/docs/code-review/review-tiers). Usage beyond that appears as **flex usage**, billed at **\$1/credit**: once a developer has used their 50 included credits, every further review they receive is flex, so their cost scales with actual review activity. It's the same **flex usage** figure shown in your billing and usage dashboard. Flex is calculated per developer, not from a shared team pool. Each author works through their own 50 included credits first before any of their reviews count as flex. Discounts and promotional credits are shown in the billing dashboard. ## How reviews are counted Billing counts **completed reviews**, not PRs. Skipped reviews don't count. **Pull request reviews** are charged to the **PR author**, not to the person who triggered the review. They run on a [manual trigger](/docs/code-review-bot/trigger-code-review) from a comment or the web app, or automatically whenever an event listed in [`autoReview`](/docs/code-review-bot/trigger-code-review#auto-review-on-every-push) happens: the PR opening, a push, or a rebase, depending on what the set includes. **[CLI](/docs/code-review/greptile-cli) reviews** are either attributed or unattributed. An **attributed** CLI review is charged to the Greptile user who ran it and shares that user's seat and included credits. To attribute CLI reviews, sign in with [`greptile login`](/docs/code-review/greptile-cli#sign-in) and connect your GitHub or GitLab account in [Personal Settings → Account](https://app.greptile.com/user/settings/account). An **unattributed** CLI review bills as flex usage and does not count as an active developer. API-key reviews are unattributed unless the key is bound to a user with a linked account. ## Usage limits Organizations can cap flex usage in [**Organization Settings → Billing → Flex Usage Limit**](https://app.greptile.com/-/settings/billing) to control spend. When projected spend hits the cap, Greptile skips reviews that would incur flex usage until the next billing period or until you raise the cap. Set the limit to **\$0** to disable flex usage. Authors still within their 50 included credits can continue to receive reviews even after the cap is reached. ## Excluding bots Excluded authors are not reviewed and don't count as active developers. In [Code Review → Greptile Comments](https://app.greptile.com/review#greptile-comments), set **Authors** / **Exclude** and add: * `dependabot[bot]` * `renovate[bot]` * Any service accounts ```json theme={} { "excludeAuthors": ["dependabot[bot]", "renovate[bot]"] } ``` ## Dashboard * [Settings → Usage](https://app.greptile.com/-/settings/usage): review counts and active developers * [Settings → Billing](https://app.greptile.com/-/settings/billing): usage limits, payment methods, **Billing Portal** (plan status, invoices, cancellation) For billing questions, contact [support@greptile.com](mailto:support@greptile.com). For enterprise pricing, contact [sales@greptile.com](mailto:sales@greptile.com). # Configure with greptile.json (Perforce) Source: https://www.greptile.com/docs/code-review-bot/greptile-json-perforce Configure Greptile settings for Perforce depots. ## Project Boundary ### Where to Place `greptile.json` You can configure Greptile by adding a `greptile.json` file **at the root of your project boundary**. The *project boundary* is the **context path shown in the review summary**. **Example** If your review summary shows: > Run with Greptile v3 — Context used: //depot/linux/arch/alpha Then the configuration file must be placed at: ``` //depot/linux/arch/alpha/greptile.json ``` Greptile will use this file when reviewing changes within that boundary. ### How Greptile Determines the Project Boundary Greptile determines the boundary based on the **onboarded paths involved in the review**. **Case A: Review Spans Multiple Onboarded Paths** If: * `//depot/project/frontend` is onboarded * `//depot/project/backend` is onboarded * `//depot/project` is also onboarded And the review includes files from both: ``` //depot/project/frontend //depot/project/backend ``` Then: * Greptile finds the **nearest common parent** * Since `//depot/project` is onboarded, it becomes the **project boundary** * The configuration used will be: ``` //depot/project/greptile.json ``` **Case B: Review Is Limited to a Single Onboarded Path** If the review only contains files from: ``` //depot/project/frontend ``` And that path is onboarded, then: * `//depot/project/frontend` becomes the project boundary * The configuration used will be: ``` //depot/project/frontend/greptile.json ``` ### Key Rules Greptile: * Uses the **nearest common parent** path * Only considers parents that are **also onboarded** * Loads the `greptile.json` file from the resolved project boundary ```json greptile.json theme={} { "strictness": 2, "commentTypes": ["logic", "syntax", "style"], "instructions": "Ensure all code follows the team's style guide.", "ignorePatterns": "greptile.json\n*.md\n*.txt\nscripts/", "notify": "silent", "emailAuthorOnComplete": true, "summarySection": { "included": true }, "issuesTableSection": { "included": true }, "confidenceScoreSection": { "included": true }, "customContext": { "rules": [ { "scope": ["**/*.py"], "rule": "All functions must have docstrings" } ], "files": [ { "scope": ["**/*.ts", "**/*.js"], "path": "//depot/projects/my_project/style_guide.md", "description": "TypeScript style guide" } ], "other": [ { "scope": [], "content": "Focus on security and performance issues" } ] } } ``` ## Configuration Parameters All parameters are optional. | Parameter | Type | Description | | - | - | - | | `strictness` | number | Severity threshold for comments (1-3). 1 = all issues, 2 = moderate filtering, 3 = only critical issues. Defaults to 2. | | `commentTypes` | array | Types of comments Greptile should make. Options: "logic" (business logic issues), "syntax" (language-specific best practices), "style" (formatting, naming conventions). All enabled by default. | | `instructions` | string | Natural language instructions for code reviews. | | `ignorePatterns` | string | Newline-separated list of file patterns to ignore, following .gitignore syntax. | | `autoReview` | array | Swarm review events that start a Greptile review without being asked: `open` (review created) and `push` (review updated). Default `["open"]`. | | `skipReview` | string | Legacy form of `autoReview`: when set to AUTOMATIC, skips reviews triggered automatically by Swarm review events (opens, updates, etc), the same as `autoReview: []`. | | `notify` | string | Controls email notifications. When set to `"silent"`, Swarm will not send email notifications to the author or reviewers. | | `emailAuthorOnComplete` | boolean | If set to true will send an email to the author that the review is completed. Default behavior is false. | | `summarySection` | object | Controls review summary section. Property: included (boolean). | | `issuesTableSection` | object | Controls issues table section. Property: included (boolean). | | `confidenceScoreSection` | object | Controls confidence score section. Property: included (boolean). | | `customContext` | object | Advanced context with three arrays: `rules`, `files`, and `other`. Each supports optional scope targeting. | ## Ignore Patterns The `ignorePatterns` field uses `.gitignore` syntax to exclude files from review. Patterns are separated by `\n` (newline characters) in the JSON string. Paths are relative to the project boundary. ```json theme={} // Ignore specific files { "ignorePatterns": "greptile.json\nREADME.md" } // Ignore by file extension { "ignorePatterns": "*.md\n*.txt\n*.log" } // Ignore directories { "ignorePatterns": "scripts/\nvendor/\nthird_party/" } // Ignore nested directories { "ignorePatterns": "src/utils/testing/\nlib/external/deprecated/" } // Ignore with glob patterns { "ignorePatterns": "**/*.generated.*\ntests/**/*.snap\ndocs/**" } // Combined example { "ignorePatterns": "greptile.json\n*.md\n*.txt\nscripts/\n**/*.generated.*" } ``` ## Custom Context The `customContext` field provides additional context for code reviews: **`rules`** - Specific coding rules to enforce * Define coding standards or project-specific requirements * Each rule includes a `scope` (glob patterns) and `rule` (string) **`files`** - Reference depot documentation files * Point to existing style guides or reference files using Perforce depot paths * Includes `path` (e.g., `//depot/projects/my_project/style_guide.md`), `description`, and `scope` **`other`** - General instructions or context * Additional background information or high-level guidance * Includes `content` and optional `scope` ### Scope Targeting Each context item supports an optional `scope` array using glob patterns. For Perforce, scope patterns work with depot paths: ```json theme={} { "customContext": { "files": [ { "scope": ["//depot/apps/**", "//depot/libs/**"], "path": "//depot/shared/security-rules.md" } ] } } ``` Additional scope examples: ```json theme={} "scope": ["**/*.py"] // All Python files "scope": ["//depot/src/**/*.ts"] // TypeScript files in depot/src "scope": [] // All files (default) ``` # Auto-approve PRs Source: https://www.greptile.com/docs/code-review/auto-approve-prs Let Greptile approve low-risk, bug-free PRs after a clean 5/5 review. Auto-approve lets Greptile approve pull requests that it rates as low-risk and bug-free. It only approves PRs with a clean **5/5 Greptile review**. You choose the maximum risk level Greptile can approve, and you can add filters to keep certain PRs out of auto-approval. Auto-approve is in beta. We recommend using it only for low-risk changes, not as a universal rule for every PR. Auto-approve works on GitHub, GitLab, Bitbucket Cloud, and Gitea. It is not available on Bitbucket Data Center or Perforce. ### Configure auto-approve On the [Greptile dashboard](https://app.greptile.com/review#auto-approve), go to **Code Review Settings -> Auto-approve**. Auto-approve settings: toggle auto-approve, set the maximum risk to auto-approve, and add filters Turn on **Auto-approve pull requests**. The toggle requires the **Confidence Score** review section to be on. Auto-approve reads the 5/5 score from it. Choose the highest risk level Greptile is allowed to approve. Greptile only auto-approves PRs at or below this level. Use **Low** for docs, tests, styling, and small code changes. Use higher levels only when you are comfortable with Greptile approving those changes without another human review. Write plain-language guidance for the risk assessment, such as which parts of your codebase are riskier than they look. See [Custom instructions](#custom-instructions) below. Add filters for authors, repositories, target branches, labels, keywords, or paths. Each filter either includes or excludes PRs from auto-approval. Add per-repo filters in your `.greptile` file. Auto-approval still requires a clean 5/5 Greptile review. If Greptile finds an issue, or the PR does not meet the configured risk threshold, it will not approve the PR. ### How risk levels work Greptile assigns every reviewed PR a risk level by reading the diff. The maximum risk setting controls the broadest class of changes Greptile can approve. * **Low**: docs, tests, styling, and small code changes assessed as low-risk * **Medium**: ordinary application or business-logic changes * **High**: dependency updates, build or runtime config, and core shared modules * **Critical**: auth, secrets, billing, database migrations, infra or CI, and public APIs. At this level Greptile approves every change with a 5/5 review. The risk level comes from what the code does, not from the file path. A change under a sensitive directory that the assessment judges low-risk can pass a **Low** ceiling. For paths that must always get a human approval, use `excludePaths` below. Start with **Low**. Raise the maximum risk only after your team has seen enough auto-approved PRs to trust the behavior for that class of change. ### Custom instructions The **Custom instructions** box under the risk setting takes natural-language guidance for the risk assessment that gates auto-approve. Use it to tell Greptile how risky specific kinds of changes are in your codebase: ```text theme={} Treat any change to the checkout flow as critical. Generated API clients are low risk. Anything under packages/billing is critical, even config changes. ``` Instructions adjust the risk level a change is assigned. They can raise or lower it, but only when the diff actually contains that kind of change. The maximum risk setting still decides what gets approved: an instruction that lowers a change to Low does nothing if auto-approve is off, and an instruction that raises a change to Critical blocks approval under any lower ceiling. Instructions are a dashboard setting for the whole organization or team. They are not read from `.greptile` files, so a PR cannot change them. ### Filters Filters let you exclude PRs from auto-approval even when Greptile rates them as safe. Use filters for changes that need a human reviewer every time, such as: * Sensitive branches * Release or migration labels * Critical files or directories * Authors whose PRs need extra review Add per-repo filters in your `.greptile` file. When both the dashboard and a `.greptile` file set `autoApprove`, the stricter value wins for every field. #### Protect specific file paths Use `excludePaths` to list paths that always require a human approval. A PR that touches any matching path is never auto-approved, even if the rest of the diff qualifies: ```json theme={} { "autoApprove": { "enabled": true, "riskCeiling": "low", "filters": { "excludePaths": ["src/auth/**", "db/migrations", ".github/workflows/**"] } } } ``` Entries are glob patterns or plain directory paths (a directory entry covers everything under it, like a CODEOWNERS rule). Renames count on both sides, so moving a file out of a protected path still requires human review. #### Limit auto-approve to specific paths Use `includePaths` to auto-approve only when every changed file matches one of the listed paths: ```json theme={} { "autoApprove": { "enabled": true, "riskCeiling": "low", "filters": { "includePaths": ["docs/**", "**/*.test.ts"] } } } ``` See the [config reference](/docs/code-review/greptile-config-reference#auto-approve) for all auto-approve fields. ### What always blocks auto-approval Even with a 5/5 review inside the risk ceiling, Greptile withholds approval when: * The PR is a draft, closed, or merged by the time the review finishes * New commits landed after the review started * The PR carries a `do-not-merge` or `manual-review` label * A human reviewer has requested changes * The PR fails any of your regular review filters (branches, labels, authors, keywords) * The Confidence Score review section is turned off Greptile reads the auto-approve policy from the PR's base branch. A PR that edits `.greptile` cannot loosen the policy for itself. When new commits are pushed to an approved PR, Greptile dismisses its earlier approval. The next review that passes every check approves again. A withheld approval is silent. Greptile does not comment to explain why it did not approve. On GitHub the approval itself has no comment. On GitLab and Bitbucket it carries a one-line note. ### When to use it Auto-approve is useful when the cost of waiting for a human review is higher than the risk of the change. Good candidates include docs updates, test-only changes, formatting, and small changes Greptile rates as low-risk. Do not enable it broadly across all PRs. It is meant to save time on low-risk changes while keeping normal review paths for everything else. # CLI Onboarding Source: https://www.greptile.com/docs/code-review/cli-onboarding Set up Greptile from your terminal with greptile onboard — or hand this page to your coding agent and have it run the setup for you. Set up Greptile without leaving your terminal. `greptile onboard` creates your organization, connects GitHub or GitLab, enables repositories, and imports your existing AI rules files — the same setup the dashboard does. This page is written to be **handed to a coding agent**. Paste the prompt below into Claude Code, Cursor, Codex, or any agent that can read a URL and run shell commands, and it will do the setup for you. Requires **Greptile CLI v3.2.0 or newer** and **Node 22+**. The `onboard` command does not exist in earlier versions — if you see `Unknown command onboard`, you are on an old build. See [Upgrade](#upgrade). ## Onboard with your coding agent Copy this prompt into your agent: ```text Prompt theme={} Onboard me to Greptile. Read the agent playbook at https://www.greptile.com/docs/code-review/cli-onboarding and follow it exactly. Work in the git repository I currently have open. Run the machine steps yourself. When you reach a step that needs my browser or an interactive terminal, stop, print the exact command or URL I need, and wait for me to confirm before continuing. Do not guess my organization name — ask me. Finish by running a review on my current branch and summarizing the findings. ``` Run it from inside the repository you want reviewed. Your agent handles installation, checks, sign-in, verification, and your first review. You handle the two things it cannot: approving the browser sign-in, and answering the wizard. ## Onboard yourself If you would rather do it by hand, it is three commands: ```bash theme={} npm i -g greptile@latest cd path/to/your/repo greptile onboard ``` Then, once setup finishes: ```bash theme={} greptile review ``` *** ## Prerequisites * **Node 22+** — check with `node --version` * A **local git repository** with at least one commit, and a remote on GitHub or GitLab * Permission to **install a GitHub App** on your organization (or, for GitLab, to create an access token and a webhook) You do **not** need a Greptile account yet. `greptile login` creates one. ## Install ```bash theme={} npm i -g greptile@latest ``` ```bash theme={} brew install greptileai/tap/greptile ``` ```bash theme={} curl -fsSL https://raw.githubusercontent.com/greptileai/cli/main/install.sh | bash ``` ### Upgrade `onboard` shipped in **v3.2.0**. Confirm your version: ```bash theme={} greptile --version ``` If it is below `3.2.0`, upgrade with the same method you installed with: ```bash theme={} npm i -g greptile@latest # or: brew upgrade greptile ``` If `GREPTILE_API_KEY` is set, it overrides your browser sign-in and onboarding fails with `API key invalid or revoked` — even when the key is valid. API keys are org-scoped and cannot create an organization, so they cannot onboard. Unset it, and check your shell rc files for a lingering export: ```bash theme={} unset GREPTILE_API_KEY ``` `greptile whoami` marks an environment key with `(via GREPTILE_API_KEY)`. ## Run the wizard ```bash theme={} cd path/to/your/repo greptile onboard ``` Run this **inside the repo you want reviewed**. The wizard scans your checkout for AI rules files. Run it from your home directory and that step silently finds nothing. If you are not signed in, the wizard opens your browser. Approve the sign-in and it continues. That sign-in creates your Greptile account. Answer the wizard's prompts. Leave the URL handle blank and Greptile derives one from your organization name. Pick **GitHub** or **GitLab**. Greptile opens your browser to finish the connection. * **GitHub** — authorize Greptile and complete the App install, choosing which repositories it can access. * **GitLab** — paste a service account personal access token (recommended), group access token, or project access token. The account must have the Developer role and the token must have the `api` scope. Set up the webhook, then click Done, I've set up the webhook. Leave the terminal open. Greptile polls and continues on its own once the connection lands. No graphical browser (SSH, container, remote dev box)? The CLI prints the URL instead so you can open it on another device, and keeps polling. You have **10 minutes** to finish. Every 60 seconds the wizard offers **Keep waiting**, **Pick organization manually**, or **Skip for now**. When the connection lands, pick the organization to link. If you only have one and it is unclaimed, Greptile links it automatically. Select the repositories Greptile should review. **At least one repository is required.** Onboarding cannot finish without one. The list can pause on a spinner while a new organization syncs. Wait it out. Indexing starts in the background. You do not have to wait for it. Greptile scans your checkout and imports **every** match as org-wide custom context: * `CLAUDE.md` and `.claude/rules/**/*.md` * `AGENTS.md` * `.cursorrules` and `.cursor/rules/**/*.mdc` There is no picker — anything it finds, it takes. Add more context later from the dashboard. You will see: ```text theme={} Greptile is ready to review your first PR! 1 repo added 2 AI-rules files imported ``` Your **14-day free trial** starts here. No payment method required. ## Verify ```bash theme={} greptile whoami # who you are, and your organizations greptile onboard # prints setup status when output is not a terminal greptile review # review the current branch ``` Open a pull request and Greptile reviews it automatically. *** ## Agent playbook **This section is the contract an AI agent should follow.** Human readers can skip to [Troubleshooting](#troubleshooting). ### What you can and cannot automate Two steps are interactive by design and **cannot** be driven by an agent: 1. **Approving the browser sign-in** — a human must click Approve. 2. **The `greptile onboard` wizard itself** — it refuses to run when it detects an agent environment (`CLAUDECODE`, `CLAUDE_CODE`, `CURSOR_AGENT`, `CODEX_*`) or a non-TTY stdout. Run non-interactively, it prints setup status and exits `0` instead. Do not try to defeat these. Do not spawn a pseudo-TTY, unset agent environment variables, or call internal API endpoints. **Instead, use `greptile onboard`'s non-interactive output as a read-only state probe**, do every other step yourself, and hand off cleanly for the two that need a human. ### Steps ```bash theme={} node --version greptile --version || echo "NOT_INSTALLED" ``` Require Node **22+**. Require greptile **≥ 3.2.0**; if missing or older, run `npm i -g greptile@latest` and re-check. If `greptile onboard --help` reports `Unknown command`, the upgrade did not take effect — stop and report it. ```bash theme={} [ -n "$GREPTILE_API_KEY" ] && echo "API_KEY_SET" ``` If set, warn the user: it **overrides browser sign-in**, and a stale key produces a misleading `API key invalid or revoked` on every command. Ask them to `unset GREPTILE_API_KEY` and remove it from their shell rc. Do not proceed while a failing key is set. ```bash theme={} git rev-parse --show-toplevel ``` Run everything from there. If this fails, the user is not in a git repository — stop and ask where their repo is. Both the AI-rules import and the review depend on it. ```bash theme={} greptile whoami ``` * `Signed in as ` with an org listed → already set up. Skip to **Run the first review**. * `Signed in as ` with no organizations → signed in, not onboarded. Go to **Hand off the wizard**. * `Not signed in` → continue below. To sign in, run `greptile login`. It prints a URL and waits. **Surface that URL to the user and stop.** Do not proceed until `greptile whoami` reports a signed-in account. ```bash theme={} greptile onboard ``` Because you are an agent, this does not open the wizard. It prints status and exits `0`: | Output | Meaning | Do this | | - | - | - | | `Greptile onboarding: complete.` | Fully set up | Skip to **Run the first review** | | `Greptile onboarding: in progress.` | Started, unfinished | **Hand off the wizard** | | `Greptile onboarding: dismissed.` | Skipped earlier | **Hand off the wizard** | | `error: not signed in.` | No credentials | Go back to **Check sign-in** | **Stop here and wait for the user.** Print this, verbatim: > Run this in your own terminal — I can't drive an interactive wizard: > > ``` > cd && greptile onboard > ``` > > You'll be asked for: your name, an organization name, a URL handle (blank is fine), company website (optional), and company size. Then pick GitHub or GitLab, finish the connection in the browser that opens, and choose which repositories to enable. Tell me when it says "Greptile is ready to review your first PR!" Then poll until it completes: ```bash theme={} greptile onboard ``` Proceed only when it prints `Greptile onboarding: complete.` If the user reports an error, match it against [Troubleshooting](#troubleshooting) and tell them the fix — do not attempt to work around it yourself. ```bash theme={} greptile review --agent ``` Use `--agent` (plain text) or `--json` (structured). Summarize the findings for the user. Exit codes: `0` finished · `1` could not finish (or signed out) · `2` invalid invocation (not a git repo) · `130` interrupted. If it fails with a billing error, report it and stop — see [Troubleshooting](#troubleshooting). ### Rules * **Never invent answers to the wizard.** The organization name and handle are the user's to choose. * **Every command is safe to re-run.** Each step is gated on server state, so a repeated `greptile onboard` skips what is already done. If you are unsure of the state, probe again. * **Do not create a second organization.** If the user is already onboarded, `greptile onboard` offers "Create a new organization" — that is not a retry, and it is not what they want. *** ## Troubleshooting Your CLI predates v3.2.0. Run `greptile --version`, then upgrade with `npm i -g greptile@latest` (or `brew upgrade greptile`). If you installed via npm but `greptile` resolves through Homebrew's Node, `brew upgrade` will not help — use npm. Your key is fine; it is the wrong credential. `GREPTILE_API_KEY` overrides browser sign-in, and API keys cannot create an organization. ```bash theme={} unset GREPTILE_API_KEY greptile whoami ``` Remove the export from `~/.zshrc`, `~/.zprofile`, or `~/.bashrc` too, or it returns in your next shell. The browser step did not finish. Re-run `greptile onboard` and complete the GitHub App install — authorizing Greptile is not enough. You must finish the install and grant repository access. Someone at your company already connected that organization to a different Greptile workspace. Ask them to invite you, or install Greptile on an organization you own and refresh the list. No repository was enabled. If the list was empty, your organization was probably still syncing — re-run `greptile onboard` and choose **Add repositories**. CLI reviews require an active trial or a paid plan; the free plan includes pull request reviews only. New organizations start a 14-day trial automatically. Add a payment method in the [dashboard](https://app.greptile.com/). The CLI prints a URL you can open on any device, and a code to paste back if it cannot reach your machine. API keys work for reviews but cannot onboard, so run `greptile onboard` somewhere with a browser first. ## Command reference | Command | What it does | | - | - | | `greptile onboard` | Interactive setup wizard. Prints setup status when output is not a terminal. | | `greptile login` | Sign in through your browser | | `greptile whoami` | Show your account and organizations | | `greptile review` | Review the current branch against its base | | `greptile settings` | Change review settings, members, and team config | | `greptile update` | Update the CLI | Review strictness, PR summary sections, and team invitations are **not** part of onboarding. Configure them after setup with `greptile settings`, or in the dashboard. ## What's next? Review flags, output formats, and exit codes. Teach Greptile your team's conventions. Use Greptile from your editor or coding agent. Understand what Greptile posts on a PR. # Controlling Nitpickiness Source: https://www.greptile.com/docs/code-review/controlling-nitpickiness Configure Greptile's review strictness, filter comment types, ignore files, and configure triggers. Get high-signal code reviews without the noise. With noise control, Greptile limits reviews to high-signal insights, skipping low impact or repetitive feedback. ## Configuration Options Overview You can **configure** review behavior with these options in `.greptile/config.json` or `greptile.json`: | Parameter | Type | Description | | - | - | - | | `strictness` | number | Filters comments by importance (1-3 scale) | | `commentTypes` | array | Categories of feedback to generate | | `ignorePatterns` | string | Files/folders to skip (newline-separated patterns) | | `autoReview` | array | Which PR events start a review: `open`, `push`, `rebase`; each implies the ones before it | | `triggerOnUpdates` | boolean | Legacy: `true` means `autoReview: ["open", "push", "rebase"]` | | `skipReview` | string | Legacy: `"AUTOMATIC"` means `autoReview: []` (manual-only reviews) | ## Severity Threshold Settings Control how strict Greptile is about leaving comments with the strictness setting (1–3). **Comments on everything (low threshold).** Perfect for initial setup or deep reviews where you want every potential issue flagged. **Provides moderate filtering (default).** Balanced approach highlighting real issues while filtering common noise. We recommend starting here. **Shows only the most critical issues (high threshold).** Ideal for final reviews or teams that want minimal interruption. ### How to Configure Set `strictness` in `.greptile/config.json` at your repository root or any subdirectory: ```json .greptile/config.json theme={} { "strictness": 2 } ``` * `1` = verbose (all issues) * `2` = balanced (default) * `3` = critical only In a monorepo, child directories can override the root setting — for example, a `packages/db/.greptile/config.json` with `"strictness": 1` makes database reviews stricter while the rest of the repo stays at `2`. See [Cascading Configuration](/docs/code-review/greptile-config#cascading-configuration). Create `greptile.json` at your repository root: ```json theme={} { "strictness": 2 } ``` * `1` = verbose (all issues) * `2` = balanced (default) * `3` = critical only This overrides dashboard settings for this repository. Go to **Settings → Code Review → Greptile Comments** and set the **Strictness Level** (Low, Medium, or High). Code Review Settings ## Comment Type Filtering Filter which categories of feedback Greptile provides with `commentTypes` in `.greptile/config.json`. All types are **enabled by default**. **Available comment types:** * `logic` - Business logic issues, algorithmic problems, potential bugs * `syntax` - Language-specific best practices, proper usage patterns * `style` - Code formatting, naming conventions, structural consistency ### How to Configure Set `commentTypes` in `.greptile/config.json` at your repository root or any subdirectory: ```json .greptile/config.json theme={} { "commentTypes": ["logic", "syntax"] } ``` This array replaces the default — only the types you list will appear. Like strictness, child directories can override this for their own scope. If you still use the legacy root config file, set the same field in `greptile.json`: **Only critical issues:** ```json theme={} { "commentTypes": ["logic"] } ``` **Code quality without style nitpicks:** ```json theme={} { "commentTypes": ["logic", "syntax"] } ``` **Everything (default):** ```json theme={} { "commentTypes": ["logic", "syntax", "style"] } ``` ## Ignore Patterns Exclude files that don't need review to speed up analysis and reduce noise. ```json theme={} { "ignorePatterns": "*.generated.*\n**/*.test.js\n**/node_modules/**\n*.config.js\npackage-lock.json\n*.md" } ``` **Common patterns to ignore:** * `*.generated.*` - Generated code * `**/*.test.js` - Test files * `**/node_modules/**` - Dependencies * `*.config.js` - Config files * `package-lock.json` - Lock files * `*.md` - Documentation **Impact:** Ignoring generated/vendor files can speed up reviews by 30-50% and eliminate irrelevant comments. `ignorePatterns` will only ignore those files during PR review. Greptile will still index them while indexing your repository, which can lead to other errors. For instance, in the case of large binary files. Reach out to Greptile support. ## Trigger Configuration Control when Greptile performs reviews. This affects developer workflow and review frequency. Set trigger behavior in `.greptile/config.json`: ```json .greptile/config.json theme={} { "autoReview": ["open", "push", "rebase"] } ``` To disable automatic reviews entirely (manual trigger via `@greptileai` only): ```json .greptile/config.json theme={} { "autoReview": [] } ``` **Review on every push:** ```json theme={} { "autoReview": ["open", "push", "rebase"] } ``` **Manual trigger only (skip automatic reviews):** ```json theme={} { "autoReview": [] } ``` * `open` - reviews when the PR is opened, reopened, marked ready, or given a trigger label * `push` - reviews pushes that add commits * `rebase` - reviews pushes that rewrite history (rebase, amend, force push) * Each event implies the ones before it, so `["rebase"]` alone means all three and `[]` means never * The older `triggerOnUpdates: true` and `skipReview: "AUTOMATIC"` still work and mean `["open", "push", "rebase"]` and `[]` Go to **Code Review Settings** in the sidebar. In the **When Greptile Reviews** section, set **Automatic reviews** to Never, On PR opened, On new pushes, or On all events, and toggle **Review draft pull requests**. Start with dashboard defaults, then add a `.greptile/` folder to repos that need custom settings. ## Troubleshooting **Check these in order:** 1. If using `greptile.json`, did you commit and push it? 2. Are you looking at a new PR? Settings don't affect existing reviews 3. Wait 2-3 minutes - config changes aren't always instant **Dashboard settings not working?** * Check if the repo has a `greptile.json` (it overrides dashboard) * Verify you saved the settings (look for confirmation message) **Progressive solutions:** 1. Reduce comment types to `["logic"]` only 2. Add more ignore patterns for generated/test files 3. Consider `autoReview: []` for non-critical repos 4. Give the learning system 2-3 weeks to adapt to your reactions **Check these settings:** 1. Is strictness too high? Try reducing by 1 2. Are all comment types enabled that you need? 3. Check ignore patterns - are they too broad? 4. Has the team been giving 👍 to important catches? **Best practice:** 1. Set organization-wide defaults in **Code Review Settings** at the org level 2. Teams inherit org settings by default. Customize specific teams in their own **Code Review Settings** 3. Use **Inheritance & Sync** on the team settings page to reset a team to match the org when needed 4. For per-directory overrides within a repo, use `.greptile/` folders — each package in a monorepo can have its own strictness and comment types See [Organizations & Teams](/docs/code-review/team-setup-basics#syncing-settings-across-teams) for how inheritance works, and [Cascading Configuration](/docs/code-review/greptile-config#cascading-configuration) for per-directory overrides. **In Dashboard:** Go to **Code Review Settings** > **Greptile Comments**. Set the filter to **Authors** / **Exclude** and add: * `dependabot[bot]` * `renovate[bot]` * Any other bot accounts **Note:** This is dashboard-only, not available in greptile.json **Solutions:** 1. Add release branches to excluded branches in dashboard 2. Use `greptile.json` with branch-specific rules 3. Set `autoReview: []` for release repos ## What's next? * [.greptile/ Configuration →](/docs/code-review/greptile-config) for cascading per-directory settings * [Train the learning system →](/docs/code-review/training-the-learning-system) to automatically reduce noise over time * [Add custom standards →](/docs/code-review/custom-standards) for team-specific rules * [Set up cross-repo context →](/docs/code-review/cross-repo-context) for related repositories # Cross Repo Context Source: https://www.greptile.com/docs/code-review/cross-repo-context Create Repo Clusters so Greptile can read related repositories as context during reviews. Repo Clusters let you group related repositories so that whenever Greptile reviews a PR in one of them, it automatically reads the others as read-only context. It's the dashboard equivalent of the `context.repos` field in [greptile.json](/docs/code-review/greptile-json-reference#cross-repository-context), but instead of pointing one repo at others, you define a group once and every member shares context with every other member. Clusters are useful when a set of repos are tightly coupled, for example a service, its SDK, and its shared types, where a change in one often can't be reviewed well without the others. ### Creating a cluster On the [Greptile dashboard](https://app.greptile.com), go to **Memory → Cross-repo context**. Managing clusters requires admin access. Click **Create Repo Cluster**. New repo cluster form with name and member repositories Give the cluster a name. Add at least 2 repositories. A cluster can hold up to 20 GB of repositories by total size. ### Suggested clusters Greptile suggests clusters for you based on shared contributors, meaning repositories the same people have committed to over the last 90 days. Suggestions appear with a confidence indicator; click **Use this** to create the cluster, or **Discard** to dismiss it. ### How clusters affect reviews When Greptile reviews a PR in a clustered repo, it clones the other members read-only and makes them available to the reviewer, exactly like `context.repos`. Repos listed explicitly in `context.repos` take priority. # Custom Standards & Rules Source: https://www.greptile.com/docs/code-review/custom-standards Create custom rules, upload style guides, and configure repository-specific standards via greptile.json. Enforce your team's coding practices automatically. Configure Greptile to enforce your team's unique standards, from simple naming conventions to complex architectural patterns. This guide covers all configuration methods and when to use each. **After this guide, you can:** * Create custom rules that catch team-specific issues * Upload existing style guides for automatic enforcement * Configure repository-specific standards via `.greptile/` or `greptile.json` * Use per-directory rules in monorepos * Verify rules are actually being applied * Debug when rules don't work as expected ## Required Permissions Understand who can configure custom standards: | Action | Organization admin | Team admin | Member | | - | - | - | - | | View custom context | ✅ | ✅ | ✅ | | Create/edit dashboard rules (organization scope) | ✅ | — | ❌ | | Create/edit dashboard rules (team scope) | ✅ | ✅ | ❌ | | Delete dashboard rules (organization scope) | ✅ | — | ❌ | | Delete dashboard rules (team scope) | ✅ | ✅ | ❌ | | Edit `.greptile/` or `greptile.json` | Anyone with repository write access (not a Greptile dashboard role) | Same | Same | | View suggested rules | ✅ | ✅ | ✅ | | Approve suggested rules | ✅ | ✅ | ❌ | | Delete organization | ✅ | — | ❌ | Dashboard rule permissions depend on where you are in the app. At organization scope, only an **organization admin** can create or edit rules. Inside a team, an **organization admin** or **team admin** for that team can. If buttons are disabled, ask an organization admin to promote you—or, for team-scoped rules only, to grant you team admin on that team. ## Configuration Methods | Method | Best For | Version Control | Scope | | - | - | - | - | | **`.greptile/` folder** | Production standards, monorepos | Yes | Per-directory with cascading | | **`greptile.json`** | Simple repos, single-file config | Yes | Repository-wide | | **Dashboard** | Quick experiments, org-wide defaults | No | All repos or specific ones | Dashboard and repo-level configs (`.greptile/` or `greptile.json`) are **separate systems**. Rules in config files don't appear in the dashboard. Settings in repo config override the dashboard. Rules from both still apply. If both `.greptile/` and `greptile.json` exist, `.greptile/` wins. ## Method 1: Dashboard The quickest way to add custom rules. Changes apply within 2-3 minutes to new PRs. Go to **Memory → Custom rules**. Available at both the organization and team level. Custom rules page in the Memory tab Click **Add Context** and choose the **Rule** context type. Rules must be specific and measurable: * ❌ "Write clean code" * ✅ "Functions must not exceed 50 lines" * ✅ "All API responses must include `status` and `timestamp` fields" Add Context dialog with the Rule context type Use glob patterns to target specific files: ```text theme={} src/**/*.ts # All TypeScript in src **/*.test.{js,ts} # All test files ``` In **Add Context**, choose the **File** context type and point to existing documentation in your repository: ```text theme={} docs/style-guide.md ./CONTRIBUTING.md ``` Add Context dialog with the File context type Supported formats: Markdown, plain text, YAML, JSON 1. Create a test PR with intentional violations 2. Verify Greptile catches them within 2-3 minutes 3. Check "Last Applied" timestamp updates ## Method 2: .greptile/ Folder (Recommended) The `.greptile/` folder gives you version-controlled rules with per-directory overrides — ideal for monorepos and teams that want rules reviewed in PRs. You have two options for defining rules: structured JSON rules in `config.json`, or free-form markdown in `rules.md`. Use both in the same folder if you want. ### Structured Rules (config.json) Each rule has a `rule` string, plus optional `scope`, `severity`, and `id` fields: ```json .greptile/config.json theme={} { "rules": [ { "id": "no-raw-sql", "rule": "Use parameterized queries. Never interpolate user input into SQL strings.", "scope": ["src/db/**"], "severity": "high" }, { "rule": "All API endpoints must have rate limiting", "scope": ["src/api/**/*.ts"], "severity": "medium" } ] } ``` The `id` field matters if a child directory needs to disable the rule — see [Disabling Inherited Rules](/docs/code-review/greptile-config#disabling-inherited-rules). ### Markdown Rules (rules.md) For rules that benefit from prose, examples, or code blocks, use `rules.md`: ```markdown .greptile/rules.md theme={} ## Error Handling All async functions must use try-catch blocks. Never swallow errors silently — at minimum, log them with the error context. ## Naming Conventions Use camelCase for variables and functions, PascalCase for classes and types. ``` The entire file is passed to the reviewer as context, scoped to the directory containing the `.greptile/` folder. ### Context Files (files.json) Point the reviewer to existing files it should read — database schemas, API specs, architecture docs: ```json .greptile/files.json theme={} { "files": [ { "path": "docs/architecture.md", "description": "System architecture guidelines" }, { "path": "prisma/schema.prisma", "description": "Database schema — reference for model relationships", "scope": ["src/db/**"] } ] } ``` Paths are relative to the directory containing the `.greptile/` folder, not the repo root. For the complete schema, see [.greptile/ File Reference](/docs/code-review/greptile-config-reference). For how cascading and per-directory overrides work, see [.greptile/ Configuration](/docs/code-review/greptile-config). ## Method 3: greptile.json A single JSON file for repository-wide configuration. Good for simpler repos that don't need per-directory overrides. ### Understanding customContext Types The `customContext` field in greptile.json accepts three arrays: **1. `rules` - Specific coding standards to enforce** ```json theme={} "rules": [ { "rule": "Use async/await instead of callbacks", "scope": ["**/*.js", "**/*.ts"] // Optional: limit to specific files }, { "rule": "All API endpoints must have rate limiting", "scope": ["src/api/**"] } ] ``` **2. `files` - Reference existing documentation** ```json theme={} "files": [ { "path": "docs/style-guide.md", // Path to file in your repo "description": "Company coding standards", // Optional description "scope": ["src/**"] // Optional: where to apply this file's rules } ] ``` **3. `other` - General context and background information** ```json theme={} "other": [ { "content": "This is legacy code from 2018 - be careful with changes", "scope": ["src/legacy/**"] }, { "content": "We're migrating to TypeScript - prefer TS over JS" } ] ``` Each type supports optional `scope` patterns using glob syntax to target specific files or directories. If no scope is specified, the context applies to all files. ### Complete Configuration Examples ```json theme={} { "customContext": { "rules": [ { "rule": "Use dependency injection for all services", "scope": ["src/services/**/*.ts"] }, { "rule": "API endpoints must have rate limiting", "scope": ["**/api/**/*.ts"] }, { "rule": "Test files must use .test.ts extension", "scope": ["src/**/*"] } ] } } ``` ```json theme={} { // Review behavior "strictness": 2, "commentTypes": ["logic", "syntax", "style"], // Custom standards "customContext": { "rules": [ { "rule": "No direct database queries in controllers", "scope": ["src/controllers/**/*.ts"] } ], "files": [ { "path": "docs/architecture.md", "description": "System architecture guidelines" } ] }, // Pattern repositories (cross-repo context) "patternRepositories": ["company/shared-standards"], // Ignore patterns (newline-separated string) "ignorePatterns": "*.generated.*\n**/vendor/**\n**/__snapshots__/**" } ``` ## Verifying Rules Are Active Many teams report rules "not working" - here's how to verify: **Memory → Custom rules** Last Applied Status
Last Applied Status
Look for "Last Applied" timestamp: * Should update within 2-3 minutes of adding rule * If stuck on "Never", repository may not be indexed * Force refresh: Create PR with `@greptileai review`
**Settings → Add/Remove Repos** greptile repo indexing
Greptile Repo Indexing
Add test rule with obvious violation: ```json theme={} { "rule": "No TODO comments", "scope": ["**/*.js"] } ``` Create PR with `// TODO: test` and verify detection.
## Suggested Rules (Auto-Learning) Greptile automatically suggests rules based on your team's patterns: **How it works:** 1. After \~10 PRs, Greptile detects consistent patterns 2. You can approve, modify, or ignore suggestions 3. Duplicates may appear (safe to ignore) Suggested rules may duplicate existing ones. This is a known issue - just mark as ignored. ## Troubleshooting Custom Rules 1. **Check "Last Applied" timestamp** (**Memory → Custom rules**) * If "Never": Repository not indexed or rule not triggered * If old: Rule may be inactive 2. **Verify repository is indexed** (navigate to your team, then Repositories) * Status must be "Indexed" not "Indexing" or "Failed" 3. **For `.greptile/` or `greptile.json` rules:** * Validate JSON syntax * Rules won't show in dashboard (this is expected) * Takes effect on next PR only 4. **Force trigger:** Comment `@greptileai review this` This is expected behavior: * Dashboard and repo-level configs (`.greptile/` or `greptile.json`) are separate systems * Repo-level rules apply during review but don't show in dashboard * Dashboard rules don't generate config files * You can use both. Settings from repo config override the dashboard. Rules from both apply. ❌ **Wrong - comma-separated string:** ```json theme={} { "scope": "**/*.cpp, **/*.hpp" } ``` ✅ **Correct - array of patterns:** ```json theme={} { "scope": ["**/*.cpp", "**/*.hpp"] } ``` `ignorePatterns` only affects reviews, NOT indexing. Files will still be indexed. **Bad:** "Follow best practices" **Good:** "Variable names must be camelCase, min 3 characters, no Hungarian notation" Include examples in your rule for best results: ```json theme={} { "rule": "API error responses must include: status (number), message (string), timestamp (ISO 8601), requestId (UUID)", "scope": ["**/api/**"] } ``` ## What's Next? * [.greptile/ Configuration →](/docs/code-review/greptile-config) - Cascading config with per-directory overrides * [.greptile/ File Reference →](/docs/code-review/greptile-config-reference) - Complete schema for config.json, rules.md, files.json * [Cross Repo Context →](/docs/code-review/cross-repo-context) - Reference related codebases * [greptile.json Reference →](/docs/code-review/greptile-json-reference) - Legacy format configuration options # Customization Overview Source: https://www.greptile.com/docs/code-review/customization-overview Three ways to customize Greptile — .greptile/ folders, greptile.json, and the Dashboard UI Greptile gives you three ways to customize review behavior. Pick the one that fits how your team works — or combine them. ## Configuration Methods A folder you place in any directory of your repo. Supports cascading — root-level defaults with per-directory overrides. * Version controlled and reviewed in PRs * Separate files for settings, rules, and context * Per-directory overrides for monorepos * Structured rules with scoping, severity, and disable-by-ID A single JSON file in your repository root. Everything in one file — settings, rules, and context. * Version controlled and reviewed in PRs * Repository-wide settings only (no per-directory overrides) * Good for simpler repos that don't need cascading Organization-wide defaults at [app.greptile.com](https://app.greptile.com/). * Changes apply immediately, no commits needed * Affects all repositories in the organization * Good for quick experiments and org-wide defaults ## How They Interact When multiple methods are used, the closest config wins (highest priority first): 1. **Nested `.greptile/`** — per-directory settings, closest to the file 2. **Root `.greptile/` or `greptile.json`** — repo-wide settings 3. **Dashboard** — org defaults Settings override. Rules from the dashboard and from config files all apply. A config file can turn off a dashboard or parent rule by ID. If both `.greptile/` and `greptile.json` exist in the repository root, `.greptile/` takes precedence and `greptile.json` is ignored. ## In This Section How cascading works, merge rules, monorepo examples Complete schema for config.json, rules.md, and files.json Adjust strictness, filter comment types, ignore files Set how deep reviews go and what they cost Use reactions and feedback to improve reviews Enforce team-specific coding rules Reference related codebases Legacy format — complete parameter documentation # Developer Essentials Source: https://www.greptile.com/docs/code-review/developer-essentials Essential guide for developers using Greptile: trigger reviews with @greptileai, train the AI with reactions, ask follow-up questions, and troubleshoot issues. This guide covers what you need to know when working with Greptile in your day-to-day workflow. ## Triggering Reviews Tag Greptile in a GitHub/GitLab comment to trigger a review: ```text theme={} @greptileai ``` You can also ask specific questions: ```text theme={} @greptileai check for memory leaks @greptileai review the database queries @greptileai is this thread-safe? ``` If `@greptileai` doesn't trigger a review, check: 1. Repository is enabled in dashboard 2. PR isn't in an excluded branch ### Draft PRs By default, Greptile **skips draft PRs** to reduce noise. To review a draft: ```text theme={} @greptileai review this draft ``` *** ## Example Prompts ### Code improvements ```text theme={} @greptileai are there code improvements I can make? ``` Follow-up question
Ask for improvements
### Explain code ```text theme={} @greptileai can you explain the code in this file? ``` Greptile explains code
Get explanations
### Generate tests ```text theme={} @greptileai can you create a test for this file? ``` Greptile generates tests
Generate test cases
*** ## Training Greptile Your reactions shape future reviews: | Action | What Greptile Learns | | - | - | | 👍 on a comment | "Keep flagging issues like this" | | 👎 on a comment | "Stop mentioning this pattern" | | Reply with context | "This is our pattern because..." | It takes 2-3 weeks of consistent reactions for Greptile to adapt to your team's preferences. ### Providing Context When Greptile flags something intentional, explain why: ```text theme={} @greptileai This is intentional - we use sync calls here because the webhook requires immediate response ``` When Greptile misses something: ```text theme={} @greptileai you missed a null check on line 45 ``` Both help Greptile learn your patterns. *** ## Troubleshooting **Check:** 1. Repo enabled in dashboard 2. Not a draft PR 3. Branch not excluded by filters **Fix:** Comment `@greptileai` to force a review **Too many?** Ask admin to increase severity threshold, or 👎 unwanted patterns consistently. **Too few?** Lower the severity threshold. * Small PR: \~1-2 minutes * Medium PR: \~3 minutes * Large PR: 3-5 minutes *** ## What's Next * [Training the learning system →](/docs/code-review/training-the-learning-system) * [Auto-fix with MCP →](/docs/mcp-v2/overview) * [Control nitpickiness →](/docs/code-review/controlling-nitpickiness) # Anatomy of a Review Source: https://www.greptile.com/docs/code-review/first-pr-review Understand every component of a Greptile code review: PR summaries, confidence scores, inline comments, suggested fixes, and diagrams explained. This page breaks down every component of a Greptile review so you know exactly what to expect and how to interpret the feedback. **New to Greptile?** Start with the [Quickstart](/docs/quickstart) to set up your first review. ## The Review Process When you open a PR, Greptile: 1. **Detects the PR** and starts analyzing (you'll see 👀) 2. **Builds context** from your entire codebase, not just the diff 3. **Posts feedback** as a PR summary + inline comments (you'll see 👍) Greptile analyzing Greptile complete | Status | Emoji | Typical Duration | | - | - | - | | Analyzing | 👀 | \~3 minutes | | Complete | 👍 | - | | Failed | 😕 | Tag `@greptileai` to retry | *** ## PR Summary The PR summary is a top-level comment that gives you the big picture. ### Components #### Summary Plain-language explanation of what the PR does, who it affects, and why. Includes major improvements and any issues found. PR Summary
Summary with major improvements and issues
#### Confidence Score A 0-5 rating that tells you at a glance whether the PR is ready to merge. Greptile calculates this based on the severity and quantity of issues found, the complexity of changes, and how well the code aligns with your codebase patterns. | Score | Meaning | Action | | - | - | - | | **5/5** | Production ready | Merge | | **4/5** | Minor polish needed | Merge after small fixes | | **3/5** | Implementation issues | Address feedback first | | **2/5** | Significant bugs | Needs rework | | **0-1/5** | Critical problems | Major rethink needed | Scores are contextual. A 3/5 on a payments feature is more serious than a 3/5 on an internal script. #### Files Changed & Issues File-by-file breakdown showing what changed and issues found per file. Files Changed
File analysis with issues
#### Diagrams Greptile automatically generates a diagram to visualize the changes in your PR. The diagram type is selected based on what changed: | Type | When Generated | | - | - | | **Sequence** | Multi-service interactions, API flows | | **Entity Relation** | Schema or data model changes | | **Class** | Class hierarchy changes | | **Flow** | Control flow or business logic changes | For minimal or trivial changes, no diagram is generated. **Example** (sequence diagram for an API flow): ```mermaid theme={} sequenceDiagram participant Client participant API participant Database Client->>API: Request API->>Database: Query Database-->>API: Result API-->>Client: Response ``` You can request a specific diagram type by replying to the review or tagging `@greptileai` — for example, "generate a class diagram for this PR". Configure which components appear in your [dashboard](https://app.greptile.com): PR summary settings
PR Summary Settings
#### Review Footer The footer of the PR summary shows review metadata and actions: Review footer with counter, commit link, and re-trigger button
Review footer
| Element | Description | | - | - | | **Review counter** | Shows how many times Greptile has reviewed this PR (e.g. "Reviews (2)") | | **Last reviewed commit** | Links to the most recent commit that was reviewed, with a longer commit message preview | | **Re-trigger Greptile** | Click to manually re-run a review on the current PR state | *** ## Inline Comments Greptile posts comments directly on specific lines where it finds issues. Inline Comment
Inline Comment with Suggested Fix
### Severity Badges Each inline comment includes a severity badge indicating its priority: Inline comment with P2 severity badge
Severity badge on an inline comment
| Badge | Severity | Description | | - | - | - | | **P0** | Critical | Must fix before merging — security vulnerabilities, data loss, crashes | | **P1** | High | Should fix — bugs, incorrect behavior, edge cases | | **P2** | Medium | Consider fixing — code quality, maintainability, best practices | ### Comment Types Comment types are controlled with the `commentTypes` field in `.greptile/config.json`. | Type | What it catches | Examples | | - | - | - | | **Logic** | Bugs, incorrect behavior, edge cases | Null pointer, race condition, wrong return value | | **Syntax** | Code that won't compile/run | Missing import, typo, invalid syntax | | **Style** | Code quality, best practices | Naming conventions, dead code, complexity | ```json .greptile/config.json theme={} { "commentTypes": ["logic", "syntax"] } ``` All types are enabled by default. To focus reviews, list only the types you want Greptile to leave. See [Controlling Nitpickiness](/docs/code-review/controlling-nitpickiness#comment-type-filtering) for examples. ### Suggested Fixes Most comments include a code suggestion you can apply: ```diff theme={} - const data = fetchData() + const data = await fetchData() ``` With [MCP](/docs/mcp-v2/overview), apply fixes directly from your IDE without copy-pasting. *** ## Troubleshooting **Check:** * Repository enabled in dashboard * Not a draft PR (skipped by default) * Branch not excluded by filters **Fix:** Comment `@greptileai` to trigger manually *** ## What's Next Now that you understand what a review looks like, learn how to interact with Greptile: Reactions, follow-ups, training, and daily workflows Control what Greptile flags Apply fixes without leaving your editor Enforce your team's rules # Greptile CLI Source: https://www.greptile.com/docs/code-review/greptile-cli Run local code reviews and manage Greptile from your terminal. Use the Greptile CLI to review local branches before you push. This page covers Greptile CLI v3.2.3. ## Install ```bash theme={} brew install greptileai/tap/greptile ``` ```bash theme={} npm install -g greptile@latest ``` ```bash theme={} curl -fsSL https://raw.githubusercontent.com/greptileai/cli/main/install.sh | bash ``` The npm package and install script require Node.js 22 or newer. Check the installed version: ```bash theme={} greptile --version ``` Upgrade npm and install script builds with `greptile update`. For Homebrew, run `brew upgrade greptile`. ## Sign in Sign in once on each device: ```bash theme={} greptile login ``` For CI or self-hosted deployments, use an API key: ```bash theme={} export GREPTILE_API_KEY=... greptile review ``` You can also store a key on the device. The command prompts for the key or reads it from stdin: ```bash theme={} greptile login --api-key ``` Do not pass the key as a command-line argument. Shell history and process lists can expose it. Check the current account and organizations: ```bash theme={} greptile whoami ``` Use `greptile logout` to remove stored credentials. See [CLI Reviews on Self-Hosted Greptile](/docs/self-hosting/cli-reviews) to connect the CLI to a self-hosted deployment. ## Review a branch Run a review from the repository root: ```bash theme={} git checkout new-feature greptile review ``` Greptile compares the current branch with the repository's default branch. It reviews committed changes that have not been merged. It ignores uncommitted changes.