Skip to main content

为自己设置 GitHub Copilot

按照以下步骤开始使用 Copilot。

谁可以使用此功能?

Individuals

1. 获取对 GitHub Copilot

的访问权限

你可以通过多种方式获取对 GitHub Copilot 的访问权限:

  •           **使用 Copilot 免费版**。 获取有限的 Copilot 体验,每月最多可提出 2,000 个内嵌建议请求和 50 个高级请求,无需参加付费计划。 请参阅“[AUTOTITLE](/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/about-github-copilot-free)”。
    
  •           **注册付费计划**。 你可以订阅以下任何一项:
    
    •           **Copilot Pro**,包括<a href="https://github.com/github-copilot/signup?ref_product=copilot&ref_type=trial&ref_style=text" target="_blank"><span>一次性免费试用 30 天</span></a>,以及每月 300 次高级请求。
      
    •           **Copilot Pro+**,包括每月 1,500 次高级请求,以及对所有可用模型的完全访问权限。               [订阅 Copilot Pro+](https://github.com/github-copilot/signup?ref_product=copilot&ref_type=purchase&ref_style=text&ref_plan=pro)。
      
  •           **通过组织或企业使用 Copilot**。 如果你所在的组织或企业已拥有 Copilot 计划,可以在 [https://github.com/settings/copilot](https://github.com/settings/copilot) 的“从组织获取 Copilot”下面请求访问权限。
    
  •           **经过验证的学生、教师或开源维护者**。 你可能有资格免费使用 Copilot。 请参阅“[AUTOTITLE](/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/getting-free-access-to-copilot-as-a-student-teacher-or-maintainer)”。
    

2. 为 IDE 安装 Copilot 扩展

如果你想在 IDE 中使用 Copilot,请为 IDE 安装 Copilot 扩展。 请参阅“在环境中安装 GitHub Copilot 扩展”。

3. 为命令行安装 Copilot 扩展

如果你要在命令行中使用 Copilot,请为 GitHub CLI 安装 Copilot 扩展。 请参阅“安装 GitHub Copilot CLI”。

4. 使用 Windows Terminal 中的 Copilot

如果你想在 Windows Terminal 中与 Copilot 聊天,请在 Windows Terminal Canary 中将 Copilot 与 Terminal Chat 连接。 请参阅“GitHub Copilot 快速入门”。

5. 设置网络(如必要)

如果你通过 HTTP 代理服务器或防火墙进行连接,请确保将关键 URL 添加到代理服务器或防火墙的允许列表中。 请参阅“Copilot 允许列表参考”。

你可能还需要在计算机上安装自定义 SSL 证书。 请参阅“为 GitHub Copilot 配置网络设置”。

6. 配置设置(可选)

所有用户都可在其 IDE 中配置 Copilot 设置。 请参阅“在环境中配置 GitHub Copilot”。

如果你有自己的 Copilot 计划(而不是使用组织或企业的计划),则可以:

  •           **安装模型上下文协议 (MCP) 服务器**以与 Copilot 对话助手 集成。 请参阅“[AUTOTITLE](/copilot/how-tos/context/model-context-protocol/extending-copilot-chat-with-mcp)”。
    
  •           **管理策略**。 请参阅“[AUTOTITLE](/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/managing-copilot-policies-as-an-individual-subscriber)”。
    
  •         **启用 Copilot 内存**,这将允许 Copilot 生成并存储关于代码库的有用信息。 请参阅“[AUTOTITLE](/copilot/concepts/agents/copilot-memory)”。
    

7. 开始使用 Copilot

开始使用 Copilot 以帮助你更快、更高效地编写代码。 有关 Copilot 的所有用法,请参阅 GitHub Copilot 的操作方法。 Copilot 代码建议、GitHub 中的 Copilot Chat 和 IDE 中的 Copilot 对话助手 都是一个很好的开始。

若要了解如何以最佳方式使用 Copilot,请参阅 有关使用 GitHub Copilot 的最佳做法GitHub Copilot 对话助手的提示设计