Add anonymous usage telemetry via TelemetryDeck#314
Merged
Conversation
- Add TelemetryDeck SDK dependency and MCSAnalytics wrapper using hardware UUID (IOPlatformUUID) for tamper-proof anonymous identity - Track command execution across all 13 commands with type-safe Command enum, opt-in by default (disable via `mcs config set telemetry false`), first-run notice with marker file - Integrate into all commands with centralized init in PackCommandContext; skip telemetry in hook mode for check-updates
- Fix try?/unchecked createFile violation in first-run notice with do/catch and output.warn(), add double-init guard, pass output to MCSConfig.load, fix opt-in→opt-out terminology - Use defer for trackCommand in all commands to track both success and failure invocations consistently - Add isTelemetryEnabled computed property on MCSConfig and tests for telemetry key roundtrip, value/setValue, and opt-out semantics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcs config set telemetry false~/.mcs/)MCSAnalytics.CommandenumsendNewSessionBeganSignal = false) — unnecessary overhead for short-lived CLIFiles changed
Package.swiftSources/mcs/Core/Telemetry.swiftMCSAnalyticswrapper (init, track+flush, anonymous ID, first-run notice)Sources/mcs/Core/MCSConfig.swifttelemetryconfig key (default: true)Sources/mcs/Core/Constants.swiftConstants.Telemetryenum (app ID, marker filename)Sources/mcs/Commands/*.swift.swiftlint.ymlfunction_body_lengthwarning 150→160Design decisions
flush()method: Track and flush are always paired in CLI lifecycle, sotrackCommand()handles both to prevent temporal couplingcheck-updates --hookruns on every Claude Code session start — tracking it would generate excessive noiseTest plan
swift build— compiles without warningsswiftlint— 0 violationsswift test— all 953 tests passmcs config list— verifytelemetrykey appears with defaulttruemcs config set telemetry false→ run any command → verify no network callsmcs sync --dry-runwith telemetry enabled → verify signal appears in TelemetryDeck dashboard~/.mcs/.telemetry-noticedmarker file created after first run