Skip to main content

在 CLI 中配置 GitHub Copilot

你可以为执行命令选项配置使用情况分析和默认行为。

关于 GitHub Copilot in the CLI

的配置

通过运行 gh copilot config,你可以配置多个设置:

  • 可选使用情况分析
  • 执行命令确认的默认行为

关于可选使用情况分析

你可以选择允许 GitHub 收集使用情况数据。 这有助于改进产品并提供更好的支持。 你可以随时启用或禁用使用情况分析。

GitHub 使用指标来确定工作优先级,并评估 Copilot in the CLI 是否成功解决实际用户问题。 例如,当新版本发布且异常和响应评级激增时,使用情况分析可用于了解是否存在导致问题的回归或平台问题。

除非你已选择退出,否则 Copilot in the CLI 会将以下格式的有效负载发送到分析系统。 GitHub 对用户的隐私非常敏感,永远不会查看特定个人的数据,而是只检查聚合数据和趋势,为产品决策提供信息。

{
    "platform": "darwin",
    "architecture": "arm64",
    "version": "0.3.0-beta",
    "custom_event": "true",
    "event_parent_command": "explain",
    "event_name": "Explain",
    "sha": "089a53215fc4383179869f7f6132ce9d6e58754a",
    "thread_id": "e61d0d08-f6ba-465b-81cf-c30fd9127d70"
}

关于执行命令确认

当你使用 ghcs 别名并选择执行建议的命令时,Copilot in the CLI 将提示你确认要执行代码。 有关详细信息,请参阅“使用 GitHub Copilot(CLI 版)”。

为防止意外执行命令,确认提示默认为 No。 为了加快执行速度,你可以将默认回答更改为 Yes