Skip to content
TheChatArchiveThe Chat Archive
gpt-5.6-sol· openaiHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

gemini-cli: support Login with Google (oauth-personal), mirroring codex auth.json The…

  1. User

    gemini-cli: support Login with Google (oauth-personal), mirroring codex auth.json The codex agent injects a cached OAuth credential (~/.codex/auth.json) so runs can use a login instead of an API key (CODEX_AUTH_JSON_PATH / CODEX_FORCE_AUTH_JSON), and claude-code accepts CLAUDE_CODE_OAUTH_TOKEN (#173). gemini-cli has no equivalent — it only wires GEMINI_API_KEY / Vertex env, so users with a "Login with Google" session (~/.gemini/oauth_creds.json) must keep a separate API key for runs.

    Proposal: add the same opt-in OAuth-credential injection to the gemini-cli agent, mirroring the codex pattern — GEMINI_OAUTH_CREDS_PATH / GEMINI_FORCE_OAUTH, default behavior unchanged (fully backward-compatible).

    I have a working implementation that mirrors the codex auth flow (_resolve_oauth_creds_path → upload → chown → ~/.gemini) with tests ported 1:1 from test_codex_auth.py, verified end-to-end (gemini-cli --ae GEMINI_FORCE_OAUTH=true completed hello-world, reward 1.0). Happy to open the PR or hand it off — whichever you prefer.

    Interface

    No new interfaces are introduced.

  2. Assistant

    I’ll trace the existing Codex credential flow and Gemini agent/tests, then implement the matching opt-in behavior and run the repository-required checks.

  3. Assistant

    The existing Codex path uses an explicit opt-in resolver, stages the host credential under /tmp, fixes ownership, and symlinks it into the CLI home. I’m applying that same lifecycle to Gemini, including best-effort secret cleanup and preserving the default API-key/Vertex behavior.

  4. Assistant

    The resolver and staging tests pass. I’m now checking the surrounding Gemini configuration behavior to ensure the injected token also selects the non-interactive oauth-personal auth mode, rather than merely placing the file where the CLI can find it.

  5. Assistant

    The OAuth branch now explicitly selects Gemini CLI’s oauth-personal mode, so it remains non-interactive even when no API key is present. Formatting, linting, and type checking are clean; I’m running the full unit suite now.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.