From 365900b17f6202440b7d896b71b6f34bb11a5ae7 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 11 Apr 2026 14:14:36 +0900 Subject: [PATCH] feat(telemetry): add install command events and user-facing telemetry notice --- src/cli/cli-installer.ts | 13 ++++++++++--- src/cli/tui-installer.ts | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/cli/cli-installer.ts b/src/cli/cli-installer.ts index 4d7afdd85..865ad649b 100644 --- a/src/cli/cli-installer.ts +++ b/src/cli/cli-installer.ts @@ -65,7 +65,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi const unsupportedVersionMessage = getUnsupportedOpenCodeVersionMessage(openCodeVersion) if (unsupportedVersionMessage) { printWarning(unsupportedVersionMessage) - posthog.capture({ distinctId, event: "install_failed", properties: { reason: "unsupported_opencode_version", is_update: isUpdate } }) + posthog.capture({ distinctId, event: "install_failed", properties: { command: "install", reason: "unsupported_opencode_version", is_update: isUpdate } }) await posthog.shutdown() return 1 } @@ -82,7 +82,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi const pluginResult = await addPluginToOpenCodeConfig(version) if (!pluginResult.success) { printError(`Failed: ${pluginResult.error}`) - posthog.capture({ distinctId, event: "install_failed", properties: { reason: "plugin_config_write_failed", is_update: isUpdate } }) + posthog.capture({ distinctId, event: "install_failed", properties: { command: "install", reason: "plugin_config_write_failed", is_update: isUpdate } }) await posthog.shutdown() return 1 } @@ -94,7 +94,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi const omoResult = writeOmoConfig(config) if (!omoResult.success) { printError(`Failed: ${omoResult.error}`) - posthog.capture({ distinctId, event: "install_failed", properties: { reason: "omo_config_write_failed", is_update: isUpdate } }) + posthog.capture({ distinctId, event: "install_failed", properties: { command: "install", reason: "omo_config_write_failed", is_update: isUpdate } }) await posthog.shutdown() return 1 } @@ -123,6 +123,12 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi console.log(` Run ${color.cyan("opencode")} to start!`) console.log() + printInfo( + "Anonymous telemetry is enabled by default. Disable it with OMO_SEND_ANONYMOUS_TELEMETRY=0 or OMO_DISABLE_POSTHOG=1.", + ) + printInfo("Docs: docs/legal/privacy-policy.md and docs/legal/terms-of-service.md") + console.log() + printBox( `${color.bold("Pro Tip:")} Include ${color.cyan("ultrawork")} (or ${color.cyan("ulw")}) in your prompt.\n` + `All features work like magic-parallel agents, background tasks,\n` + @@ -142,6 +148,7 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi distinctId, event: "install_completed", properties: { + command: "install", is_update: isUpdate, has_claude: config.hasClaude, has_openai: config.hasOpenAI, diff --git a/src/cli/tui-installer.ts b/src/cli/tui-installer.ts index 973e387f4..4272557c0 100644 --- a/src/cli/tui-installer.ts +++ b/src/cli/tui-installer.ts @@ -85,6 +85,8 @@ export async function runTuiInstaller(args: InstallArgs, version: string): Promi p.log.success(color.bold(isUpdate ? "Configuration updated!" : "Installation complete!")) p.log.message(`Run ${color.cyan("opencode")} to start!`) + p.log.info("Anonymous telemetry is enabled by default. Disable it with OMO_SEND_ANONYMOUS_TELEMETRY=0 or OMO_DISABLE_POSTHOG=1.") + p.log.info("Docs: docs/legal/privacy-policy.md and docs/legal/terms-of-service.md") p.note( `Include ${color.cyan("ultrawork")} (or ${color.cyan("ulw")}) in your prompt.\n` +