@@ -9,7 +9,6 @@ import (
99 "runtime"
1010
1111 "github.com/charmbracelet/crush/internal/version"
12− "github.com/denisbrodbeck/machineid"
1312 "github.com/posthog/posthog-go"
1413)
1514
@@ -39,6 +38,7 @@ func Init() {
3938 slog.Error("Failed to initialize PostHog client", "error", err)
4039 }
4140 client = c
41+ distinctId = getDistinctId()
4242}
4343
4444// send logs an event to PostHog with the given event name and properties.
@@ -47,7 +47,7 @@ func send(event string, props ...any) {
4747 return
4848 }
4949 err := client.Enqueue(posthog.Capture{
50− DistinctId: distinctId(),
50+ DistinctId: distinctId,
5151 Event: event,
5252 Properties: pairsToProps(props...).Merge(baseProps),
5353 })
@@ -105,11 +105,3 @@ func pairsToProps(props ...any) posthog.Properties {
105105func isEven(n int) bool {
106106 return n%2 == 0
107107}
108−
109−func distinctId() string {
110− id, err := machineid.ProtectedID("charm")
111− if err != nil {
112− return "crush-cli"
113− }
114− return id
115−}