Repository navigation
feat(cli): support JSON telemetry status - #7289
Conversation
7cfa296 to
14506ad
Compare
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
…w to PR heygen-com#7303, issue heygen-com#7313 Adopt heygen-com#7329 for the segmented and sequential-disk capture paths via a shared createSessionInitBudget; review PR heygen-com#7289-heygen-com#7303 (5 open pinned, heygen-com#7303 superseded codegen not pinned) and issues heygen-com#7259-heygen-com#7313. monitored 105 -> 110. Also drop two upstream author emails from older ledger lines; emails belong only in commit trailers. Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 14506ad8848b36aec3a1b2062b7af2cb865152fe.
The JSON status reuses the same effective telemetry policy and fresh configuration as human output (packages/cli/src/commands/telemetry.ts:56). It returns exactly the five requested fields and rejects JSON for mutating operations before writing preferences. The CLI docs describe the supported form.
Validation at this head: bun run --cwd packages/cli test src/commands/telemetry.test.ts src/telemetry/policy.test.ts src/cli.agentMode.test.ts → 554 passed. Full build at this head passed. Fresh independent source review found no Important defect; no live browser or native Windows run. No prior substantive reviews or inline comments were present.
Need: yes, requested starter issue · Size: ok · Reuse: existing CLI policy, color and checker helpers · Simpler: already minimal · Structure: fine
Risk: low — bounded CLI output/checker change
— hf-review
Verdict: APPROVE
Reasoning: The requested behavior is covered by focused tests and reuses the existing contract. No Important blocker found.
…-com#7336-heygen-com#7358 Adopt heygen-com#7304 (without CLI renderDiagnostic, needs heygen-com#6725), heygen-com#7331, heygen-com#7332, heygen-com#7334, heygen-com#7337, heygen-com#7336, heygen-com#7339, heygen-com#7289, heygen-com#5594, heygen-com#6900, heygen-com#7322, heygen-com#7342, heygen-com#7343, heygen-com#7350 (onProgress only), heygen-com#7352, heygen-com#7348, heygen-com#7344, heygen-com#7353, heygen-com#7356 and heygen-com#7355. Defer heygen-com#5708 (needs heygen-com#6911) and heygen-com#7345 (READ_VERSION 4 vs 7); heygen-com#7307 not applicable. Re-read 14 moved pins, pin 6 new PRs (monitored 126). Make checkReportFile module-private and suppress the cross-package closeTestChrome duplicate for fallow. Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-authored-by: SophiaHuangCc <129631224+SophiaHuangCc@users.noreply.github.com> Co-authored-by: Dante <duanjl.china@gmail.com> Co-authored-by: Muzzy5150 <muzzy5150yt@gmail.com> Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Support
hyperframes telemetry status --json, returningenabled,source,configPath,statePath, andcommandCount.Why
Agents and scripts currently receive exit code 2 and
json_unsupportedwhen requesting telemetry status as JSON. They must parse the human-readable output to determine whether telemetry is enabled.With this change, the command exits 0 and prints one JSON object. For example, an isolated test configuration with seven tracked commands and
DO_NOT_TRACK=1returns the following fields (paths vary by configuration directory).{ "enabled": false, "source": "DO_NOT_TRACK", "configPath": "/tmp/hf-telemetry-example/config.json", "statePath": "/tmp/hf-telemetry-example/install-state.json", "commandCount": 7 }Related work
Fixes #7275.
No competing implementation was found when checking the issue discussion and related PRs. The branch is rebased onto upstream main
6abc62a17.How
--jsonthrough the existing shared command factory so the CLI guards and agent-mode contract discover it automatically.enabledandsourceconsistently with human output.--jsontostatus. Other telemetry operations return a usage error before changing preferences.Test plan
Using Bun 1.4.4 and Node.js 22.23.3, run from the repository root.
bun run build bun run --cwd packages/cli test src/commands/telemetry.test.ts src/telemetry/policy.test.ts src/cli.agentMode.test.ts bun run --cwd packages/cli typecheckAll 554 tests pass, including the unchanged agent-mode contract suite.
Six new JSON cases check all five fields for saved enabled/disabled preferences, both environment opt-outs, development mode, and a telemetry-disabled build. Three additional cases reject JSON for other operations. All nine fail against the original implementation and pass with the fix.
The built CLI was exercised with isolated temporary settings for JSON output,
DO_NOT_TRACK, human output, and rejection ofenable --jsonwithout changing preferences.Repository lint, formatting, Fallow audit against upstream main, comment checks, and test reachability pass. Mintlify validation and broken-link checks pass.
Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug