GitHub CLI 现在收集伪匿名遥测数据
GitHub CLI now collects pseudoanonymous telemetry

原始链接: https://cli.github.com/telemetry

GitHub CLI 会收集匿名遥测数据,以了解用户如何与该工具交互并确定未来开发的优先级。这些数据有助于团队评估功能的使用情况并确定需要改进的领域——例如,确定新命令是否被使用以及哪些标志受欢迎。 您可以查看遥测实现(因为它是开源的),甚至可以通过环境变量 (`GH_TELEMETRY=log`) 或配置 (`gh config set telemetry log`) 启用“日志模式”来预览将被发送的数据。 遥测是选择加入的;您可以使用环境变量 (`GH_TELEMETRY=false`) 或配置 (`gh config set telemetry disabled`) 来禁用它。数据会发送到 GitHub 的内部分析系统,并受其通用隐私声明管辖。 重要的是,使用 GitHub CLI 安装的扩展程序可能会独立收集他们自己的数据——请查看他们的文档以获取详细信息。 此信息专门与 GitHub CLI ("gh") 相关,*不*包括 GitHub Copilot 及其 CLI。

GitHub CLI 现在收集伪匿名遥测数据 (cli.github.com) 18 分 由 ingve 发表于 31 分钟前 | 隐藏 | 过去 | 收藏 | 3 条评论 帮助 embedding-shape 发表于 10 分钟前 | 下一个 [–] 喜欢简短的 PR:https://github.com/cli/cli/pull/13254 > 移除用于控制遥测数据的环境变量,使其默认开启。回复 neobrain 发表于 7 分钟前 | 上一个 [–] 退出遥测的简短说明,参考 https://cli.github.com/telemetry#how-to-opt-out (以下任何一个方法均可): export GH_TELEMETRY=false export DO_NOT_TRACK=true gh config set telemetry disabled 回复 fenaer 发表于 0 分钟前 | 父级 [–] $ gh --version gh version 2.90.0 (2026-04-16) https://github.com/cli/cli/releases/tag/v2.90.0 $ gh config set telemetry disabled ! 警告:'telemetry' 不是已知的配置键 考虑申请 YC 的 2026 年夏季批次!申请截止日期为 5 月 4 日 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

GitHub CLI sends pseudoanonymous telemetry to help us improve the product. We want you to understand what is being sent and why.

Why we collect telemetry

As agentic adoption of GitHub CLI grows, our team needs visibility into how features are being used in practice. We use this data to prioritize our work and evaluate whether features are meeting real user needs.

For example, when we ship a new subcommand, we want to understand whether anyone is using it and how. If adoption is low, we know we need to revisit the feature's discoverability or design. If a subcommand sees high usage with certain flags, that tells us where to invest in a better experience.

Reviewing telemetry

GitHub CLI is open source, you can review the telemetry implementation in the cli/cli repository. However, if you want to see exactly what would be sent without actually sending it, you can enable logging mode using either an environment variable, or configuration option.

Environment variable:

CLI config:

gh config set telemetry log

In logging mode, the JSON payload that would normally be sent is printed to stderr instead. This lets you inspect every field before deciding whether to keep telemetry enabled, for example:

GH_TELEMETRY=log gh repo list --archived

prints something like:

Telemetry payload:
{
  "events": [
    {
      "type": "command_invocation",
      "dimensions": {
        "agent": "",
        "architecture": "arm64",
        "command": "gh repo list",
        "device_id": "1e9a73a6-c8bd-4e1e-be02-78f4b11de4e1",
        "flags": "archived",
        "invocation_id": "eda780f5-27f9-433c-a7ae-7a033361e572",
        "is_tty": "true",
        "os": "darwin",
        "timestamp": "2026-04-16T14:55:13.418Z",
        "version": "2.91.0"
      }
    }
  ]
}

Note that this command can only log telemetry for the exact command and context in which it ran. For example, changing environment variables, or authenticated accounts may change the events, and event dimensions that are included in the payload.

How to opt out

You can opt-out of the telemetry you see in the aforementioned log mode using either an environment variable, or configuration option.

Environment variables:

export GH_TELEMETRY=false

Any falsy value works: 0, false, disabled, or an empty string. You can also use the DO_NOT_TRACK convention:

CLI config:

gh config set telemetry disabled

Note: The environment variables take precedence over the config value.

Where data is sent

Telemetry events are sent to GitHub's internal analytics infrastructure. For more information about how GitHub handles your data, see the GitHub General Privacy Statement.

Additional information

GitHub CLI allows you to add features to the product by installing GitHub and third-party extensions, including agents. These extensions may be collecting their own usage data and are not controlled by opting out. Consult the specific extension's documentation to learn about its telemetry reporting and whether it can be disabled.

This page describes client-side data collection for the GitHub CLI (gh). It does not apply to GitHub Copilot or the Copilot CLI, which handle data collection separately. For information on the Copilot CLI, see Using GitHub Copilot CLI and Responsible Use of the GitHub Copilot CLI.

联系我们 contact @ memedata.com