Turn free browser AI chat into a local coding agent — no API key, no extra AI subscription.
OpenBrowser is a free AI tool and local AI agent harness that connects ChatGPT, Gemini, DeepSeek, Claude, Perplexity, GLM, Grok, and other browser-based AI assistants to your project workspace. Run commands in the terminal — prompts are auto-sent to your AI tab via the browser extension, responses flow back to the terminal automatically. No manual copy-paste. No API keys required — use your existing browser AI subscription (including free plans).
Star the repo on GitHub to support the project and help others discover it.
OpenBrowser is an open-source AI agent for developers who want ChatGPT for free coding, Claude for free coding, or any browser AI plan — without paying for a separate API key or AI subscription. It acts as a CLI harness between your terminal and the AI chat tab you already use in Chrome.
- Free AI tool — works with free browser tiers (ChatGPT, Claude, Gemini, and more)
- No API key — your browser session is the connection; no OpenAI or Anthropic API billing
- AI coding agent — ask questions, edit files with diff preview, attach
@file/@foldercontext - Local-first — bridge runs on
127.0.0.1; you approve every file change
Yes. ChatGPT is widely used for coding help, but the browser UI is not built for editing a whole project. OpenBrowser lets you use ChatGPT for coding from the terminal: send prompts from your repo, get answers in the terminal, and in agent mode apply multi-file changes with diff preview — still using your ChatGPT browser subscription, not an API key.
- Open ChatGPT in Chrome (free or Plus plan).
- Install the OpenBrowser Chrome extension and run
openbrowserin your project folder. - Run
openbrowser ask "..."for Q&A oropenbrowser agent "..."for file edits.
You get a free AI coding workflow as long as your browser plan allows chat — no separate API subscription.
Same flow with Claude: keep a Claude tab open, load the extension, run openbrowser ask or openbrowser agent from your project. OpenBrowser auto-sends prompts and returns responses to the terminal so you can use Claude for free coding (or on your existing Claude subscription) without an Anthropic API key.
No API key is required. OpenBrowser does not call OpenAI, Anthropic, or Google APIs directly — it bridges your existing browser AI subscription. If you already use ChatGPT, Claude, or Gemini in the browser (including free tiers), you can use them as your AI agent for local development.
OpenBrowser is a free, open-source AI tool for developers who prefer browser AI over API billing. It is not a replacement for every feature of paid IDE agents, but it delivers ask mode, agent mode with diffs, and project context — powered by the AI subscription you already have in the browser.
In this project, an AI harness is the local bridge (CLI + extension) that wires browser chat to your workspace: queue prompts, inject them into the AI composer, capture replies, and apply file operations safely on your machine.
| Mode | What it does |
|---|---|
| Ask | Auto-send prompt with system instructions; Markdown response appears in the terminal |
| Agent | Auto-send task + project context + JSON schema instructions; preview diffs, apply or reject |
| Server | Run the bridge API on http://127.0.0.1:5000 for the browser extension |
- Local bridge server (Fastify) on port 5000
- Interactive wake mode — run
openbrowserwith no args for an ask/agent menu @file/@foldercontext attachments with Tab completion- Large prompts auto-delivered as
openbrowser-prompt.txtwhen they exceed the UI paste limit - Zod-validated AI operation schema (
CREATE_FILE,EDIT_FILE, etc.) - Unified diff preview before any file is touched
- Edit history stored in
.openbrowser/history.json - Chrome extension for supported AI sites
- Node.js 20 or later
- pnpm 11.x (install guide)
- Google Chrome (or any Chromium browser) for the extension
# 1. Clone and install
git clone https://github.com/1129Aliasgar/OpenBrowser.git
cd OpenBrowser
pnpm install
# 2. Build the CLI
pnpm build
# 3. Enable the openbrowser command in your terminal
pnpm setup
pnpm link --global
# 4. Copy environment config
cp .env.example .env # Windows: copy .env.example .env
# 5. Load the Chrome extension (see Browser Extension section)
# 6. Open https://chatgpt.com in Chrome and reload the tab
# 7. Open a new PowerShell window, then run
openbrowser ask "How do I add JWT auth in Express?"Before running: An AI chat tab must be open in Chrome with the extension loaded. The extension listens over SSE and auto-injects prompts.
Getting
openbrowser is not recognized?
Runpnpm setup, thenpnpm buildandpnpm link --global, and open a new terminal. Or usepnpm start ask "..."without global install — see CLI Usage.
corepack enable
corepack prepare pnpm@11.0.0 --activateVerify:
node -v # v20+
pnpm -v # 11.xpnpm installcp .env.example .env # Windows: copy .env.example .env| Variable | Default | Description |
|---|---|---|
PORT |
5000 |
Bridge server port |
BRIDGE_TOKEN |
(optional) | Bearer token for /operations and /session/prompt requests |
PROMPT_INJECTION_CHAR_LIMIT |
12000 |
Above this length, prompts are sent as a .txt file attachment |
pnpm buildCompiled output is written to dist/.
The openbrowser command is not installed automatically. PowerShell shows:
openbrowser: The term 'openbrowser' is not recognized ...
That is expected until you complete the setup below.
One-time pnpm PATH setup (required on Windows):
pnpm setupClose and reopen PowerShell after this command. It adds %LOCALAPPDATA%\pnpm to your PATH.
Register the CLI (run from the project root after every fresh clone):
pnpm build
pnpm link --globalVerify in a new terminal:
openbrowser --helpFrom the project root:
# Compiled CLI (requires pnpm build first)
pnpm start ask "Explain this repo structure"
pnpm start agent "Add input validation"
pnpm start server
# Dev mode with auto-reload (no build needed)
pnpm dev
pnpm exec tsx src/index.ts ask "Explain this repo structure"pnpm devStarts the CLI in watch mode. With no arguments, you get an interactive menu:
Select mode:
1. ask
2. agent
q. exit
mode>
Use @path/to/file in the prompt area for context attachments. Tab completes paths after @.
openbrowser # Interactive mode (ask / agent menu)
openbrowser ask "<prompt>" # Ask mode — Q&A in terminal
openbrowser agent "<task>" # Agent mode — file ops with diff preview
openbrowser server # Run bridge server only (no CLI workflow)
openbrowser --help # Show all commands
openbrowser --version # Show versionopenbrowser ask "How do I implement rate limiting in Fastify?"- Bridge server starts on port 5000.
- CLI queues the prompt with a system instruction (Markdown answer expected).
- Chrome extension receives the job instantly via SSE, injects the message into the AI composer, and clicks Send.
- When the AI finishes replying, the extension captures the text and posts it to the bridge.
- CLI receives the response over SSE and prints it in the terminal.
openbrowser agent "Add a health check endpoint to the server"- Project context is generated from the current directory.
- CLI queues task + context + JSON schema system instructions.
- Extension auto-sends to the AI tab and waits for a JSON response with
conversationId. - CLI validates the JSON, shows unified diffs for each proposed change.
- Confirm with
yto apply, orNto reject.
All applied changes are logged under .openbrowser/history.json.
When a prompt (including system instructions and @ context) exceeds 12,000 characters by default, OpenBrowser saves the full text to .openbrowser/prompts/<session>.txt and the extension uploads it as openbrowser-prompt.txt instead of pasting into the composer. A short note is sent in the text field telling the AI to read the attachment.
Override the limit with PROMPT_INJECTION_CHAR_LIMIT in .env.
The bridge server is the local API that connects the CLI, browser extension, and file operations.
Dedicated server command (keeps running until you stop it):
openbrowser serverDev watch mode (auto-restarts on file changes):
pnpm dev:serverEmbedded server — openbrowser ask and openbrowser agent start the server automatically and shut it down when the command finishes.
http://127.0.0.1:5000
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check (used by the extension popup) |
GET |
/summary |
Project context summary |
POST |
/session/prompt |
CLI submits prompt job with system instructions |
GET |
/session/:id/events |
CLI SSE stream for completed response |
GET |
/session/:id/status |
Poll session status |
GET |
/browser/events |
Extension SSE stream for new prompt jobs |
POST |
/browser/claim |
Extension claims a job before processing |
GET |
/browser/prompt-file/:id |
Extension downloads prompt .txt for attachment |
POST |
/browser/chunk |
Extension streams partial ask-mode responses |
POST |
/browser/response |
Extension posts AI reply back to bridge |
POST |
/operations/preview |
Preview diffs for operations |
POST |
/operations/apply |
Apply validated operations |
curl http://127.0.0.1:5000/healthExpected response:
{ "status": "ok" }Or open http://127.0.0.1:5000/health in your browser.
The extension watches supported AI chat pages, injects prompts, captures responses, and forwards them to the local bridge server.
| Provider | URL |
|---|---|
| ChatGPT | chatgpt.com |
| Gemini | gemini.google.com |
| DeepSeek | chat.deepseek.com |
| Claude | claude.ai |
| Perplexity | perplexity.ai |
| GLM | chat.z.ai |
| Grok | grok.com |
-
Start the bridge server (extension needs port 5000):
openbrowser server
-
Open Chrome extensions page:
chrome://extensions -
Enable Developer mode (toggle in the top-right corner).
-
Click "Load unpacked".
-
Select the
browser-extensionfolder inside this repo (the folder that containsmanifest.json). -
Pin the extension — click the puzzle icon in the Chrome toolbar → pin OpenBrowser Bridge.
-
Verify connection — click the extension icon. The popup should show:
Bridge server is running on port 5000.If it says "Bridge server is not reachable", make sure
openbrowser serveris running.
- You run
openbrowser askoropenbrowser agentin your project directory. - The CLI submits a prompt job to
POST /session/prompton the bridge server. - The bridge pushes the job instantly over SSE to
GET /browser/events. - The content script claims the job, injects the message (or attaches
openbrowser-prompt.txtfor long prompts), and clicks Send. - When the AI reply is complete, the extension posts it to
POST /browser/response. - The CLI receives the result over
GET /session/:id/eventsand prints it in the terminal.
Important: Keep an AI chat tab open and reload it after updating the extension.
Agent mode expects JSON like this:
{
"operations": [
{
"action": "CREATE_FILE",
"path": "src/example.ts",
"content": "export const hello = 'world';\n"
}
],
"conversationId": "550e8400-e29b-41d4-a716-446655440000"
}Supported actions: CREATE_FILE, EDIT_FILE, DELETE_FILE, RENAME_FILE, CREATE_FOLDER.
Paths must be relative to the project root. Directory traversal (../) is rejected.
pnpm dev # CLI in watch mode (tsx)
pnpm dev:server # Bridge server in watch mode
pnpm build # Compile TypeScript → dist/
pnpm typecheck # Type-check without emitting
pnpm test # Run Vitest unit tests
pnpm test:watch # Vitest in watch modeOpenBrowser/
├── src/
│ ├── assest/ # Logo, banner, favicon
│ ├── index.ts # CLI entry point
│ ├── server/ # Bridge server (Fastify + SSE)
│ ├── context/ # Project context & @ attachments
│ ├── protocol/ # Zod schemas & validation
│ ├── parser/ # AI response parsing
│ ├── operations/ # Diff preview & file executor
│ ├── memory/ # .openbrowser storage
│ └── shared/ # Terminal UI, prompt delivery
├── browser-extension/ # Chrome MV3 extension
├── dist/ # Compiled output (after pnpm build)
├── .env.example
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── SECURITY.md
├── LICENSE
├── package.json
└── pid.md # Full product specification
| Cause | Fix |
|---|---|
| pnpm global bin not in PATH | Run pnpm setup, restart PowerShell |
| Project not built | Run pnpm build |
| CLI not linked globally | Run pnpm link --global, then open a new terminal |
| Want to skip global install | Use pnpm start ask "..." or pnpm dev |
- Open a supported AI site in Chrome (not Edge/Firefox alone).
- Reload the AI tab after installing the extension.
- Reload the extension on
chrome://extensions. - Confirm the popup shows "Bridge running" and at least one AI tab ready.
- Run
openbrowserfrom the project root — ask/agent start their own bridge server automatically.
- Confirm the server is running (started automatically by
openbrowser ask/openbrowser agent). - Check port 5000 is free:
curl http://127.0.0.1:5000/health - Reload the extension on
chrome://extensions - Leave
BRIDGE_TOKENunset for local dev (extension does not send auth headers)
- Confirm the provider supports file upload (ChatGPT, Claude, Gemini, DeepSeek).
- Check
.openbrowser/prompts/for the saved session file. - Lower
PROMPT_INJECTION_CHAR_LIMITto test, or shorten@context attachments.
- Response must be valid JSON with
operationsandconversationId(UUID v4). - No markdown code fences unless the JSON is inside them.
- Every
pathmust stay inside the project root.
- You must confirm with
yafter reviewing diffs. - Check
.openbrowser/history.jsonfor the operation log. - Run agent mode from the project root you want to modify.
Terminal (CLI) ──POST /session/prompt──► Bridge :5000
▲ │
│ SSE /session/:id/events │ SSE /browser/events
│ ▼
└────── POST /browser/response ◄── Chrome Extension
│
▼
AI chat tab (ChatGPT, Gemini, Claude, …)
- CLI — submits prompts with system instructions, waits for responses
- Bridge Server — session queue, job dispatch, prompt file storage, response delivery
- Browser Extension — SSE job delivery, composer injection / file attach, response capture
- Context Engine — reads workspace and builds agent prompts
- Operation Executor — applies approved file changes
For the full product specification, see pid.md.
OpenBrowser is open source and welcomes contributions.
- Read CONTRIBUTING.md for setup and PR guidelines.
- Follow the Code of Conduct.
- Report security issues privately — see SECURITY.md.
Quick start for contributors:
git clone https://github.com/1129Aliasgar/OpenBrowser.git
cd OpenBrowser
pnpm install && pnpm build && pnpm testFork the repo, create a branch, and open a pull request on GitHub.
MIT © 1129Aliasgar. See LICENSE.
