mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Enable Gemini CLI to reuse user's auth in Cloud Shell (#3070)
This commit is contained in:
committed by
GitHub
parent
357546a2aa
commit
48c2aa296a
@@ -103,14 +103,21 @@ export async function main() {
|
||||
const extensions = loadExtensions(workspaceRoot);
|
||||
const config = await loadCliConfig(settings.merged, extensions, sessionId);
|
||||
|
||||
// set default fallback to gemini api key
|
||||
// this has to go after load cli because that's where the env is set
|
||||
if (!settings.merged.selectedAuthType && process.env.GEMINI_API_KEY) {
|
||||
settings.setValue(
|
||||
SettingScope.User,
|
||||
'selectedAuthType',
|
||||
AuthType.USE_GEMINI,
|
||||
);
|
||||
// Set a default auth type if one isn't set for a couple of known cases.
|
||||
if (!settings.merged.selectedAuthType) {
|
||||
if (process.env.GEMINI_API_KEY) {
|
||||
settings.setValue(
|
||||
SettingScope.User,
|
||||
'selectedAuthType',
|
||||
AuthType.USE_GEMINI,
|
||||
);
|
||||
} else if (process.env.CLOUD_SHELL === 'true') {
|
||||
settings.setValue(
|
||||
SettingScope.User,
|
||||
'selectedAuthType',
|
||||
AuthType.CLOUD_SHELL,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
setMaxSizedBoxDebugging(config.getDebugMode());
|
||||
|
||||
Reference in New Issue
Block a user