Skip to content

feat(telemetry): add PostHog telemetry for CLI usage analytics#41

Merged
Soph merged 6 commits intomainfrom
gtrrz-victor/add-telemetry
Jan 15, 2026
Merged

feat(telemetry): add PostHog telemetry for CLI usage analytics#41
Soph merged 6 commits intomainfrom
gtrrz-victor/add-telemetry

Conversation

@gtrrz-victor
Copy link
Contributor

@gtrrz-victor gtrrz-victor commented Jan 14, 2026

Summary

Add anonymous usage telemetry using PostHog to understand CLI usage patterns:

  • Track command name and success/failure status per execution
  • Uses hashed machine ID as distinct identifier (via machineid library)
  • Opt-out via ENTIRE_TELEMETRY_OPTOUT=1 environment variable
  • Skips hidden commands, help, and completion from tracking
  • Fails gracefully - telemetry errors never affect CLI functionality

What's Collected

Property Example
command "entire rewind", "entire status"
flags "no-telemetry,strategy,help"
success true/false
cli_version "1.0.0"
os "darwin", "linux"
arch "arm64", "amd64"
in_ci true/false

Consent Flow:

  • Interactive mode: Shows a confirmation prompt ("Help improve Entire CLI?") with "Yes" as default
  • Non-interactive mode: Defaults to enabled, use --no-telemetry flag to disable
  • Respects ENTIRE_TELEMETRY_OPTOUT env var (always takes priority)
  • Prompt only shown once; preference stored in .entire/settings.json

Settings:

  • Added telemetry field to settings (*bool: nil = not asked, true = enabled, false = disabled)
  • --no-telemetry flag always overrides existing setting

@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/add-telemetry branch 3 times, most recently from d933e74 to cc3d9d6 Compare January 14, 2026 01:26
@gtrrz-victor gtrrz-victor requested a review from Soph January 14, 2026 04:07
@Soph
Copy link
Collaborator

Soph commented Jan 14, 2026

I would suggest we add this also to entire enable. We would like to gather some metrics, are you ok with that? something like that. I would be open about it and let people opt out. A bit like the Apple does.

gtrrz-victor and others added 2 commits January 15, 2026 11:42
Add anonymous usage telemetry using PostHog to track command usage patterns.

- Track command name and success/failure status
- Uses hashed machine ID as distinct identifier
- Opt-out via ENTIRE_TELEMETRY_OPTOUT environment variable
- Skips hidden commands, help, and completion
- Fails gracefully - telemetry errors never affect CLI

Co-Authored-By: Claude <noreply@anthropic.com>
Entire-Checkpoint: 30e81e82f6ba
  Pass POSTHOG_API_KEY from GitHub secrets to goreleaser, which sets
  it via ldflags in the telemetry package during release builds.

Entire-Checkpoint: 4c02af2759b6
@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/add-telemetry branch from 0f6e2ac to a372b04 Compare January 15, 2026 00:42
Entire-Checkpoint: 4c02af2759b6
@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/add-telemetry branch from a372b04 to d433741 Compare January 15, 2026 01:00
@gtrrz-victor
Copy link
Contributor Author

I would suggest we add this also to entire enable. We would like to gather some metrics, are you ok with that? something like that. I would be open about it and let people opt out. A bit like the Apple does.

image

What about this?

@Soph Soph merged commit 9450c8a into main Jan 15, 2026
3 checks passed
@Soph Soph deleted the gtrrz-victor/add-telemetry branch January 15, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants