# Graphite > ## Documentation Index --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/advanced-tutorials.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Advanced Tutorials > Take it to the next level with advanced CLI commands. Use the CLI to easily rearrange branches in your stack. Collaborate with your teammates on a stack of pull requests. Create and sync pull requests against multiple trunks. --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/ai-ingestion.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # LLM-Friendly Documentation > Optimized formats of Graphite Documentation for ingestion as context for LLMs and AI tools. [llms-txt](https://llmstxt.org/) files are specialized documentation resources designed specifically for AI and Large Language Model (LLM) consumption. These files provide structured, machine-readable documentation. ### /llms.txt The `/llms.txt` file is an industry standard that helps general-purpose LLMs index more efficiently, similar to how a sitemap helps search engines. AI tools can use this file to understand documentation structure. Download Graphite Documentation's `/llms.txt` file at: [https://graphite.com/docs/llms.txt](https://graphite.com/docs/llms.txt) ### /llms-full.txt The `/llms-full.txt` file combines the entire documentation site into a single file as full context for AI tools. Download Graphite Documentation's `/llms-full.txt` file at: [https://graphite.com/docs/llms-full.txt](https://graphite.com/docs/llms-full.txt) --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/ai-privacy-and-security.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # AI Privacy and Security > Graphite offers a handful of AI features to automate parts of the developer workflow. These features are opt-in and do not store or train on your data. Graphite offers a handful of generative AI features to automate parts of the developer workflow. Examples of our AI features include: * Generating pull request titles and descriptions * Generating review comments * Generating suggested edits in response to review comments * And others coming soon We know that AI can be a sensitive topic for many organizations, which is why: * By default, Graphite does not include your data in any requests we make to either of our AI subprocessors (currently Anthropic and OpenAI;see below for more details) * Graphite will always ask for user approval before triggering or enabling features that include your data in requests to either of these subprocessors * Neither Graphite nor any of its subprocessors use your data to train their models * Graphite holds a high bar when protecting your data, as outlined in our [Terms of Service](https://graphite.com/terms-of-service) and [Privacy Policy](https://graphite.com/privacy) Many of our AI features are powered through partnerships with Anthropic and OpenAI, who currently act as our AI subprocessors. We have strict agreements in place with both companies that explicitly prohibit the use of your data to train models, and your data remains protected and confidential at all times. Our agreements are available here: * Anthropic: * Agreement: [https://www.anthropic.com/legal/commercial-terms](https://www.anthropic.com/legal/commercial-terms) * Your data is not used for training: [https://support.anthropic.com/en/articles/7996885-how-do-you-use-personal-data-in-model-training#h\_1a7d240480](https://support.anthropic.com/en/articles/7996885-how-do-you-use-personal-data-in-model-training#h_1a7d240480) * OpenAI: * Agreement: [https://openai.com/policies/business-terms/](https://openai.com/policies/business-terms/) * Your data is not used for training: [https://openai.com/enterprise-privacy/](https://openai.com/enterprise-privacy/) These subprocessors receive the minimum data necessary to generate the best possible response; examples of data we may send them include: * Any metadata around the pull request (author, timestamp, etc.) * The code the pull request changes * Related or similar pull requests * Related or similar parts of your codebase We are committed to protecting your data and privacy at all times, and we understand that some organizations would rather not use these features at all. To disable AI features across your entire organization, please email [support@graphite.com](mailto:support@graphite.com) and request a complete block of all AI features for your organization. You can always email us again if you change your mind, and we will unblock these features for your organization upon request. Lastly, depending on your plan, enabling some of these features may have additional costs. For more details on our features and pricing, please see our [pricing page](https://graphite.com/pricing). --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/ai-review-comments.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Review comments > Understanding Graphite Agent's feedback and how to get the most value from it ## How Graphite Agent provides feedback When Graphite Agent identifies an issue in a pull request, it adds a comment directly on the relevant lines of code. Each comment includes: 1. A clear description of the problem 2. An explanation of why it matters 3. A concrete suggestion for how to fix it You can see Graphite Agent's comments, suggestions, and choose to commit suggestions — just like your teammates'. ## Types of issues Graphite Agent identifies Graphite Agent catches a wide range of issues that often slip through manual code review and testing: ### Logic bugs Graphite Agent identifies when your implementation doesn't match the intended behavior, detecting issues like: * Functions that don't accomplish what they're named to do * Inconsistencies between code behavior and documentation * Mismatches between API usage and implementation * Off-by-one errors and incorrect loop boundaries ### Edge cases Graphite Agent finds potential failure modes that aren't handled in your code: * Missing null checks or error handling * Race conditions in asynchronous code * Memory leaks and resource management issues * Unexpected side effects ### Security vulnerabilities Graphite Agent spots security issues before they reach production: * SQL injection vulnerabilities * Cross-site scripting (XSS) opportunities * Authorization bypass possibilities * Insecure cryptographic practices ### Performance issues Graphite Agent detects code that might cause performance problems: * Inefficient algorithms or data structures * Unnecessary API calls or database queries * Memory-intensive operations that could be optimized * N+1 query patterns ### Accidentally committed code Graphite Agent catches code that was likely not meant to be committed: * Debug statements and console logs * Test data and development configurations * Commented-out code blocks * Temporary workarounds ## Tracking AI review impact You can monitor AI review activity and impact from the [AI code review dashboard](https://app.graphite.com/ai-reviews). The dashboard is organized into tabs for easy navigation: ### Overview tab The **Overview** tab provides time-series metrics to help you understand your AI reviewer's performance: * **Issues found**: Total issues identified, with a breakdown by category * **Issues accepted**: Number of issues that led to code changes * **Acceptance rate**: Percentage of suggestions that were accepted over time * **PRs reviewed**: Volume of pull requests analyzed * **Downvote rate**: Feedback tracking to identify areas for improvement You can filter these metrics by: * **Time period**: Last 4 weeks, 8 weeks, 12 weeks, or all time * **Repository**: View metrics for specific repositories or across all repos The category breakdown shows counts and acceptance rates for each issue type (logic bugs, security issues, edge cases, etc.), helping you understand where your reviewer adds the most value. ### Comment feed tab The **Comment feed** tab lets you: * View all comments Graphite Agent has left across your repositories * Filter by category to focus on specific types of issues * See prevented bugs and their potential impact * Review code snippets with inline explanations ### Rules & exclusions tab The **Rules & exclusions** tab shows detailed analytics for your custom rules and exclusions. See [Measuring rule and exclusion effectiveness](/ai-review-customization#measuring-rule-and-exclusion-effectiveness) for more details. ## How to check AI review status For any pull request, you can see the AI review status in the right-hand panel of the PR page: The status will show as: * **Running**: Graphite Agent is currently analyzing the PR * **Completed**: Graphite Agent has finished reviewing and left any relevant comments * **Not running**: The PR won't be analyzed (e.g., if the PR exceeds 200,000 characters) --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/ai-review-customization.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Customization > Tailor AI reviews to your team's specific needs and coding standards ## Making AI reviews work for your team While Graphite Agent will catch bugs out of the box, you can customize its behavior to better match your team's specific needs and coding standards. AI reviews offer two primary customization options: **Exclusions** and **Custom rules**. ## Exclusions: Specifying what to ignore Comment exclusions allow you to specify situations where Graphite Agent should **not** leave comments. This reduces noise and focuses AI reviews on what matters most to your team. Common exclusion use cases: * **Ignore generated code**: Prevent extraneous comments on generated code from build artifacts, schemas, and other generated files. * **Skip specific types of comments**: Turn off categories of feedback that aren't relevant to your team * **Ignore certain repositories or directories**: Focus AI reviews where they matter most * **Exclude specific patterns**: Define patterns that shouldn't be flagged (e.g., team-specific style conventions) ### Best practices for writing exclusions Make the language as targeted as possible by specifying the exact scope where the exclusion should apply. If an exclusion is written too broadly, then Graphite Agent may not leave valid comments. Bad example: ```text ### Bad example: Overly broad exclusion Don't suggest performance improvements. ``` Why is this bad? * This is too broad and would miss legitimate performance issues. The rule could be rewritten instead as: ```text Do not suggest performance optimizations for code in the /scripts directory - these are one-time utility scripts. ``` Good example: ``` ### Good example: Language-specific syntax exclusion Do not comment on missing "return" keywords in Kotlin single-expression functions. This is valid Kotlin syntax. ``` To set up exclusions: 1. Go to the [AI reviews dashboard](https://app.graphite.com/ai-reviews) 2. Navigate to the **Rules & exclusions** tab 3. Click "Add" next to Comment exclusions and save your exclusion ## Custom rules: Teaching Graphite Agent your standards Custom rules allow you to define explicit guidelines for Graphite Agent to follow when reviewing your code. This is especially powerful for enforcing team-specific best practices. With custom rules, you can: * Define coding standards specific to your codebase * Implement architectural guidelines for your team * Enforce security or performance best practices * Ensure consistent patterns across your repositories There are two ways to configure custom rules: custom prompts and file-based rules. Below is our recommendation for when each option is most appropriate. ### Custom prompts (Recommended) Custom prompts are rules written directly in the Graphite UI. They're the recommended approach for most teams. **Why custom prompts work best:** * **Focused**: Each rule addresses one specific concern * **Fast to iterate**: Test and refine rules based on their effectiveness * **Better performance**: No file processing overhead * **Easy to manage**: All rules across all repos visible in a single interface **Getting started:** 1. Use built-in templates for common scenarios: * Language-specific style guides (JavaScript, Python, Go, etc.) * Security best practices * Accessibility standards 2. **Start small**: Create focused rules that address specific concerns * Example: "JavaScript error handling patterns" * Example: "API response formatting standards" 3. **Quick start**: Copy relevant sections from your existing coding guidelines and refine them into focused rules ### File-based rules File-based rules reference existing documentation in your repository using glob patterns. Use these sparingly when you have living documentation that changes frequently. **When to use file-based rules:** * Documentation maintained by other teams that changes regularly * Shared architectural decision records across repositories * Style guides that are actively updated **How they work:** 1. Specify a glob pattern (e.g., `docs/coding-style.md`) 2. Graphite Agent reads the file content from your repository 3. Uses that content as context during code review **Recommended file paths:** Store your rules alongside your other code generation markdown files, or use one dedicated folder per repository. Common patterns include: ``` docs/coding-standards.md # Specific documentation file CONTRIBUTING.md # Contributing guidelines docs/architecture/*.md # Architecture documentation .github/rules/*.md # Rules folder in your repo ``` **Limitations:** * Large files are truncated for performance * Too many files can reduce review quality * Glob patterns are case-sensitive ### Best practices for writing custom rules **Structure your rules clearly:** * **Format**: Rule → Bad example → Good example → Reasoning * **Focus**: One specific concern per rule * **Examples**: Provide 2-3 clear, contrasting examples * **Test**: Try your rule on recent PRs to verify it adds value **What works best:** * Language-specific conventions (naming, imports, error handling) * Security guidelines (authentication, data validation) * Framework-specific patterns (React hooks, API design) **What to avoid:** * Unnecessary context ("you are a staff-level engineer") * Overly broad rules ("write good code") * Praise * Non-prescriptive verbs ("comment on" or "flag") * Comments that should actually be exclusions ("don't comment on") Bad examples: ``` ### Bad example 1: Vague database rule Rule: Don't make breaking changes to database fields. When dropping or adding fields could cause issues, flag them in review. ``` Why is this bad? * Too vague. What counts as a breaking change to database fields? * "Flag" is a non-prescriptive verb. Leaving a comment inherently means flagging an issue. What should Graphite Agent tell engineers to do instead? A better alternative would be: "Never drop a required field directly. Always make it nullable first and stop writing to it so that it is no longer used by the entity." * No examples provided. ``` ### Bad example 2: Unclear CSS class naming rule Always comment on color values like #FF0000 being used in stylesheets. Don't comment on utility classes like bg-red-500 or text-primary. ``` Why is this bad? * "Comment" is a non-prescriptive verb. Instead, the rule should specify what Graphite Agent's comment should contain. * This isn't phrased as a rule. The rule should be stated clearly as "Never use hex color values directly, always use design system tokens instead." * More context is needed. The rule should specify which files or frameworks this applies to (CSS files, styled-components, etc.). * This prompt mixes custom rules and exclusions. The latter sentence is not necessary. Good examples: ```` ### Good example 1: Security rule with clear structure ## Security Rules ### Rule: Never expose detailed error messages **Rule:** Never expose detailed error messages that reveal stack traces or internal system details. In production environments, always return generic error messages to protect the system while logging full details internally for debugging. **Bad example:** ```js app.use((err, req, res, next) => { res.status(500).json({ error: err.stack }); }); ``` **Good example:** ```js app.use((err, req, res, next) => { res.status(500).json({ error: "Internal Server Error" }); }); ``` **Reasoning:** Revealing stack traces or internal error details can leak sensitive implementation information, making it easier for attackers to exploit vulnerabilities. ```` ```` ### Good example 2: Database rule with specific context ## Database Rules ### Rule: Use `text` instead of `varchar(n)` for new PostgreSQL columns **Rule:** When adding new string columns to TypeORM entities, always use `text` type instead of `varchar(n)` unless there's a specific business requirement for length constraints. **Good example:** ```ts @Column({ type: 'text' }) description: string; ``` **Bad example:** ```ts @Column({ type: 'varchar', length: 255 }) description: string; ``` **Reasoning:** PostgreSQL handles `text` and `varchar` identically in terms of performance, but `text` avoids arbitrary length limits that can cause issues as data grows. ```` For additional recommendations, see [Anthropic's suggestions for prompt engineering best practices](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices#be-explicit-with-your-instructions). To set up custom rules: 1. Go to the [AI reviews dashboard](https://app.graphite.com/ai-reviews) 2. Navigate to the **Rules & exclusions** tab 3. Click "Add" next to Custom rules 4. Choose a template or add a custom prompt for your new rule 5. Save your configuration ## Excluding files from AI review For large repositories, you may want to exclude certain files from AI review analysis. This is useful for: * Data files that don't need to be reviewed * Generated code that is automatically created by tools * Any files that would make a PR too big for Graphite Agent to analyze You can exclude files by marking them as generated files in your repository's `.gitattributes` file: ``` # Exclude specific files docs/data.txt linguist-generated=true # Exclude file types *.csv linguist-generated=true *.pb.go linguist-generated=true # Exclude entire directories data/** linguist-generated=true generated/** linguist-generated=true ``` Files marked as `linguist-generated` will be: * Automatically collapsed in both Graphite and GitHub pull request views * Excluded from AI review when determining if a PR is too large * Skipped during the AI review process For more information, see GitHub's documentation on [customizing how changed files appear on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github). ## PR-level filtering Advanced PR-level filtering provides granular control over where AI reviews run. You can configure AI reviews to run on specific pull requests based on defined criteria. With PR-level filtering, you can control AI reviews based on: * **PR author**: Run reviews only for specific team members or external contributors * **File paths**: Analyze PRs only when certain files or directories are modified * **PR labels**: Trigger reviews based on GitHub labels applied to pull requests * **PR title and description**: Filter based on text content in PR titles or descriptions * **Parent branch**: Run analysis based on target branch naming conventions PR-level filtering provides flexibility to: * **Control usage and costs**: Optimize AI review usage by focusing on the most important PRs * **Focus analysis on critical PRs**: Ensure reviews target high-impact changes while skipping routine updates * **Implement organization-specific review policies**: Align AI review behavior with your team's development workflows and governance requirements Once saved, AI reviews will only run on new and updated pull requests that match the configured settings in enabled repositories. You can configure these settings through the **Settings** tab on the AI reviews dashboard, and organization admin permissions are required to modify them. ## Measuring rule and exclusion effectiveness The **Rules & exclusions** tab on the [AI reviews dashboard](https://app.graphite.com/ai-reviews) provides detailed analytics for each custom rule and exclusion you've created. ### Custom rules metrics For each custom rule, you can track: * **Issues found**: Total issues flagged by this rule * **PRs reviewed**: Number of pull requests where this rule was applied * **Accepted issues**: Issues that led to code changes * **Acceptance rate**: Percentage of issues that were accepted * **Upvote/Downvote rates**: Direct feedback from your team ### Comment exclusions metrics For each exclusion, you can track: * **Issues checked**: Total issues evaluated against this exclusion * **PRs reviewed**: Number of pull requests where this exclusion was applied * **Issues caught**: Issues that were filtered out by this exclusion * **Percentage caught**: Proportion of checked issues that were excluded ### Using metrics to optimize Use these metrics to: * Identify high-performing rules to use as templates for new rules * Refine or remove rules with low acceptance rates * Understand which rules resonate with your team * Fine-tune exclusions that are filtering too many or too few issues --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/ai-review-experimental-comments.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Experimental comments > Learn about experimental AI review comments and how to provide feedback ## About experimental comments ### Why am I seeing this? As a part of improving Graphite Agent, some comments that users receive are created by **experimental pipelines** that the team is testing. By testing these experimental pipelines, we can learn what works well and what doesn't, which helps us build features that truly improve your development experience. ### We'd appreciate your feedback Your input is incredibly valuable and helps us make Graphite Agent better for everyone. We want to know: * What did you find helpful about this comment? * What could be improved? * Would you want to see more comments like this in the future? Our team reviews each comment that receives feedback to improve Graphite Agent and deliver a better experience. ### How to leave feedback Use the 👍 or 👎 reaction on the comment itself in your PR, in Graphite or in GitHub. **If you downvote on Graphite**, a popup will appear asking for more details. Your specific feedback helps us understand what went wrong and how to improve future reviews. Our team may reach out to you to ask for more information. Feedback popup for experimental comments --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/ai-reviews-setup.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Setup & configuration > Get started with AI reviews in under 5 minutes ## Getting started with AI reviews AI reviews can be enabled in just a few clicks, with no configuration required to start catching bugs in your pull requests. ### Enabling AI reviews 1. Navigate to the [AI code review settings page](https://app.graphite.com/ai-reviews?reviewerTab=settings) 2. Select the repositories where you want AI reviews enabled * You can choose specific repositories or enable AI reviews across your entire organization * If you don't see the repositories you're looking for, make sure they're [synced with Graphite](https://app.graphite.com/settings/synced-repos) 3. Click "Save" to save your settings. Graphite Agent will now automatically review all new pull requests in the selected repositories ### What happens next Once enabled, Graphite Agent: * Automatically analyzes new pull requests in the selected repositories * Comments directly on pull requests when it finds potential issues * Suggests fixes for the problems it identifies Graphite Agent works behind the scenes, with no changes required to your existing PR workflow. Your team can continue using GitHub just as they do today, with Graphite Agent providing additional feedback alongside human reviewers. For teams using continuous integration, Graphite Agent works alongside your test suite to catch issues that tests often miss, like logic bugs, edge cases, and security vulnerabilities. You can monitor AI review performance from the **Overview** tab on the [AI code review dashboard](https://app.graphite.com/ai-reviews), which shows metrics like issues found, acceptance rates, and PRs reviewed over time. ## Enabling AI reviews on personal repositories In order to enable AI reviews on your personal repositories, you must first install the Graphite GitHub App on your personal account. 1. Navigate to your [GitHub authentication settings page](https://app.graphite.com/settings) 2. If this is your first time authenticating Graphite using the GitHub App, select the "Install GitHub App" button; otherwise, select the "Add organization" button. 3. Install the Graphite GitHub App using the pop-up window that appears, selecting your personal account's login. 4. After returning to the GitHub authentication settings page, click the "Join team" button next to your personal account's login. After completing these steps, you can enable AI reviews on your personal account following the instructions for [Getting started with AI reviews](/ai-reviews-setup#getting-started-with-ai-reviews). You can only enable AI reviews on personal repositories that you own. ## Advanced configuration While AI reviews work great out of the box, you can customize them to better fit your team's workflow and standards. Navigate to the **Rules & exclusions** tab on the [AI code review dashboard](https://app.graphite.com/ai-reviews) to configure these options, or see our [Customization](/ai-review-customization) page for details on: * Setting up exclusions to prevent Graphite Agent from commenting on certain types of issues * Creating custom rules that match your team's coding guidelines * Excluding files from AI review analysis The **Rules & exclusions** tab also shows metrics like acceptance rate and issues caught for each rule and exclusion, helping you track their effectiveness over time. --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/ai-reviews.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # AI Reviews > Catch bugs before they ship to production with AI code review AI reviews powered by Graphite Agent help your team build better software by automatically reviewing pull requests and catching bugs before they ship. ## How AI reviews help your team AI reviews analyze every pull request in your repositories, identifying potential issues and suggesting fixes instantly - no manual configuration required. AI reviews help your team: * **Ship faster**: Reduce review cycles and speed up the merge process * **Fix bugs early**: Catch logic issues, edge cases, and performance problems before they reach production * **Improve code quality**: Get actionable feedback that makes your codebase more robust * **Reduce incidents**: Prevent bugs that cause outages or customer-facing issues ## What makes AI reviews different Unlike other code review tools, AI reviews: * **Focuses on real bugs** - not just style issues or best practices * **Understands context** - analyzes your entire codebase to provide relevant feedback * **Provides actionable suggestions** - shows exactly how to fix issues, not just what's wrong * **Learns from feedback** - improves based on how your team interacts with comments Ready to see AI reviews in action? Get started in minutes: Enable AI reviews and get immediate feedback on your PRs. See the types of bugs Graphite Agent catches and how it communicates them. Tailor AI reviews to your team's specific needs and coding standards. Track acceptance rates, measure rule effectiveness, and optimize review quality. *AI reviews are designed with the security of your data in mind. You can find more details in our [AI security and privacy](/ai-privacy-and-security) page.* --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/authenticate-with-github-app.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Authenticate With GitHub > Graphite is built on top of GitHub's APIs, so you need to provide Graphite access to your GitHub resources to create, review, and merge PRs. ## GitHub authentication methods Currently, GitHub is the only git provider that Graphite integrates with. When setting up an account with Graphite, you'll have two options to authenticate with GitHub: * Option 1: Install [the Graphite App](https://github.com/apps/graphite-app) (a GitHub App) on your organization ***(recommended)*** * Option 2: Provide Graphite with a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) We no longer support OAuth as an authentication method. Users who previously authenticated with OAuth remain supported, but new signups must use GitHub App or PAT. ## Option 1 - Install the Graphite GitHub App When creating an account on Graphite, it's strongly recommended that you install or request installation of Graphite's GitHub App on your organization. GitHub Apps are the officially [recommended way](https://docs.github.com/en/apps/publishing-apps-to-github-marketplace/github-marketplace-overview/about-github-marketplace-for-apps) to integrate with GitHub. Some benefits for installing [Graphite’s GitHub App](https://github.com/marketplace/graphite-dev) on your organization: * Access to GitHub webhooks, which provides Graphite with push-based updates for information like CI status, mergeability, and real-time push events within seconds. * Access to the Graphite Merge Queue. The Merge Queue is only available if our GitHub App is installed on the organization. * Avoid hitting secondary rate limits with the GitHub API. This means fewer API requests to keep your data up-to-date, leading to fewer API errors and lower latency. * Provides the most security for your organization, giving users more control over which repositories the app can access through fine-grained permissions and short-lived tokens. ### Install the Graphite App on an organization You can only install a Graphite App on an organization if you're an organization owner. If you're not an owner, you should [request to install the Graphite App](/authenticate-with-github-app#request-to-install-the-graphite-app-on-an-organization) instead. If you're an organization owner, you can install the Graphite App on your chosen organization by following the Graphite onboarding flow, or directly from the [GitHub marketplace.](https://github.com/apps/graphite-app) See GitHub's instructions to [install an App from the GitHub marketplace](https://docs.github.com/en/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-organizations). ### Request to install the Graphite App on an organization If you're not an organization owner, you can [request approval for the app to be installed](https://docs.github.com/en/apps/using-github-apps/requesting-a-github-app-from-your-organization-owner). Once you've done so, you should reach out to an organization owner to have your request approved. You can find a list of organization roles and members using this link: `https://github.com/orgs/{org-name}/people`. ### Authorize the GitHub App with your personal account After the Graphite App has been installed on your organization or if you're signing up for Graphite with an organization that has the app installed, you'll also need to [give the Graphite App approval](https://docs.github.com/en/apps/using-github-apps/authorizing-github-apps) to retrieve information about your GitHub account and make changes on your behalf. The screen to do so will look like this: If your GitHub Organization uses [SAML SSO authentication](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-single-sign-on/about-authentication-with-single-sign-on), ensure that your GitHub user account also has an active SAML session with the organization on GitHub while authorizing the GitHub app. ## Option 2 - Provide Graphite with a Personal Access Token If you're unable to authenticate/install the Graphite App for any reason, you can always use Graphite with a Personal Access Token. At any point in the Graphite onboarding flow, you can click **"Authenticate with a personal access token"**, and the screen will look like this: From here, generate a token on GitHub with the requires scopes pre-selected and paste it into the field to continue account creation. Learn more about the scopes Graphite requires in our [privacy and security docs](/privacy-and-security). **Warning** GitHub Personal Access Tokens are designed to give command line tools limited access to work with your account. While they provide the minimum clearance to use the Graphite CLI and app, they give the user the added responsibility of granting the token the correct permissions and have a limited lifespan before they expire. You may have a slower/limited experience with Graphite if you proceed with a PAT. ## Manage GitHub authentication To make adjustments to your GitHub authentication and the resources which Graphite has access to, go to your [GitHub authentication settings](https://app.graphite.com/settings?org=withgraphite) in Graphite: --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/automations.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Automations > Learn how to automate tedious code review tasks like assigning reviewers, adding labels, and more with automations. Graphite supports automating common actions when PR attributes meet your specified criteria by creating automation rules. With these rules, automatically take actions such as adding reviewers, labels, or comments when a PR is opened by a specific author, containing files in specific directories, or a variety of other powerful filters. ## Automation rules Automation rules have two aspects: a filter trigger and an action. ### Filter trigger To specify the filtering trigger for PRs: * You can use any of the filters powering Graphite's PR inbox today * Additionally, you can specify a glob pattern for filenames. With this, you can create rules for PRs containing common suffixes (e.g. `**/*.ts` files), or that are contained in specified sub-directories (e.g. `**/myteam/**`), among other patterns. ### Actions When a PR matches your condition, you can configure one or more of the following actions: * Add reviewers to the PR. This supports both individuals and GitHub teams. * Add assignees to the PR. This supports making the PR author the assignee. * Add labels to the PR. * Leave a comment on the PR. For example, you can leave a reminder for PRs opened containing changes to a particularly sensitive area of the code. * Notify someone through Slack. For example, set a notification for all frontend changes for instances when you want to know about a change, but don’t necessarily want to be added as the reviewer. * Post a GIF on the PR. For example, post a random "approved!" GIF from GIPHY each time a PR is fully approved. ## Manage rules Navigate to *Automations* from the sidebar in the Graphite web app. ### **Create rules** * Click **Create rule**. * Specify the repository for the rule. Note that this must be one of your synced repositories (see [configuring default repositories](/use-pr-inbox#default-repositories)). * Configure the conditions you want to match PRs on, and the actions to automatically take on those matched PRs. To confirm your conditions are configured correctly, you can preview past PRs that match your rules before activating the rule. When you're done, click **Activate rule**. This automatically applies the rule to open PRs that match your triggers, as well as all matching PRs going forward, until the rule is deactivated. Rules match once per PR. If a PR doesn't initially match, it's re-evaluated on each update until there is a match. After it's matched once, it won't trigger again on that PR, avoiding surprises like leaving the same comment repeatedly. Automations evaluate on published PRs only, and do not evaluate on PRs that are closed or in draft mode. ### View rules To view a rule, navigate to *Automations* in the Graphite web app. There you'll see a list of all active rules in your GitHub org for repositories that you have access to. If you don't have access to a given repository, you won't see rules configured for it. ### Edit rules To edit a rule, navigate to \*Automations \*in the Graphite web app. Click the pencil icon to edit the rule. You can edit any rule for repositories you have access to, making it easy for teammates to update shared team rules. Because PR actions trigger at most once, if a given PR has previously already matched a rule that you're editing, note that it won't re-evaluate again after you edit your rule. This means that if you change your actions, those new actions won't apply to previously matched PRs. ## Rule triggering When a rule triggers on a PR, Graphite automatically applies the triggers. Graphite will also leave a comment on the PR on GitHub to let the author know the rule matched, including a link to the rule in Graphite so it's easy to see why that rule matched the PR. --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/background-agents.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Background Agents > Describe what you want built or fixed in plain language, and Graphite spins up a remote sandbox to write the code, run tests, and open a pull request for your review. Ship code without opening your IDE. Background Agents let you describe what you want built or fixed in plain language, and Graphite spins up a remote sandbox to write the code, run tests, and open a pull request for your review. It's the fastest way to go from idea to reviewable PR - no local environment, no setup, just results. ## What you can do * **Quick fixes on the go** - Push a small change from your phone or browser without cloning a repo * **Generate boilerplate** - Scaffold new features, add API endpoints, or write SQL queries * **Add tests** - Expand coverage without context-switching out of code review * **Ship faster** - Delegate repetitive tasks and review the output in Graphite's PR interface ## Getting started 1. Go to [**Preferences → Background Agents**](https://app.graphite.com/settings/preferences) and toggle it on 2. Open the **Background Agents** page in the sidebar (🪄 icon) 3. Select a repo and enter a prompt describing what you want 4. Hit **Submit** - Graphite runs the agent and opens a draft PR when it's done You'll get **\$10 of free usage** to try it out. For unlimited usage, add your own Claude API key in the Background Agents settings. ## Privacy and security **No training on your code.** Graphite does not train models on your code, regardless of the product you use. **Zero Data Retention.** Graphite maintains Zero Data Retention agreements with all model providers. Your code is processed only to complete the requested task and is not stored or used for training. ### Using Graphite-managed credits When using free credits or a Graphite-managed API key, your usage is covered under Graphite's privacy terms and our Zero Data Retention agreements with model providers. ### Bring your own API key When you provide your own API key (e.g., for Anthropic's Claude), the data handling and privacy terms are governed by your direct agreement with that provider. ## Execution environment Background Agents run in isolated, ephemeral sandboxes. Each task spins up a fresh environment with access only to the repository and context you provide. Sandboxes are destroyed after task completion. ## Related * [AI Privacy and Security](/ai-privacy-and-security) - Overview of Graphite's AI privacy practices --- # Source: https://graphite-58cc94ce.mintlify.dev/docs/basic-tutorials.md > ## Documentation Index > Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.dev/docs/llms.txt > Use this file to discover all available pages before exploring further. # Basic Tutorials > Understand the core CLI commands. Start the transition from git to gt. Build new branches on top of existing ones. Keep your work up-to-date with the latest changes on remote. ## Walkthrough In this video, we cover creating and traversing a stack using `gt log short`, `gt checkout`, `gt create`, and `gt submit`.