{"meta":{"title":"开始使用 Copilot 上的 GitHub 智能体","intro":"试试 Copilot cloud agent 的端到端过程，大约用时十分钟。","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-on-github","title":"Copilot 上 GitHub"},{"href":"/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/use-copilot-agents","title":"使用 Copilot 代理"},{"href":"/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/use-copilot-agents/overview","title":"开始"}],"documentType":"article"},"body":"# 开始使用 Copilot 上的 GitHub 智能体\n\n试试 Copilot cloud agent 的端到端过程，大约用时十分钟。\n\n## 先决条件\n\n需要一个已启用的 Copilot cloud agent 存储库。 对于 Copilot Business 和 Copilot Enterprise 订阅者，管理员必须先启用代理，然后才能使用它。 请参阅“[管理对 GitHub Copilot 云代理的访问权限](/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/access-management)”。\n\n## 步骤 1：将问题分配给 Copilot\n\n选择启用了 Copilot cloud agent 的存储库，找到一个开放问题，或者创建一个小问题，例如“添加 CONTRIBUTING.md 文件”。\n\n1. 在右侧栏中，单击**Assignees**，然后选择**Copilot**。\n2. （可选）在 **“可选提示** ”字段中添加说明。\n\n   例如：`Keep the file short and include a code of conduct section.`\n3. 单击**分配**。\n\nCopilot 启动会话并开始处理拉取请求。\n\n## 步骤 2：同时启动研究任务\n\n在 Copilot 处理该问题的同时，请启动第二个非编程任务，观察两个会话并行运行的情况。\n\n1. 在同一存储库中，单击“ **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-agent\" aria-label=\"agent\" role=\"img\"><path d=\"M14.5 8.9v-.052A2.956 2.956 0 0 0 11.542 5.9a.815.815 0 0 1-.751-.501l-.145-.348A3.496 3.496 0 0 0 7.421 2.9h-.206a3.754 3.754 0 0 0-3.736 4.118l.011.121a.822.822 0 0 1-.619.879A1.81 1.81 0 0 0 1.5 9.773v.14c0 1.097.89 1.987 1.987 1.987H4.5a.75.75 0 0 1 0 1.5H3.487A3.487 3.487 0 0 1 0 9.913v-.14C0 8.449.785 7.274 1.963 6.75A5.253 5.253 0 0 1 7.215 1.4h.206a4.992 4.992 0 0 1 4.586 3.024A4.455 4.455 0 0 1 16 8.848V8.9a.75.75 0 0 1-1.5 0Z\"></path><path d=\"m8.38 7.67 2.25 2.25a.749.749 0 0 1 0 1.061L8.38 13.23a.749.749 0 1 1-1.06-1.06l1.719-1.72L7.32 8.731A.75.75 0 0 1 8.38 7.67ZM15 13.45h-3a.75.75 0 0 1 0-1.5h3a.75.75 0 0 1 0 1.5Z\"></path></svg> 代理** ”选项卡。\n2. 键入研究主题。\n\n   例如：`Investigate which dependencies in this repo are outdated and summarize what upgrading would involve.`\n3. 单击 **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-paper-airplane\" aria-label=\"Start task\" role=\"img\"><path d=\"M.989 8 .064 2.68a1.342 1.342 0 0 1 1.85-1.462l13.402 5.744a1.13 1.13 0 0 1 0 2.076L1.913 14.782a1.343 1.343 0 0 1-1.85-1.463L.99 8Zm.603-5.288L2.38 7.25h4.87a.75.75 0 0 1 0 1.5H2.38l-.788 4.538L13.929 8Z\"></path></svg>** 或按 <kbd>Enter</kbd>。\n\n第二个会话与第一个会话一起显示在面板中。\n\n## 步骤 3：监视这两个会话\n\n这两个会话都实时更新。 单击任一会话以查看代理的推理、读取的文件及其所做的更改。\n\n会话进行时，请在日志下方的提示框中键入以控制代理。\n\n例如：`Focus on security-related dependencies first.`\n\n有关监视、引导和停止会话的更多详细信息，请参阅 [管理智能体会话](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/use-copilot-agents/manage-and-track-agents)。\n\n## 步骤 4：在拉取请求上请求 Copilot code review\n\n编码任务完成后， Copilot 打开拉取请求并将你添加为审阅者。\n\n1. 从通知或会话日志中打开拉取请求。\n2. 在右侧栏中的“审阅者”下 **Copilot**，单击“ **请求**”。\n3. 等待 Copilot code review 留下批注 ，通常不到 30 秒。\n\n阅读审阅批注。\nCopilot 可能会建议通过单击直接应用更改。\n\n有关完整的代码评审选项集，请参阅 [使用 GitHub Copilot code review 于 GitHub](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/use-copilot-agents/copilot-code-review)。\n\n## 步骤 5：查看输出并迭代\n\n现在，请自己评审代码更改，就像对待任何参与者的拉取请求一样。\n\n* **从 Copilot** 请求更改 — 在评论中描述要修复的内容并提及 `@copilot`。\n  Copilot 将新提交推送到同一分支。\n* **自行进行更改** — 查看分支并推送自己的提交。\n* **批准和合并** - 当您满意时，请合并拉取请求。\n\n有关审核 Copilot 工作的更多信息，请参阅 [查看来自 Copilot 的输出](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/use-copilot-agents/review-copilot-output)。\n\n## 后续步骤\n\n* [使用GitHub Copilot处理任务的最佳做法](/zh/enterprise-cloud@latest/copilot/tutorials/cloud-agent/get-the-best-results) — 编写有效的提示并充分利用代理。"}