feat: add Gemini API key onboarding
This commit is contained in:
committed by
Peter Steinberger
parent
340d5d03f2
commit
302d51fd40
@@ -30,6 +30,7 @@ import {
|
||||
applyMinimaxConfig,
|
||||
applyMinimaxProviderConfig,
|
||||
setAnthropicApiKey,
|
||||
setGeminiApiKey,
|
||||
writeOAuthCredentials,
|
||||
} from "./onboard-auth.js";
|
||||
import { openUrl } from "./onboard-helpers.js";
|
||||
@@ -415,6 +416,17 @@ export async function applyAuthChoice(params: {
|
||||
"OAuth help",
|
||||
);
|
||||
}
|
||||
} else if (params.authChoice === "gemini-api-key") {
|
||||
const key = await params.prompter.text({
|
||||
message: "Enter Gemini API key",
|
||||
validate: (value) => (value?.trim() ? undefined : "Required"),
|
||||
});
|
||||
await setGeminiApiKey(String(key).trim(), params.agentDir);
|
||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||
profileId: "google:default",
|
||||
provider: "google",
|
||||
mode: "api_key",
|
||||
});
|
||||
} else if (params.authChoice === "apiKey") {
|
||||
const key = await params.prompter.text({
|
||||
message: "Enter Anthropic API key",
|
||||
|
||||
Reference in New Issue
Block a user