How 1129aliasgar/openbrowser works
OpenBrowser is a local CLI agent harness that connects a developer’s project to browser-based AI chat without API keys. The main workflow gathers optional project context, builds an ask or agent prompt, sends it through the local bridge to the browser extension, and returns the AI response to the terminal. Agent responses are parsed and validated before changes are previewed and applied. The README documents the browser bridge and supported providers; some internal extension wiring is not shown in the excerpts, so those links are omitted or marked unverified.
Main entry points: server/index.ts Bridge API · src/index.ts CLI modes · providers.js Provider registry · bridge-client.ts Bridge client
Components 22
CLI workflow
- CLI modes
src/index.ts - Project context
src/context/file-context.ts - System prompts
src/prompts/system.ts - Bridge client
src/client/bridge-client.ts - Terminal output
src/shared/terminal.ts
Local bridge
- Bridge API
src/server/index.ts - Session store
src/server/session-store.ts - SSE hub
src/server/sse-hub.ts
Agent processing
- Agent response parser
src/parser/index.ts - Operation validation
src/protocol/index.ts - Diff and apply
src/operations/index.ts
Browser extension
- Extension background
browser-extension/src/background.js - AI page integration
browser-extension/src/content-script.js - Provider registry
browser-extension/src/providers.js - ChatGPT adapter
browser-extension/src/chatgpt-api.js - Gemini adapter
browser-extension/src/gemini-api.js - DeepSeek adapter
browser-extension/src/deepseek-api.js
Workspace state
- Project files
- Project memory
src/memory/index.ts - Large prompt files
src/memory/index.ts
Other components
- Developer
- Browser AI service
Connections 27
- Developer → CLI modes: runs modes
README.md - CLI modes → Project context: loads context
src/index.ts - CLI modes → System prompts: builds prompt
src/index.ts - CLI modes → Bridge client: submits prompt
src/index.ts - CLI modes → Bridge API: starts bridge
src/index.ts - CLI modes → Terminal output: prints results
src/index.ts - Bridge client → Bridge API: uses local API
README.md - Bridge API → Session store: manages sessions
src/server/index.ts - Bridge API → SSE hub: streams events
src/server/index.ts - Bridge API → Project context: generates context
src/server/index.ts - Bridge API → Diff and apply: executes operations
src/server/index.ts - Bridge API → Project memory: stores prompts
src/server/index.ts - Bridge API → Large prompt files: writes large prompts
src/server/index.ts - Extension background → Bridge API: bridges over local API
README.md - Extension background → AI page integration: coordinates page capture
- AI page integration → Browser AI service: injects and captures
README.md - Provider registry → ChatGPT adapter: selects adapter
- Provider registry → Gemini adapter: selects adapter
- Provider registry → DeepSeek adapter: selects adapter
- Bridge API → Agent response parser: parses agent response
- Agent response parser → Operation validation: validates operations
src/parser/index.ts - Bridge API → Operation validation: validates submissions
src/server/index.ts - Diff and apply → Project files: plans and applies diffs
src/operations/index.ts - Diff and apply → Project memory: appends history
src/operations/index.ts - Project context → Project files: reads project files
src/context/file-context.ts - Project memory → Large prompt files: stores prompt text
src/memory/index.ts - Bridge client → Session store: waits for response
src/client/bridge-client.ts