diff --git a/scripts/start.js b/scripts/start.js index a94a22a2e0..a95a9d399b 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -66,6 +66,21 @@ const env = { DEV: 'true', }; +const keepCiEnv = + process.env.GEMINI_KEEP_CI_ENV === '1' || + process.env.GEMINI_KEEP_CI_ENV === 'true'; +if (!keepCiEnv) { + const ciKeys = ['CI', 'CONTINUOUS_INTEGRATION', 'GITHUB_ACTIONS'].filter( + (k) => k in env, + ); + if (ciKeys.length > 0) { + ciKeys.forEach((k) => delete env[k]); + process.stderr.write( + `[gemini] Removed CI env vars to keep interactive mode working in dev: ${ciKeys.join(', ')}. Set GEMINI_KEEP_CI_ENV=1 to disable.\n`, + ); + } +} + if (isInDebugMode) { // If this is not set, the debugger will pause on the outer process rather // than the relaunched process making it harder to debug.