From ad1e39c9037c12e3a7756f1be33d7f3019ec52d2 Mon Sep 17 00:00:00 2001 From: theg1239 Date: Thu, 24 Apr 2025 17:03:34 +0530 Subject: [PATCH] feat: add specific instructions for creating API keys in error msg (#581) Updates the error message for missing Gemini API keys to reference "Google AI Studio" instead of the generic "GEMINI dashboard". This provides users with more accurate information about where to obtain their Gemini API keys. This could be extended to other providers as well. --- codex-cli/src/cli.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codex-cli/src/cli.tsx b/codex-cli/src/cli.tsx index 1118bfe6..9a1fcd22 100644 --- a/codex-cli/src/cli.tsx +++ b/codex-cli/src/cli.tsx @@ -271,6 +271,10 @@ if (!apiKey && !NO_API_KEY_REQUIRED.has(provider.toLowerCase())) { ? `You can create a key here: ${chalk.bold( chalk.underline("https://platform.openai.com/account/api-keys"), )}\n` + : provider.toLowerCase() === "gemini" + ? `You can create a ${chalk.bold( + `${provider.toUpperCase()}_API_KEY`, + )} ` + `in the ${chalk.bold(`Google AI Studio`)}.\n` : `You can create a ${chalk.bold( `${provider.toUpperCase()}_API_KEY`, )} ` + `in the ${chalk.bold(`${provider}`)} dashboard.\n`