Skip to content

Commit aa4d996

Browse files
committed
add print mode analytics event
1 parent 7ba82a6 commit aa4d996

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

common/src/constants/analytics-events.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export enum AnalyticsEvent {
1515
KNOWLEDGE_FILE_UPDATED = 'cli.knowledge_file_updated',
1616
LOGIN = 'cli.login',
1717
MALFORMED_PROMPT_RESPONSE = 'cli.malformed_prompt_response',
18+
PRINT_MODE = 'cli.print_mode',
1819
RAGE = 'cli.rage',
1920
SHELL_RECREATED = 'cli.shell_recreated',
2021
SLASH_MENU_ACTIVATED = 'cli.slash_menu_activated',

npm-app/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { type CostMode } from '@codebuff/common/constants'
66
import { Command, Option } from 'commander'
77
import { red } from 'picocolors'
88

9+
import { AnalyticsEvent } from '@codebuff/common/constants/analytics-events'
910
import { displayLoadedAgents, loadLocalAgents } from './agents/load-agents'
1011
import { CLI } from './cli'
1112
import { cliArguments, cliOptions } from './cli-definitions'
@@ -22,7 +23,7 @@ import { rageDetectors } from './rage-detectors'
2223
import { logAndHandleStartup } from './startup-process-handler'
2324
import { recreateShell } from './terminal/run-command'
2425
import { CliOptions } from './types'
25-
import { initAnalytics } from './utils/analytics'
26+
import { initAnalytics, trackEvent } from './utils/analytics'
2627
import { findGitRoot } from './utils/git'
2728
import { logger } from './utils/logger'
2829

@@ -172,6 +173,10 @@ For all commands and options, run 'codebuff' and then type 'help'.
172173
const hasParams = options.params
173174

174175
setPrintMode(true)
176+
trackEvent(AnalyticsEvent.PRINT_MODE, {
177+
args,
178+
options,
179+
})
175180

176181
if (!hasPrompt && !hasParams) {
177182
printModeLog({

0 commit comments

Comments
 (0)