summaryrefslogtreecommitdiff
path: root/packages/cli/src/config/config.ts
diff options
context:
space:
mode:
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,
};