> ## Documentation Index
> Fetch the complete documentation index at: https://www.mintlify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up a new Mintlify project for a user, follow the agent setup workflow in https://www.mintlify.com/docs/quickstart.md.
> For plans and pricing, see https://www.mintlify.com/pricing.md.

# 使用 Autopilot 让文档保持最新

> Autopilot 是一个 agent，它会在代码变更合并后打开 pull request，并执行持续维护，从而让内容保持准确和最新。

<Info>
  Autopilot 需要 [Pro 或 Enterprise 方案](https://mintlify.com/pricing?ref=autopilot)。
</Info>

Autopilot 是一个在后台工作、帮助你维护文档的 agent。你可以授予它对代码仓库和其他工具的读取权限，帮助它了解团队的工作流程和内容需求。当它检测到代码变更时，会打开 pull request 来建议文档更新，并标记你的团队进行审阅。

Autopilot 与[自动化](/docs/zh/automations)相互独立。自动化会在你配置的触发条件下为 agent 运行特定的提示词。Autopilot 则会自行决定需要更新哪些内容。它会检查哪些自动化处于启用状态，并避免与之重复。Autopilot 还会检查你已配置的自动化，以了解你的站点和内容需求。

默认情况下，Autopilot 会在代码变更时建议文档更新，并每天运行一次质量检查。

要更改 Autopilot 的工作内容和运行时间，请[与 Autopilot 聊天](#chat-with-autopilot)。

<div id="prerequisites">
  ## 前提条件
</div>

* 一个已连接到 GitHub 仓库的 Mintlify 项目。Autopilot 不支持 GitLab 或其他 Git 提供商。
* 在你的文档仓库以及希望 Autopilot 使用的所有源代码仓库上安装 [Mintlify GitHub App](/docs/zh/deploy/github)。

<div id="enable-autopilot">
  ## 启用 Autopilot
</div>

1. 在控制台中打开 [Autopilot](https://app.mintlify.com/products/autopilot) 页面。
2. 打开 **Autopilot** 卡片上的开关。

首次启用 Autopilot 时，它会运行首次检查，从你的文档、代码仓库和已连接的工具中构建上下文。这通常需要几分钟。首次检查完成后，你就可以与 Autopilot 聊天。

<div id="connect-repositories-and-tools">
  ## 连接仓库和工具
</div>

Autopilot 页面的 **Integrations** 部分列出了 Autopilot 读取的来源，Autopilot 通过这些来源了解你的团队如何发布产品以及你的文档涵盖哪些内容。

<div id="github-repositories">
  ### GitHub 仓库
</div>

如果你尚未连接 GitHub，请点击 **GitHub** 行中的 **Connect** 来安装 Mintlify GitHub App。

要选择 Autopilot 用作上下文的仓库：

1. 点击 **GitHub** 行中的 **Configure**。
2. 在 **Additional repositories** 下，选择希望 Autopilot 使用的源代码仓库。
3. 点击 **Save**。

你的文档仓库始终作为 Autopilot 的必需上下文包含在内，因此无法移除。

**Additional repositories** 列表仅显示已安装 Mintlify GitHub App 的仓库。要添加未列出的仓库，请先在该仓库上安装 GitHub App。

<div id="slack-and-other-integrations">
  ### Slack 和其他集成
</div>

点击 **Slack** 行中的 **Connect**，让 Autopilot 能够从对话中获取上下文。如果你在 Autopilot 页面断开 Slack 连接，Mintlify Slack 应用将从你的工作区中移除，所有使用它的产品（包括自动化）都会受到影响。

该部分还列出了你的组织可用的受支持[共享集成](/docs/zh/automations/integrations)，例如 Linear、Jira、Notion、Confluence、PostHog、Zendesk、Intercom、Plain 和 Pylon。Autopilot 会读取你已连接的集成作为上下文。

<div id="how-autopilot-opens-pull-requests">
  ## Autopilot 如何打开 pull request
</div>

Autopilot 会将更改提交到一个新分支并打开 pull request。它从不直接推送到你的部署分支或仓库的默认分支。

默认情况下，pull request 以你的部署分支为目标。如果你的团队将更改合并到与站点部署分支不同的分支，请在聊天中告诉 Autopilot，它就会改为以该分支为目标。

<div id="reviewers-and-emails">
  ### 审阅者和电子邮件
</div>

默认情况下，Autopilot 会将每个 pull request 分配给它识别为变更代码负责人的团队成员，请求其审阅，并通过电子邮件通知其该 pull request。要请求更多人审阅或更改审阅者，请在聊天中告诉 Autopilot。

Autopilot 从 `autopilot@mintlify.com` 发送电子邮件。将此地址添加到你的电子邮件联系人中，以避免被垃圾邮件过滤器拦截。

Autopilot 只会向你的 Mintlify 组织成员，或你的组织成员所使用的公司电子邮件域名下的地址发送电子邮件。

<div id="review-suggestions">
  ## 审阅建议
</div>

Autopilot 打开的 pull request 会显示在控制台 [Autopilot](https://app.mintlify.com/products/autopilot) 页面的 **Suggestions** 下。

点击某条建议即可打开它。每条建议都会显示 pull request 的标题、仓库、分支以及变更文件和行数。如果存在预览部署，点击 **Preview** 即可在你的站点上查看更改。

* 点击 **Accept** 合并 pull request。
* 点击 **Close** 关闭 pull request 而不合并。
* 发送消息请求修改。Autopilot 会更新 pull request。

如果 pull request 存在合并冲突，或你的分支保护规则阻止了合并，请在 GitHub 上解决。

<div id="chat-with-autopilot">
  ## 与 Autopilot 聊天
</div>

在 [Autopilot](https://app.mintlify.com/products/autopilot) 页面上，点击 **Autopilot** 卡片上的 **Chat to configure**，在 Agent 面板中开始与 Autopilot 对话。

在聊天中，你可以询问有关 Autopilot 工作的问题、为今后的工作提供指示，以及暂停或恢复某类工作。当你恢复计划任务时，它会在下一个计划时间运行。

你可以与 Autopilot 进行的聊天示例包括：

* 询问 Autopilot 做了什么以及原因，例如它为什么打开某个 pull request。
* 询问 Autopilot 何时运行，以及它使用哪些仓库和集成。
* 让 Autopilot 指定某位团队成员审阅 pull request。
* 让 Autopilot 每周运行一次失效链接检查。

聊天需要编辑者或管理员[角色](/docs/zh/dashboard/roles)。Autopilot 暂停期间，你无法开始新的聊天。

<div id="pause-autopilot">
  ## 暂停 Autopilot
</div>

要暂停 Autopilot，请关闭 **Autopilot** 卡片上的开关。

恢复 Autopilot 后，它会了解暂停期间发生的变更，但不会为这些变更创建更新。

<div id="automatic-pauses">
  ### 自动暂停
</div>

每次运行前，Autopilot 都会检查你的方案和积分。在以下任一情况下，它会自行暂停而不是运行：

* 你的组织积分已用完。请[添加积分](/docs/zh/credits#credit-add-ons)，然后重新打开开关。
* 你的方案不再包含 Autopilot。要恢复运行，请升级到包含 Autopilot 的方案。

<div id="credits">
  ## 积分
</div>

每次打开或更新 pull request 的 Autopilot 运行消耗 250 个积分。未打开或更新 pull request 的运行不消耗任何积分。

有关更多信息，请参阅 [积分定价](/docs/zh/credits)。


## Related topics

- [skill.md](/docs/zh/ai/skillmd.md)
- [指南](/docs/zh/guides/index.md)
- [llms.txt](/docs/zh/ai/llmstxt.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.