Navigate and modify surf-cli codebase - Chrome extension + native host for AI browser automation. Use for surf-cli code work, architecture questions, implementing browser control/CDP/accessibility/network features.
cli.cjs --socket:/tmp/surf.sock--> host.cjs --native-msg--> service-worker/index.ts --CDP/chrome-APIs--> browser
TOOLS in native/cli.cjs:158 (args, opts, examples)handleMessage() switchCDPController class src/cdp/controller.ts:60this.send(tabId, "Domain.method", params)handleCDPEvent() if neededsrc/service-worker/index.ts (~2500L) - Central msg router, CDP ops, screenshot cache, tab registry
src/cdp/controller.ts (~1000L) - CDP wrapper, CDPController class
src/content/accessibility-tree.ts (~1900L) - Content script, generates a11y tree YAML, element interactions
native/cli.cjs (~2100L) - CLI parser, socket client
native/host.cjs (~2100L) - Socket server, AI integration
src/native/port-manager.ts - Extension↔native messaging, auto-reconnect, request/response tracking
surf click e5--json flagnpm run build # Build ext
npm test # Run tests
npm run test:coverage # Coverage
A11y tree assigns e1, e2... during READ_PAGE. Stored window.__piRefs. Reset each read command.
npm run dev # Watch mode
npm run build # Prod → dist/
# Load dist/ as unpacked ext
surf install <ext-id> # Register native host
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer