gk insights setup
Set up Insights telemetry for the AI tools installed on this machine
Synopsis
Store your Insights token and configure every supported AI coding tool found on this machine to report telemetry, then send one test log record to the collector.
Unlike “gk setup”, which installs the GitKraken integrations, this only wires up Insights telemetry. The token is stored in plaintext in the machine settings file and survives logout. Running the command again changes nothing unless the token, email or endpoint changed.
For OpenCode (1.18 up to, not including, 2.0) it installs a bundled telemetry plugin and adds it to the OpenCode config. Use “gk insights uninstall” to remove it. Other OpenCode versions are skipped.
For Claude Code it also removes the legacy branch-capture.sh hook and its ~/.claude/branch-capture.env file, once the GitKraken Claude Code hook (gk ai hook install claude-code) is installed to send the same git context.
The test log is sent first. If the collector rejects the token (HTTP 401 or 403) nothing is saved and no tool is configured, so a working setup is never replaced by a bad token. If the collector cannot be reached or fails (network error or HTTP 5xx), the settings are still saved and the tools configured, and the command exits with a failure so you can re-run it later.
The email comes from –email, then the previously stored value, then your GitKraken account, then “git config –global user.email”, and is prompted for as a last resort. The token comes from –token, then the previously stored token, and is prompted for otherwise, except under –json.
gk insights setup [flags]
Examples
gk insights setup --token <token>
gk insights setup --token <token> --email me@example.com
gk insights setup --token <token> --dry-run
gk insights setup --token <token> --json
Options
--dry-run Show what would be configured without changing anything
--email string Email to report telemetry under (default: your account or git email)
--endpoint string Insights collector base URL (default: https://otel-devex.gitkraken.com)
-h, --help help for setup
--token string Insights token (default: the stored token, else prompted for)
Options inherited from parent commands
--json Emit machine-readable JSON on stdout (GK_OUTPUT=json sets it session-wide)
--no-telemetry Disable telemetry (OTel spans, Sentry) for this invocation
--session string (Optional) Isolate auth and cache under a named session
SEE ALSO
- gk insights - Send AI coding tool telemetry to GitKraken Insights