원클릭으로
surf-codebase
// 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.
// 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.
| name | surf-codebase |
| description | 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