antigravity-cli: support Google AI subscription login (no API key)

Open
#4,566 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@marcusschiesser is already working on this.

Since Dec 2, 2026.

  • #4570 by @marcusschiesser — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Start by tracing check_model_credentials and the antigravity-cli settings and environment setup; compare how CLAUDE_FORCE_OAUTH, CODEX_FORCE_AUTH_JSON, and GEMINI_FORCE_OAUTH are handled. The issue specifies the two agy credential files and the proposed opt-in behavior. A pull request is already open, so check its status and discussion before taking this on.

Written by the indexing model from the issue text.

Description

Problem

antigravity-cli supports a Gemini API key, enterprise ADC (AGY_ADC_AUTH) and an LLM gateway. There is no headless path for a personal Google AI subscription (Google account sign-in), although Harbor has one for Claude Code (CLAUDE_FORCE_OAUTH), Codex (CODEX_FORCE_AUTH_JSON / CODEX_AUTH_JSON_PATH) and Gemini CLI (GEMINI_FORCE_OAUTH / GEMINI_OAUTH_CREDS_PATH).

Found while running Harbor 0.27.0 with agy 1.5.21 for a benchmark run.

What works with agy 1.5.21

On macOS agy stores the login in the Keychain, which a container cannot read. A one-time interactive agy sign-in in a Linux container (no system keyring) writes the login to two plain files:

  • ~/.gemini/antigravity-cli/antigravity-oauth-token
  • ~/.config/antigravity/credential-user-scope

Uploading both into a task container (mode 600) lets headless agy --print runs use the subscription. Two things in Harbor get in the way:

  1. check_model_credentials requires GEMINI_API_KEY / GOOGLE_API_KEY unless AGY_ADC_AUTH is set.
  2. If a key is present anywhere, settings.json gets "modelProvider": "gemini", and agy then insists on the key instead of the uploaded login: modelProvider is set to "gemini" in settings.json, but the GEMINI_API_KEY environment variable is not set.

Repro

# no GEMINI_API_KEY / GOOGLE_API_KEY, signed-in login files available
harbor run -p <task> -a antigravity-cli -m gemini/gemini-3-flash-preview --ak version=1.5.21
# -> credential preflight fails: antigravity-cli: set GEMINI_API_KEY or GOOGLE_API_KEY ...

Proposal

An opt-in subscription mode in the style of the other agents, e.g. AGY_FORCE_OAUTH=true (use the host's agy login files) and AGY_OAUTH_DIR=<dir> (a directory holding both files, for hosts where agy keeps the login in a keyring). In that mode Harbor skips the API-key preflight, uploads the files, leaves modelProvider unset and keeps API keys out of the agy environment.

History

A token-file path existed before (AGY_AUTH_JSON_PATH / AGY_FORCE_AUTH_JSON, #2254) and was removed in #2776 in favour of the documented API-key and ADC paths. #2905 and #3963 tried to bring it back and were closed by their authors. Neither documented path covers a personal subscription, which is why this is being raised again. Current agy also needs credential-user-scope next to the token.

A PR follows.

Drafted with AI assistance (Claude Code) and reviewed before posting.

Dominant language
Python
Stars
5.6k
Forks
1.9k
Avg merge
1d 17h
Merged PRs (30d)
156

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from harbor-framework/harbor

All issues in harbor-framework/harbor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.