Requires Chrome Extension — This CLI tool controls ChatGPT/Gemini tabs via a browser extension.
Let your AI assistant (Claude Code, Cursor, etc.) consult ChatGPT and Gemini for second opinions.
Your AI Assistant → cab CLI / daemon → Chrome Extension → ChatGPT/Gemini tabs
- Chrome Extension (you install) bridges the daemon and browser
cabCLI / daemon (npm package) receives requests from your AI assistant via REST API- Extension controls ChatGPT/Gemini tabs via CDP (Chrome DevTools Protocol)
Why an extension? ChatGPT and Gemini don't have free public APIs. The extension automates the web UI while you stay logged in.
chrome-ai-bridge is a CLI tool and daemon that gives AI assistants the ability to:
- Consult other AIs: Ask ChatGPT and Gemini questions via browser
- Get multiple perspectives: Query both AIs in parallel for second opinions
- Debug connections: Inspect page state via CDP snapshots
v2.0.0 Breaking Change: This version uses a Chrome extension for browser communication instead of Puppeteer. Previous CLI options (
--headless,--loadExtensionsDir, etc.) are no longer supported.
UI changes? No problem. Responses won't break anymore.
v2.1 introduces a fundamentally new approach to response extraction. Instead of reading text from the page (DOM), chrome-ai-bridge now intercepts the actual network communication between your browser and ChatGPT/Gemini.
| v2.0 (DOM extraction) | v2.1 (Network interception) | |
|---|---|---|
| How it works | Read HTML elements via CSS selectors | Intercept API responses directly |
| When UI changes | Breaks (selectors become invalid) | Unaffected |
| Output format | Plain text only | Markdown, LaTeX, structured content |
| Thinking mode | Complex filtering needed | Naturally separated by protocol |
| Reliability | Depends on page rendering | Depends on API protocol (stable) |
v2.0: CDP → DOM querySelector → innerText
v2.1: CDP → Network.loadingFinished → getResponseBody → Protocol Parser
│
┌───────────────────┴────────────────┐
▼ ▼
ChatGPT SSE Parser Gemini Chunked Parser
(delta_encoding v1) (StreamGenerate format)
Network extraction is the primary path. DOM extraction remains as an automatic fallback — no configuration needed.
Privacy: All data stays local. Network interception happens within your browser via CDP. No data is sent to external servers.
Both steps are required — The extension and daemon work together.
Build and install the extension from this repository:
# Clone the repository
git clone https://github.com/usedhonda/chrome-ai-bridge.git
cd chrome-ai-bridge
# Install dependencies and build
npm install && npm run buildThen load the extension in Chrome:
- Open
chrome://extensions/in Chrome - Enable "Developer mode" (toggle in top-right)
- Click "Load unpacked"
- Select the
build/extension/folder from this repository
You should see "Chrome AI Bridge" appear in your extensions list.
npm install -g chrome-ai-bridge- Open ChatGPT (https://chatgpt.com) or Gemini (https://gemini.google.com) in Chrome
- Log in to both services
- The extension will automatically connect when the daemon starts
cab ask chatgpt "How do I implement OAuth in Node.js?"Ask ChatGPT or Gemini questions directly from your AI assistant:
"Ask ChatGPT how to implement OAuth in Node.js"
"Ask Gemini to review this architecture decision"
"Ask both AIs for their opinions on this approach"
| Feature | Description |
|---|---|
| Parallel queries | Ask both AIs simultaneously with ask_chatgpt_gemini_web |
| Session persistence | Conversations continue across tool calls |
| Auto-logging | All Q&A saved to .local/chrome-ai-bridge/history.jsonl |
Inspect the connection state and page content:
| Tool | Description |
|---|---|
take_cdp_snapshot |
Get page state (URL, title, input/button status) |
get_page_dom |
Query DOM elements with CSS selectors |
| Tool | Description |
|---|---|
ask_chatgpt_web |
Ask ChatGPT via browser |
ask_gemini_web |
Ask Gemini via browser |
ask_chatgpt_gemini_web |
Ask both AIs in parallel (recommended) |
take_cdp_snapshot |
Debug: Get CDP page state |
get_page_dom |
Debug: Query DOM elements |
For general queries, use ask_chatgpt_gemini_web to get multiple perspectives:
User: "Ask AI about React best practices"
→ Claude uses ask_chatgpt_gemini_web (queries both in parallel)
Only use individual tools when explicitly requested:
User: "Ask ChatGPT specifically about this"
→ Claude uses ask_chatgpt_web
| Variable | Description |
|---|---|
CAI_DISABLE_WEB_LLM |
Set true to disable ChatGPT/Gemini tools |
git clone https://github.com/usedhonda/chrome-ai-bridge.git
cd chrome-ai-bridge
npm install && npm run buildFor local development, run the daemon directly:
node /path/to/chrome-ai-bridge/scripts/cli.mjsnpm run build # Build TypeScript
npm run typecheck # Type check only
npm run test:smoke # Basic operation check
npm run format # Format codechrome-ai-bridge/
├── src/
│ ├── fast-cdp/ # CDP client and AI chat logic
│ ├── extension/ # Chrome extension source
│ ├── main.ts # Daemon entry point
│ └── index.ts # Main exports
├── scripts/
│ └── cli.mjs # CLI entry point
└── docs/ # Documentation
# Test ChatGPT connection
npm run test:chatgpt -- "TypeScript generics explanation"
# Test Gemini connection
npm run test:gemini -- "Python async file reading"
# Test both
npm run test:both
# CDP snapshot for debugging
npm run cdp:chatgpt
npm run cdp:gemini| Guide | Description |
|---|---|
| Technical Spec | Detailed architecture and implementation |
| Setup Guide | Detailed setup and configuration |
| Troubleshooting | Problem solving |
| CI Policy | Required checks and browser E2E lane policy |
| Technical Spec - Architecture | Extension architecture |
- Check that the extension is installed and enabled in
chrome://extensions/ - Verify ChatGPT/Gemini tabs are open and logged in
- Check the extension popup for connection status
cab status
# or restart:
cab daemon restart- Ensure you're logged in to both services
- Try refreshing the ChatGPT/Gemini tab
- Check for rate limiting or service issues
More: docs/user/troubleshooting.md
┌─────────────────┐ REST API ┌──────────────────┐
│ Claude Code │ ◀──────────────────▶│ Chrome AI Bridge│
│ (cab CLI) │ │ (Node.js) │
└─────────────────┘ └────────┬─────────┘
│
▼
┌──────────────────┐
│ Chrome Extension │
│ (CDP via WebSocket)│
└────────┬─────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ ChatGPT Tab │ │ Gemini Tab │
└─────────────────┘ └─────────────────┘
Originally forked from Chrome DevTools MCP by Google LLC. This fork focuses on multi-AI consultation capabilities via Chrome extension.
The extension source code is located at src/extension/ and is built to build/extension/.
Apache-2.0