Skip to content

feat(telemetry): CLI usage telemetry - #410

Draft
djgould wants to merge 17 commits into
mainfrom
devin/cli-anonymous-telemetry-c70776
Draft

feat(telemetry): CLI usage telemetry#410
djgould wants to merge 17 commits into
mainfrom
devin/cli-anonymous-telemetry-c70776

Conversation

@djgould

@djgould djgould commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Adds usage telemetry to the CLI (GROW-1200): one CLI_COMMAND_EXECUTED event per command run, sent to clerk-telemetry.com (BigQuery, sdk = 'clerk-cli').

What an event contains

Field Example
command users list — subcommand names only, never arguments
flags json,limit — flag names only, never values
outcome / exit_code / error_code error / 1 / not_linked
duration_ms 412
machine_uuid random per-machine UUID
install_method npm_global, homebrew, npx, …
ai_agent claude_code, cursor, gemini_cli, … — empty for humans
terminal_program ghostty, warp, …
mode human / agent (TTY detection)
os / arch / ci / in_tmux / in_screen darwin / arm64 / false / …
env active environment profile
workspace_id / app_id linked project ids; null when unlinked

Never collected: command arguments, option values, file paths, error messages, or personal data.

Controls

  • clerk telemetry status|disable|enable — persisted opt-out; a disable run sends nothing itself
  • CLERK_TELEMETRY_DISABLED / DO_NOT_TRACK env vars (any non-false value)
  • The first run only shows a disclosure notice and sends nothing
  • --verbose prints each event before the POST; failures never affect the command (1s cap)
  • The User-Agent also gains AIAgent/<agent> so API logs can classify agent traffic

Release gate: telemetry-service drops iid-less events (workers/telemetry-service/src/index.ts:91) — needs the one-line sdk === "clerk-cli" exemption in cloudflare-workers before this ships, then an end-to-end BigQuery check.

🤖 Generated with Claude Code

djgould and others added 9 commits August 5, 2026 13:46
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…omes, disclosure wording

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d07771f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
clerk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

djgould and others added 7 commits August 7, 2026 10:15
CLERK_TELEMETRY_DISABLED=yes silently keeping telemetry on is the worst
failure mode for a privacy control; only "0"/"false" now keep it enabled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…check, --verbose payload dump

The first human run only shows the notice (and says nothing was sent);
finalize re-checks enablement against persisted config so `clerk telemetry
disable` itself never emits an event; the full payload is visible with
--verbose before the POST.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sisted opt-out

status reports the winning reason (env var > clerk telemetry disable >
dev-build guard); a run of `clerk telemetry disable` never sends an event.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…app ids honestly

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@djgould djgould changed the title feat(telemetry): anonymous CLI usage telemetry feat(telemetry): CLI usage telemetry Aug 7, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant