diff options
| author | Seth Troisi <[email protected]> | 2025-07-10 18:59:02 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-11 01:59:02 +0000 |
| commit | 8a128d8dc6c1c5d7aea7004e0efa9fd175be36e5 (patch) | |
| tree | cf9d6f3bb06586e6cefe3d72bdd015531f887494 /packages/cli/src/gemini.tsx | |
| parent | ab66e3a24ebc3ec6c2e8f0c68065680066e265cf (diff) | |
Add NO_BROWSER environment variable to trigger offline oauth flow (#3713)
Diffstat (limited to 'packages/cli/src/gemini.tsx')
| -rw-r--r-- | packages/cli/src/gemini.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx index 84a3da62..8b58c46a 100644 --- a/packages/cli/src/gemini.tsx +++ b/packages/cli/src/gemini.tsx @@ -35,6 +35,7 @@ import { sessionId, logUserPrompt, AuthType, + getOauthClient, } from '@google/gemini-cli-core'; import { validateAuthMethod } from './config/auth.js'; import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js'; @@ -165,6 +166,15 @@ export async function main() { } } } + + if ( + settings.merged.selectedAuthType === AuthType.LOGIN_WITH_GOOGLE && + config.getNoBrowser() + ) { + // Do oauth before app renders to make copying the link possible. + await getOauthClient(settings.merged.selectedAuthType, config); + } + let input = config.getQuestion(); const startupWarnings = [ ...(await getStartupWarnings()), |
