介绍
GitHub Copilot 是人工智能编程助手,它可以帮助你编写程序。在你用visual studio或visual studio code等软件设计工具进行编程时,它可以直接给你整行或整个方法的代码提示,并且提供多种提示方案供你选择。
他是由openai公司(马斯克)和GitHub联合推出的,基于codex提供的服务。
GitHub Copilot通过几十亿行的代码训练,可以把人类自然语言提示转化成十几种编程语言代码方案,以供程序员选择。支持JavaScript、typescript、python、java、go、ruby等语言。

如何使用
通过visual studio code安装
GitHub Copilot插件来使用,安装完插件需要到官网申请使用权限,该插件目前仅对学生、老师级非商业化的运维团队提供免费使用权限,而对这些人群之外的人则是有条件的使用,可以先申请到6个月的免费试用期,过后继续使用就要按月付费了,大概是10$每月。

代码示例
安装注册完成后,就可以使用了,如下是一个用JavaScript编程的提示使用示例:
function calculateDaysBetweenDates(begin, end) {
GitHub Copilot将会自动以灰色字体提示,整个方法的完整程序代码,按Tab键选中,如下所示

以上就是
GitHub Copilot的入门使用方法。想进一步了解它的更多功能,可以点击以下链接进行学习:
GitHub Copilot
https://copilot.github.com/

Configuring GitHub Copilot
https://docs.github.com/en/copilot/configuring-github-copilot
