This commit is contained in:
Fan
2025-08-02 23:44:35 +08:00
committed by GitHub
parent a0dbb40dae
commit dbc0eb4336
2 changed files with 21 additions and 1 deletions

View File

@@ -18,6 +18,9 @@ function getAuthTypeFromEnv(): AuthType | undefined {
if (process.env.GEMINI_API_KEY) {
return AuthType.USE_GEMINI;
}
if (process.env.OPENAI_API_KEY) {
return AuthType.USE_OPENAI;
}
return undefined;
}
@@ -29,7 +32,7 @@ export async function validateNonInteractiveAuth(
if (!effectiveAuthType) {
console.error(
`Please set an Auth method in your ${USER_SETTINGS_PATH} or specify one of the following environment variables before running: GEMINI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA`,
`Please set an Auth method in your ${USER_SETTINGS_PATH} or specify one of the following environment variables before running: GEMINI_API_KEY, OPENAI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA`,
);
process.exit(1);
}