File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 11- Support auth token JSON in ` dataconnect_execute ` MPC tool. (#9046 )
22- Fixed the bugs when MCP tools cannot connect to emulator due to CLI version mis-matched. (#9068 )
33- Fix bug when ` firebase dataconnect:sdk:generate --watch ` swallow all logs. (#9055 )
4+ - Add GA4 agent user property to tag CLI usage by coding agents. (#9070 )
Original file line number Diff line number Diff line change @@ -7,6 +7,16 @@ import { logger } from "./logger";
77import { isFirebaseStudio } from "./env" ;
88const pkg = require ( "../package.json" ) ;
99
10+ // Detect if the CLI was invoked by a coding agent, based on well-known env vars.
11+ function detectAIAgent ( ) : string {
12+ if ( process . env . CODEX_SANDBOX ) return "codex_cli" ;
13+ if ( process . env . CLAUDECODE ) return "claude_code" ;
14+ if ( process . env . GEMINI_CLI ) return "gemini_cli" ;
15+ if ( process . env . CURSOR_AGENT ) return "cursor" ;
16+ if ( process . env . OPENCODE ) return "open_code" ;
17+ return "unknown" ;
18+ }
19+
1020type cliEventNames =
1121 | "command_execution"
1222 | "product_deploy"
@@ -85,6 +95,9 @@ const GA4_USER_PROPS = {
8595 is_firebase_studio : {
8696 value : isFirebaseStudio ( ) . toString ( ) ,
8797 } ,
98+ ai_agent : {
99+ value : detectAIAgent ( ) ,
100+ } ,
88101} ;
89102
90103export interface AnalyticsParams {
You can’t perform that action at this time.
0 commit comments