Enable Gemini CLI to reuse user's auth in Cloud Shell (#3070)

This commit is contained in:
Marat Boshernitsan
2025-07-07 15:02:13 -07:00
committed by GitHub
parent 1afb62ad31
commit 5c6d8f7548
10 changed files with 211 additions and 32 deletions
+5 -2
View File
@@ -14,8 +14,11 @@ export async function createCodeAssistContentGenerator(
authType: AuthType,
sessionId?: string,
): Promise<ContentGenerator> {
if (authType === AuthType.LOGIN_WITH_GOOGLE) {
const authClient = await getOauthClient();
if (
authType === AuthType.LOGIN_WITH_GOOGLE ||
authType === AuthType.CLOUD_SHELL
) {
const authClient = await getOauthClient(authType);
const projectId = await setupUser(authClient);
return new CodeAssistServer(authClient, projectId, httpOptions, sessionId);
}