← Catalog

@audsiui/pi-gemini-search

Pi extension — self-hosted Google Antigravity OAuth plus a Gemini Google Search grounding web_search tool

Extension

Install

Install with PiG

pig install npm:@audsiui/pi-gemini-search

Install with Pi

pi install npm:@audsiui/pi-gemini-search
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

A Pi extension that adds a gemini_web_search tool backed by Google Antigravity OAuth and Gemini Google Search grounding.

The whole lifecycle — OAuth login, token refresh, model catalog — is owned by the extension. Pi's /login and auth.json are not touched.

Install

# local checkout: add this line to ~/.pi/agent/settings.json "packages"
#   "../../pi-extend/pi-gemini-search"

# or as a package
pi install npm:@audsiui/pi-gemini-search

typebox is a peer dependency — run bun install inside the package directory for local development, then /reload.

Usage

CommandDescription
/gemini-search login [manual]Sign in with browser OAuth (loopback callback; manual = paste the redirect URL)
/gemini-search logoutDelete stored credentials
/gemini-search statusAccount, client, project id, token expiry, active model
/gemini-search refreshRe-pull the model catalog from the account
/gemini-search model [id]Switch grounding model (interactive picker without an id)
/gemini-search usageRemaining quota — 5h / weekly buckets with reset times

gemini_web_search tool — query (Google operators such as site: / inurl: / filetype: are honored) plus optional numResults (1–20). Returns a synthesized answer, numbered sources, cited passages, and the queries the grounding actually issued.

State lives in ~/.pi/agent/gemini-search/: credentials.json (mode 0600) and models.json (its selectedModel picks the model).

Environment variables

VariablePurpose
PI_GEMINI_SEARCH_CLIENT_ID / PI_GEMINI_SEARCH_CLIENT_SECRETUse your own OAuth client instead of the built-in one
PI_GEMINI_SEARCH_ANTIGRAVITY_UAOverride the client User-Agent
PI_GEMINI_SEARCH_HOMEOverride the credential/catalog directory

Credits

The endpoints, OAuth scopes, client credentials, and the grounding request/response shapes are adapted from oh-my-pi (rules/auth/google-antigravity.kdl, catalog/src/discovery/antigravity.ts, catalog/src/wire/gemini-headers.ts), the official Gemini CLI / Antigravity clients, and the quota endpoints documented by CodexBar and UsageBar. These are undocumented Google-internal APIs that can change or rate-limit without notice — intended for personal use.

Layout

extensions/
├── index.ts        # commands + tool registration
├── config.ts       # endpoints, scopes, UA, client resolution
├── cloud-code.ts   # loadCodeAssist / onboardUser / fetchAvailableModels / grounding / quota
├── catalog.ts      # models.json read/write, model selection
├── search.ts       # search orchestration + formatForLLM
└── auth/           # loopback, PKCE, browser, 0600 store, token refresh

Development

bun run extensions/smoke.test.ts   # 19 offline tests (mocked fetch)
bun run extensions/pi-api.test.ts  # 5 extension-API tests

License

MIT © audsiui