summaryrefslogtreecommitdiff
path: root/packages/cli/src/config/config.ts
diff options
context:
space:
mode:
authorSeth Troisi <[email protected]>2025-06-09 13:54:11 -0700
committerGitHub <[email protected]>2025-06-09 13:54:11 -0700
commitf11414a424fb6a440e74d0faabfa254ea75d82c7 (patch)
tree7032d8226e9fefaa02cc714cbf65b174dd6d96ca /packages/cli/src/config/config.ts
parent6e5332f7163e88d38541418332d667a8622a7d38 (diff)
Use GOOGLE_API_KEY as default if both GEMINI and GOOGLE set (#777)
Diffstat (limited to 'packages/cli/src/config/config.ts')
-rw-r--r--packages/cli/src/config/config.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts
index 1cff28f8..83cfb296 100644
--- a/packages/cli/src/config/config.ts
+++ b/packages/cli/src/config/config.ts
@@ -188,6 +188,11 @@ async function createContentGeneratorConfig(
const hasVertexProjectLocationConfig =
!!googleCloudProject && !!googleCloudLocation;
+ if (hasGeminiApiKey && hasGoogleApiKey) {
+ logger.warn(
+ 'Both GEMINI_API_KEY and GOOGLE_API_KEY are set. Using GOOGLE_API_KEY.',
+ );
+ }
if (!hasGeminiApiKey && !hasGoogleApiKey && !hasVertexProjectLocationConfig) {
logger.error(
'No valid API authentication configuration found. Please set ONE of the following combinations in your environment variables or .env file:\n' +
@@ -203,7 +208,7 @@ async function createContentGeneratorConfig(
const config: ContentGeneratorConfig = {
model: argv.model || DEFAULT_GEMINI_MODEL,
- apiKey: geminiApiKey || googleApiKey || '',
+ apiKey: googleApiKey || geminiApiKey || '',
vertexai: hasGeminiApiKey ? false : undefined,
};