diff --git a/codex-cli/src/cli.tsx b/codex-cli/src/cli.tsx index 6220128f..2872cf0c 100644 --- a/codex-cli/src/cli.tsx +++ b/codex-cli/src/cli.tsx @@ -258,11 +258,19 @@ if (!apiKey) { // eslint-disable-next-line no-console console.error( `\n${chalk.red(`Missing ${provider} API key.`)}\n\n` + - `Set the environment variable ${chalk.bold("OPENAI_API_KEY")} ` + + `Set the environment variable ${chalk.bold( + `${provider.toUpperCase()}_API_KEY`, + )} ` + `and re-run this command.\n` + - `You can create a key here: ${chalk.bold( - chalk.underline("https://platform.openai.com/account/api-keys"), - )}\n`, + `${ + provider.toLowerCase() === "openai" + ? `You can create a key here: ${chalk.bold( + chalk.underline("https://platform.openai.com/account/api-keys"), + )}\n` + : `You can create a ${chalk.bold( + `${provider.toUpperCase()}_API_KEY`, + )} ` + `in the ${chalk.bold(`${provider}`)} dashboard.\n` + }`, ); process.exit(1); }