Skip to content

feat(cli): emit anonymous usage events - #599

Merged
jdchawla29 merged 5 commits into
hud-evals:mainfrom
shfunc:sdk-cli-usage-telemetry
Aug 19, 2026
Merged

feat(cli): emit anonymous usage events#599
jdchawla29 merged 5 commits into
hud-evals:mainfrom
shfunc:sdk-cli-usage-telemetry

Conversation

@shfunc

@shfunc shfunc commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Introduces outbound network calls on every CLI invocation with privacy-sensitive design constraints; failures are isolated but the feature touches all CLI entry paths.

Overview
Adds anonymous CLI usage analytics separate from eval trace telemetry, controlled by HUD_CLI_ANALYTICS_ENABLED (opt out via hud set HUD_CLI_ANALYTICS_ENABLED=0).

Each CLI run records one background event to {HUD_TELEMETRY_URL}/sdk-events/cli with an allowlisted payload: registered command/subcommand names (argv is introspected so task files, trace IDs, and other positionals are never sent), exit code, error class, duration, SDK/Python/OS, CI flag, and a persisted anonymous install id in ~/.hud/.env. A one-time stderr notice appears when the install id is first created. Sends are daemon-threaded with a ~1.5s join cap and failures are suppressed so analytics cannot break commands.

The CLI entrypoint wraps execution in recorded_invocation. Unit tests disable CLI analytics in conftest. New Telemetry and analytics reference doc explains both telemetry and CLI analytics.

Reviewed by Cursor Bugbot for commit c6b252f. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread hud/cli/utils/usage.py Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 09c4b35. Configure here.

Comment thread hud/cli/utils/usage.py
@jdchawla29
jdchawla29 merged commit 09ce499 into hud-evals:main Aug 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants