Elffuss BraidHub

kikocis/continue public

note whether headless mode / github actions in telemetry
Changesete9632de7ae332cdfd9b5c2b8ca4adb58ed0a55fcdaab75ce63ce15a8e6434b5a
AuthorNate <sestinj@gmail.com> · 2025-09-04 19:37 -07:00
CommitterNate <sestinj@gmail.com> · 2025-09-04 19:37 -07:00
Parentse42bdc2c5fca

Browse the files at this changeset

1 file changed

modified extensions/cli/src/telemetry/posthogService.ts +13 −1
@@ -4,7 +4,9 @@
44 import type { PostHog as PostHogType } from "posthog-node";
55
66 import { isAuthenticatedConfig, loadAuthConfig } from "../auth/workos.js";
7+import { isGitHubActions } from "../util/git.js";
78 import { logger } from "../util/logger.js";
9+import { getVersion } from "../version.js";
810
911 export class PosthogService {
1012 private os: string | undefined;
@@ -15,6 +17,14 @@
1517 this.uniqueId = this.getEventUserId();
1618 }
1719
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+
1828 get isEnabled() {
1929 return process.env.CONTINUE_CLI_ENABLE_TELEMETRY !== "0";
2030 }
@@ -62,9 +72,11 @@
6272 const augmentedProperties = {
6373 ...properties,
6474 os: this.os,
65- extensionVersion: "", // TODO cn version
75+ extensionVersion: getVersion(),
6676 ideName: "cn",
6777 ideType: "cli",
78+ isHeadless: this.isHeadlessMode(),
79+ isGitHubCI: isGitHubActions(),
6880 };
6981 const payload = {
7082 distinctId: this.uniqueId,