A lightweight bridge connecting a Node.js CLI terminal to a Chrome Extension for automating web-based AI interactions and displaying formatted responses directly in your terminal.
- Terminal Interface: Send prompts and receive AI responses directly from your CLI.
- Automated Web Interactions: Automatically opens sessions, submits queries, and retrieves responses from web AI interfaces.
┌────────────────┐ WebSocket ┌──────────────────┐ Automation ┌──────────────────┐
│ Node.js CLI │ ─────────────────► │ Chrome Extension │ ─────────────────► │ Target AI Page │
│ (server.js) │ ◄───────────────── │ (Background) │ ◄───────────────── │ │
└────────────────┘ └──────────────────┘ └──────────────────┘
server.js — Node.js CLI and WebSocket server that handles prompt input and output formatting.
background.js — Extension background worker managing tab automation and page interaction.
offscreen.js / offscreen.html — WebSocket client layer maintaining the background connection.
manifest.json — Extension manifest and configuration.
- Install Dependencies
Bash
cd server-cli
npm install- Load Extension
Open Chrome and go to chrome://extensions/.
Enable Developer mode.
Click Load unpacked and select the remote-chrome-aichat directory.
- Run
Bash
$ node server.js
WebSocket server listening on ws://192.168.1.32:8089
WebSocket server running on ws://192.168.1.32:8089
Waiting for Chrome Extension (offscreen.js) to connect...
[+] Chrome Extension connected!
You: check bbc news in ai area, show top 5 in table
⏳ Sending to Chrome...
...
Enter your prompt once connected to execute queries through the browser bridge and render formatted responses in your terminal.
