在命令行下使用 GitHub Copilot CLI

4 min read

GitHub Copilot CLI 可以帮助您通过命令行使用 Copilot,以下是如何在命令行下使用 GitHub Copilot CLI 的步骤:

  1. 安装 GitHub CLI:在终端中输入以下命令:
brew install gh
  1. 登录到 GitHub:在终端中输入以下命令:
gh auth login
  1. 安装 GitHub Copilot CLI:在终端中输入以下命令:
gh copilot install
  1. 使用 GitHub Copilot CLI:在终端中输入以下命令:
gh copilot [command] [flags]

例如,要生成一个 Python 函数,您可以使用以下命令:

gh copilot generate function --language python

这些命令可以帮助您在命令行下快速使用 GitHub Copilot。