Skip to content

Add Gemini to Ask AI via Antigravity subscription or API key - #109

Merged
mberman84 merged 2 commits into
mainfrom
feat/gemini-api
Nov 27, 2026
Merged

mberman84 merged 2 commits into
mainfrom
feat/gemini-api

Conversation

@mberman84

@mberman84 mberman84 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Ask AI supports ChatGPT, Claude, OpenRouter, and custom endpoints, so people who want to use Gemini (#102) have no built-in way to connect either their Google AI / Antigravity subscription or a Gemini API key.

Change

  • Added Gemini as a built-in Ask AI provider with a Connection switch in Settings → Ask AI between Antigravity (default) and API key (plus quick links to switch between the two in the Ask AI setup card).
  • Antigravity subscription (agy): locates the user's own, unmodified Antigravity CLI (agy) across standard macOS, Linux, and Windows install folders (ignoring relative PATH entries and Windows .cmd/.bat shims), lists available plan models, and streams answers over stdin/stdout NDJSON inside a private temporary folder with tools, commands, MCP servers, skills, plugins, and slash commands disabled. Folio never sees or stores Google credentials.
  • Gemini API key: validates keys directly against Google's Gemini API (x-goog-api-key header only), stores keys only with operating-system encryption (safeStorage), fetches and filters compatible generateContent models, and streams answers with page citations, Stop cancellation, and passage-only scoping.
  • Added unit tests (scripts/test-agy.cjs, scripts/test-gemini.cjs), updated the Electron smoke tests (scripts/smoke-test.mjs, scripts/smoke-gemini.mjs), CI workflow (.github/workflows/ci.yml), and documentation (README.md, SECURITY.md).

Issue or approval

Closes #102 (maintainer request).

How I checked it

  • Verified on macOS (darwin):
    • npx tsc --noEmit
    • npm audit --audit-level=high
    • node --test scripts/test-agy.cjs scripts/test-gemini.cjs scripts/test-openrouter.cjs scripts/test-custom-endpoint.cjs scripts/test-claude-path.cjs (34/34 passed)
    • npm test (all 17 Vitest suites passed)
    • npm run build
    • npm run test:reader-security and npm run smoke (including Antigravity + Gemini API key smoke flows and print checks)
    • npm run test:chat-math, npm run test:thumbnails, and remaining scripts/test-*.{cjs,mjs} suites
    • Verified live end-to-end status detection, model listing, streaming answers with citations, and temp folder cleanup against local Antigravity CLI (agy 1.5.18)
  • Windows and Linux builds and smoke tests run in GitHub Actions CI.

Implemented with Gemini 4 Neon in T3 Code.

@mberman84 mberman84 changed the title Connect Ask AI directly to the Gemini API Add Gemini to Ask AI via Antigravity subscription or API key Nov 27, 2026
@mberman84
mberman84 merged commit fb9583a into main Nov 27, 2026
3 checks passed
@mberman84
mberman84 deleted the feat/gemini-api branch November 27, 2026 22:25
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.

Gemini API integration and better selection/link support in select mode

1 participant