feat(cli): add gemini-auth command and alias support
This commit is contained in:
@@ -4,6 +4,7 @@ import type { ModelClient, RetryConfig, ModelTier } from '../models/index.js';
|
||||
import { logger } from '../logger.js';
|
||||
import { getZaiApiKey } from '../auth/zai.js';
|
||||
import { getAnthropicApiKey, getAnthropicAuthToken } from '../auth/anthropic.js';
|
||||
import { getGeminiApiKey } from '../auth/gemini.js';
|
||||
import { getOpenAIApiKey, loadStoredOpenAIAuth } from '../auth/openai.js';
|
||||
|
||||
type AuthMode = 'auto' | 'api_key' | 'oauth';
|
||||
@@ -223,10 +224,13 @@ export function createClientFromConfig(cfg: ModelConfig): ModelClient {
|
||||
authToken: cfg.auth_token,
|
||||
});
|
||||
case 'gemini':
|
||||
{
|
||||
const apiKey = cfg.api_key ?? getGeminiApiKey() ?? undefined;
|
||||
return new GeminiClient({
|
||||
model: cfg.model,
|
||||
apiKey: cfg.api_key,
|
||||
apiKey,
|
||||
});
|
||||
}
|
||||
case 'openrouter':
|
||||
{
|
||||
const keys = resolveApiKeyPool(cfg, 'OPENROUTER_API_KEY');
|
||||
|
||||
Reference in New Issue
Block a user