@qraxiss/pi-gemini-auth
Pi extension package for Gemini OAuth compatibility
Package details
Install @qraxiss/pi-gemini-auth from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@qraxiss/pi-gemini-auth- Package
@qraxiss/pi-gemini-auth- Version
0.5.1- Published
- May 29, 2026
- Downloads
- 396/mo · 52/wk
- Author
- qraxiss
- License
- MIT
- Types
- extension
- Size
- 90.8 KB
- Dependencies
- 1 dependency · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@qraxiss/pi-gemini-auth
Pi extension that restores Google Cloud Code Assist (Gemini CLI) OAuth and provider support as a self-contained package.
What it does
This extension adds:
- OAuth integration for Google Cloud Code Assist (Gemini CLI) using a browser-based PKCE flow
- Gemini provider compatible with Pi's agent and coding agent interfaces
- Token persistence and refresh to keep authentication seamless across sessions
- Multiple Gemini models including Gemini 2.0 Flash, Gemini 2.0 Pro, and others from Google Cloud Code Assist
The provider was originally part of Pi but has been removed from upstream. This package restores it as a standalone, independently versioned extension — no modified Pi fork required.
Install
Use the extension (recommended)
pi install npm:@qraxiss/pi-gemini-auth
Or try it without installing:
pi -e npm:@qraxiss/pi-gemini-auth
Load from a local directory (development)
pi -e /abs/path/to/pi-gemini-auth
Note: local directory loading requires pnpm install in the package first (Pi does not auto-install for local paths).
Usage
After installing the extension:
- Run
/loginin Pi - Select "Google Cloud Code Assist (Gemini CLI)"
- Complete the Google authentication flow in your browser
- Choose a Gemini model from the model list and start chatting
The extension remembers your authentication across sessions via Pi's settings.
Requirements
- Node.js ≥ 22
- A Google account (no billing required for the free tier)
- Optional environment variables for non-free tiers:
GOOGLE_CLOUD_PROJECTorGOOGLE_CLOUD_PROJECT_ID: explicitly set your Cloud project ID (auto-provisioned for free tier)
Security
Pi extensions run with full system access (see Pi documentation for details). Review the source code before installation if you have security concerns.
Development
Setup
pnpm install
Type check
pnpm run check
Lint
pnpm run lint
Test
pnpm run test
Load in Pi locally
pi -e /abs/path/to/pi-gemini-auth
After loading, run /login and verify the Gemini provider appears and streams responses.
How it works
The extension:
Registers a Google Cloud Code Assist OAuth provider that:
- Generates a PKCE code challenge for secure OAuth
- Opens the browser for user consent
- Exchanges the auth code for an access token and project ID
- Stores credentials in Pi settings for reuse
Provides Gemini models from Google Cloud Code Assist, including:
- Gemini 2.0 Flash
- Gemini 2.0 Pro
- Gemini 2.0 Thinking (experimental)
- Gemini 1.5 Pro
- Gemini 1.5 Flash
- Gemini 2.0 Flash (Lite)
- Gemini 1.5 Flash (Lite)
Streams responses with proper message formatting and thinking blocks (where applicable)
License
MIT
Author
Fatih Güman