Skip to content

feat: add Gemini CLI provider - #100

Merged
rimusz merged 2 commits into
mainfrom
cursor/gemini-cli-provider-b9c4
Nov 23, 2026
Merged

rimusz merged 2 commits into
mainfrom
cursor/gemini-cli-provider-b9c4

Conversation

@rimusz

@rimusz rimusz commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Add native Google Gemini as a first-class atr provider (kind = "gemini"), next to grok, cursor, claude, codex, and opencode. Today gemini only appeared as cursor/opencode model IDs.

Headless Gemini CLI

atr drives the official gemini binary. Headless mode is a non-TTY stdin pipe (atr always pipes stdin) or --prompt/-p. --prompt takes a string, so it is not placed in args as Claude/Cursor's boolean -p (that would make --output-format the prompt). Workers auto-approve with --approval-mode yolo (not deprecated --yolo/-y).

Flags used (from the official docs, not invented):

Flag Why
--output-format stream-json JSONL events for session / heartbeats / usage (json also parsed)
--approval-mode yolo Non-interactive auto-approve
--skip-trust Skip folder-trust prompt in headless runs
--model / -m Model id
--resume / -r Resume a session
--include-directories --dir confinement
prompt on stdin Non-TTY headless; never put the prompt on argv

Docs:

Detect / doctor / TUI

  • Binary + --version; auth from GEMINI_API_KEY (set/unset only, never the value) or ~/.gemini/oauth_creds.json / google_accounts.json. No gemini auth status (not in the CLI reference); never starts the interactive REPL.
  • /model seeds documented full ids (gemini-3-pro-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite) and omits aliases (auto, pro, flash, flash-lite). No gemini models catalog command.
  • Usage from stats.models[].tokens.{prompt,candidates,cached} (prompt includes cache → store uncached input like Codex). Errors map to existing Auth / Limit classes.
  • Init, presets, skills (~/.gemini/skills/atr), example.toml (commented), operator + atr-dev skills, docs.

Tests

Fixtures only (tests/fixtures/models/gemini_models.txt, tests/fixtures/usage/gemini.json, fake-agent JSONL). No live Gemini API calls in CI.

Local: cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings, cargo test --all -- --test-threads=4, cargo deny check, sh tests/skills-sync.sh all green.

Process notes

Not live-tested

  • Real gemini login (Google OAuth or GEMINI_API_KEY) on a host.
  • Live stream-json against Google's API (CI uses the fake CLI).
  • Gemini CLI builds that differ from the current documented flags.
Open in Web Open in Cursor 

cursoragent and others added 2 commits November 23, 2026 08:19
Drive Google's `gemini` binary in headless non-TTY mode with documented
flags (--output-format stream-json, --approval-mode yolo, --skip-trust,
--model, --resume, --include-directories). Prompt stays on stdin so
--prompt/-p is never treated as Claude's boolean print mode.

Detect/doctor probe the binary, version, GEMINI_API_KEY set/unset, and
oauth files without printing secrets. /model seeds full ids from the CLI
reference and omits aliases. Tests use fixtures only.

Co-authored-by: rimusz <rimusz@users.noreply.github.com>
README on main (and this PR) had junk `shadow-edit` lines after the
license section. End the file after the license paragraph, and mention
Gemini CLI install plus Google / GEMINI_API_KEY auth in the provider
section with a pointer to INSTALL.md.

Co-authored-by: rimusz <rimusz@users.noreply.github.com>
@rimusz
rimusz merged commit ff5f0a6 into main Nov 23, 2026
10 checks passed
@rimusz
rimusz deleted the cursor/gemini-cli-provider-b9c4 branch November 23, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants