Changesets · Branches · Tags · Compare
| Changeset | e9632de7ae332cdfd9b5c2b8ca4adb58ed0a55fcdaab75ce63ce15a8e6434b5a |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-09-04 19:37 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-09-04 19:37 -07:00 |
| Parents | e42bdc2c5fca |
1 file changed
modified extensions/cli/src/telemetry/posthogService.ts +13 −1
| @@ -4,7 +4,9 @@ | ||
| 4 | 4 | import type { PostHog as PostHogType } from "posthog-node"; |
| 5 | 5 | |
| 6 | 6 | import { isAuthenticatedConfig, loadAuthConfig } from "../auth/workos.js"; |
| 7 | +import { isGitHubActions } from "../util/git.js"; | |
| 7 | 8 | import { logger } from "../util/logger.js"; |
| 9 | +import { getVersion } from "../version.js"; | |
| 8 | 10 | |
| 9 | 11 | export class PosthogService { |
| 10 | 12 | private os: string | undefined; |
| @@ -15,6 +17,14 @@ | ||
| 15 | 17 | this.uniqueId = this.getEventUserId(); |
| 16 | 18 | } |
| 17 | 19 | |
| 20 | + /** | |
| 21 | + * Check if running in headless mode (-p flag) | |
| 22 | + */ | |
| 23 | + private isHeadlessMode(): boolean { | |
| 24 | + const args = process.argv.slice(2); | |
| 25 | + return args.includes("-p") || args.includes("--print"); | |
| 26 | + } | |
| 27 | + | |
| 18 | 28 | get isEnabled() { |
| 19 | 29 | return process.env.CONTINUE_CLI_ENABLE_TELEMETRY !== "0"; |
| 20 | 30 | } |
| @@ -62,9 +72,11 @@ | ||
| 62 | 72 | const augmentedProperties = { |
| 63 | 73 | ...properties, |
| 64 | 74 | os: this.os, |
| 65 | - extensionVersion: "", // TODO cn version | |
| 75 | + extensionVersion: getVersion(), | |
| 66 | 76 | ideName: "cn", |
| 67 | 77 | ideType: "cli", |
| 78 | + isHeadless: this.isHeadlessMode(), | |
| 79 | + isGitHubCI: isGitHubActions(), | |
| 68 | 80 | }; |
| 69 | 81 | const payload = { |
| 70 | 82 | distinctId: this.uniqueId, |