{"meta":{"title":"将 Copilot 云代理与 Linear 集成","intro":"使用 Linear 中的 Copilot 集成，可在 Linear 工作区内直接提供上下文、自定义智能体运行方式以及打开拉取请求。","product":"GitHub Copilot","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/zh/enterprise-cloud@latest/copilot/how-tos","title":"操作方法"},{"href":"/zh/enterprise-cloud@latest/copilot/how-tos/copilot-integrations","title":"Copilot集成"},{"href":"/zh/enterprise-cloud@latest/copilot/how-tos/copilot-integrations/integrate-cloud-agent-with-linear","title":"将云代理与 Linear 集成"}],"documentType":"article"},"body":"# 将 Copilot 云代理与 Linear 集成\n\n使用 Linear 中的 Copilot 集成，可在 Linear 工作区内直接提供上下文、自定义智能体运行方式以及打开拉取请求。\n\n> \\[!NOTE]\n> GitHub Copilot 使用 AI。 检查是否有错误 请参阅“[应用卡片：GitHub Copilot 智能体](/zh/enterprise-cloud@latest/copilot/responsible-use/agents)”。\n\n在 Linear 中使用Copilot集成，无需离开 Linear 工作区即可调用Copilot cloud agent。 在 Linear 议题中，你可以发起 cloud agent 会话，自定义智能体所使用的模型、自定义智能体或分支，引导会话，以及打开拉取请求；这一切都基于你的议题描述和评论中的上下文。\n\n有关其他 Copilot 集成的信息，请参阅 [关于 Copilot 集成](/zh/enterprise-cloud@latest/copilot/concepts/tools/about-copilot-integrations)。\n\n> \\[!NOTE]\n> 当你在 Linear 问题中提及 @GitHub，或将 Copilot 分配给某个 Linear 问题时，代理会捕获该问题的完整描述和评论，作为你请求的上下文。 这有助于代理根据问题中的所有信息了解问题并实施适当的解决方案。 此上下文存储在拉取请求中。\n\n## 先决条件\n\n* 你必须拥有一个 GitHub 帐户，通过 Copilot 付费计划才能访问 Copilot。\n* 你必须有一个线性帐户，并且是团队成员。\n\n## 在 Copilot Linear 中安装应用\n\n> \\[!NOTE]\n>\n> * 若要在 Linear 中安装 Copilot 应用，你必须是想要在其中安装应用的组织或企业的所有者。 你还必须是 Linear 的工作区管理员。\n> * 如果你的组织是使用 带有数据驻留权的 GitHub Enterprise Cloud的企业的一部分，请从企业可用的 `SUBDOMAIN.ghe.com/apps/external-app/github-copilot-for-linear`应用列表中安装集成。 将 SUBDOMAIN 替换为企业的子域 GHE.com。\n\n应用 Copilot 只需在组织中安装一次。 安装应用后，组织的任何成员都可以将其 Copilot 帐户连接到应用并开始使用它。\n\n1. 转到 [Copilot “线性”页](https://github.com/apps/github-copilot-for-linear?ref_product=copilot\\&ref_type=engagement\\&ref_style=text) ，然后单击“ **配置**”。\n2. 按照屏幕上的提示，在您希望使用该应用的组织或企业中配置和授权应用程序。\n\n## 在 Linear 中使用 Copilot 应用\n\n首次在 Linear 中使用 Copilot 应用时，您必须将该应用连接到您的 GitHub 账户。 还必须指定要使用的 Copilot cloud agent 存储库。 只有拥有对指定存储库**写入**权限的用户才能触发Copilot cloud agent在该存储库中工作。 没有仓库 **写入** 权限的议题参与者可以通过在议题讨论中提供意见来帮助引导 Copilot，这些内容会在创建拉取请求时作为上下文使用。\n\n1. 在 Linear 中创建一个您想使用 Copilot cloud agent 的问题。\n2. 单击“ **分配** ”下拉列表，然后选择 **GitHub Copilot**。\n3. 如果尚未指定要使用的 Copilot cloud agent 存储库，系统会提示你立即执行此操作。 此时 Copilot cloud agent 会打开与此问题相关的拉取请求。\n4. 如果这是你第一次使用应用，系统会提示你登录到帐户 GitHub 并授权该应用。 按照提示完成授权。\n5. 在 Linear 问题的“链接”部分，你会看到 Copilot cloud agent 创建的已链接“\\[WIP]”拉取请求。 单击链接查看 GitHub 上的拉取请求。\n6. 当 Copilot cloud agent 完成对拉取请求的处理后，你的 Linear 问题的“活动”部分会添加一条通知。\n\n## 在 Linear 中自定义 Copilot cloud agent\n\n您可以使用 Linear 的代理指导，自定义 Copilot cloud agent 在 Linear 中的运行方式：既可以针对单个事项进行设置，也可以在整个工作区范围内统一设置。 使用 [线性代理指南](#using-linear-agent-guidance)最好设置一次定期首选项，例如默认存储库、首选模型或分支约定。\n\n### 使用 Linear 智能体指导\n\nLinear 的智能体指导是在工作区或团队层级设置的提示。 每次触发时，Linear 都会自动将此指南发送给 Copilot cloud agent。\n\n代理指南的常见用途包括：\n\n* 指定要对其打开拉取请求的默认存储库。\n* 指定首选模型。\n* 指定要使用的自定义代理。\n* 定义分支命名约定或默认基分支。\n\n有关 Linear 的代理指导的更多信息，请参阅 Linear 文档中的 [指导代理](https://linear.app/docs/agents-in-linear#guiding-agents)。\n\n### 选择模型\n\n从线性问题触发 Copilot cloud agent 时，可以通过在问题说明中指定模型来选择使用哪个模型 Copilot 。 有关详细信息，请参阅“[更改 GitHub Copilot 云代理的 AI 模型](/zh/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/cloud-agent/changing-the-ai-model)”。\n\n若要为工作区或团队中的每个运行设置默认模型，请将其添加到代理指南。 请参阅 [“使用线性代理”指南](#using-linear-agent-guidance)。\n\n### 使用自定义代理\n\n你可以通过在问题描述中指定要使用的代理，让 Copilot cloud agent 在从你的 GitHub 仓库打开来自 Linear 的拉取请求时使用自定义代理。 有关详细信息，请参阅“[为Copilot cloud agent创建自定义代理](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/create-custom-agents)”。\n\n若要始终在工作区或团队中使用相同的自定义代理，请在代理指南中指定它。 请参阅 [“使用线性代理”指南](#using-linear-agent-guidance)。\n\n### 设置基础分支和工作分支\n\nCopilot cloud agent 从 Linear 议题打开拉取请求时，可以选择：\n\n* 拉取请求所指向的**基础分支**。\n* **工作分支**名称 Copilot cloud agent 用于其提交。\n\n若要在每个运行中应用相同的基分支或分支命名约定，请将其添加到代理指南中。 请参阅 [“使用线性代理”指南](#using-linear-agent-guidance)。\n\n### 控制会话\n\n在 Linear 问题中触发 Copilot cloud agent 后，您可以继续向该代理下达指令。 为此，请在 Linear 问题的评论中提及 `@GitHub Copilot` 并附上其他说明，或在代理聊天面板中输入其他说明。\n\n## 延伸阅读\n\n* [关于 GitHub Copilot 云代理](/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/about-cloud-agent)\n* [管理对 GitHub Copilot 云代理的访问权限](/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/access-management)"}