Files
mintlify__docs/agent/github.mdx
mintlify[bot] 84b6096e2b Add documentation for @mintlify GitHub PR comment bot
Generated-By: mintlify-agent
2026-04-08 18:50:35 +00:00

50 lines
2.6 KiB
Plaintext

---
title: "Use the agent on GitHub"
description: "Mention @mintlify in pull request comments to trigger documentation updates directly from GitHub."
keywords: ["GitHub", "pull request", "PR comments", "code review"]
---
Mention `@mintlify` in a pull request comment to trigger a documentation update. The agent reads the PR context—title, description, changed files, and your comment—then makes the appropriate documentation changes.
## Prerequisites
Your repository must have the [Mintlify GitHub App](/deploy/github) installed.
## How it works
Comment `@mintlify` followed by your instructions on any pull request where the GitHub App is installed. The agent reacts with an 👀 emoji while processing, then replies with a summary and a 👍 when finished.
The agent handles two scenarios based on whether the PR is in your docs repository or a separate code repository:
- **Same-repo PR** — The agent pushes commits directly to the PR branch. This applies to dedicated docs repos, monorepos where code and docs live together, and any PR in the repository connected to your Mintlify deployment.
- **Cross-repo PR** — When the PR is in a different repository from your docs, the agent creates a new pull request in your docs repository with the relevant documentation updates, using the source PR's diff and description as context.
## Mention the agent in a PR comment
Leave a comment on a pull request that includes `@mintlify` and your instructions:
```text
@mintlify Document the new /users endpoint added in this PR
```
The agent supports three types of PR comments:
- **Issue comments** — General comments on the PR conversation tab.
- **Review comments** — Inline comments on specific lines of code. The agent receives the file path, line range, and diff context from your comment.
- **Review body** — The summary text when you submit a review.
## Follow up in the same PR
Send additional `@mintlify` comments on the same PR to iterate on the changes. The agent reuses the existing session, so it has context from previous interactions on that PR.
```text
@mintlify Also add a TypeScript code example to the new section
```
## Best practices
- **Be specific**: Tell the agent exactly what documentation to create or update and where it should go.
- **Use inline review comments**: When commenting on a specific code change, leave an inline review comment so the agent gets the file path and diff context.
- **Review pull requests**: Always review the documentation changes the agent creates before merging them.
- **Iterate on the same PR**: Follow-up comments on the same PR reuse the session, preserving context from earlier interactions.