Documentation
¶
Overview ¶
Package telemetry provides privacy-respecting analytics for gsh. It follows the Homebrew analytics model - opt-out with notification, strictly anonymous, and silent failures.
Index ¶
Constants ¶
const ( EventSessionStart = "session_start" EventSessionEnd = "session_end" // Feature adoption events (counts only) EventScriptExecution = "script_execution" // Error categories (no content) EventError = "error" )
Event names - what we track
const ( ErrorCategoryParse = "parse_error" ErrorCategoryRuntime = "runtime_error" ErrorCategoryMCPConnection = "mcp_connection_failed" ErrorCategoryAgent = "agent_error" ErrorCategoryScript = "script_error" )
Error categories for tracking
Variables ¶
This section is empty.
Functions ¶
func GetFirstRunNotification ¶
func GetFirstRunNotification() string
GetFirstRunNotification returns the notification message to show on first run
func GetTelemetryStatus ¶
func GetTelemetryStatus() string
GetTelemetryStatus returns the current telemetry status as a string
func HandleTelemetryCommand ¶
HandleTelemetryCommand processes the "gsh telemetry" CLI command Returns true if the command was handled, false if it should be passed through
func IsFirstRun ¶
func IsFirstRun() bool
IsFirstRun checks if this is the first time gsh is being run
func MarkFirstRunComplete ¶
func MarkFirstRunComplete() error
MarkFirstRunComplete marks that the first run notification has been shown
func SetTelemetryEnabled ¶
SetTelemetryEnabled enables or disables telemetry
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages telemetry for gsh
func (*Client) TrackError ¶
TrackError records an error by category (no error content)
func (*Client) TrackScriptExecution ¶
func (c *Client) TrackScriptExecution()
TrackScriptExecution records a .gsh script execution (count only)
func (*Client) TrackSessionEnd ¶
func (c *Client) TrackSessionEnd()
TrackSessionEnd records the end of a gsh session with duration
func (*Client) TrackSessionStart ¶
TrackSessionStart records the start of a gsh session
func (*Client) TrackStartupTime ¶
TrackStartupTime records the startup time in milliseconds