Skip to content

Conversation

@chadrwalters
Copy link

Summary

Adds Chrome DevTools-like functionality to the browser CLI, making agent-browse a more complete replacement for Chrome DevTools MCP while maintaining the natural language interaction benefits.

New Commands

Command Description
browser network [filter] List captured network requests with optional filtering
browser network-get <id> Get full request details including response body
browser console [filter] List console messages with optional filtering
browser eval "<js>" Evaluate JavaScript in page context
browser clear Clear captured network/console data

Implementation Details

  • Persistence: Network and console data persists across CLI invocations via JSON files (.devtools-network.json, .devtools-console.json)
  • Automatic capture: Starts when browser initializes via Network.enable and Runtime.enable
  • Filtering: Supports URL, method, type for network; text, type for console
  • Output limits: Results capped to prevent context bloat (50 network requests, 100 console messages)

Example Usage

# Navigate and capture network
browser navigate https://example.com

# Check what loaded
browser network

# Filter to just API calls
browser network api

# Check for errors
browser console error

# Evaluate JS in page
browser eval "document.title"

# Clean up captured data
browser clear

Why This Matters

This addresses a gap where agent-browse excels at natural language browser interaction but lacks debugging capabilities. Users previously needed Chrome DevTools MCP for network/console inspection, which is significantly more context-heavy (~30k tokens per snapshot vs ~100 tokens for these commands).

Test Plan

  • browser network lists captured requests
  • browser network <filter> filters by URL/method/type
  • browser console lists captured messages
  • browser console <filter> filters by type/text
  • browser eval evaluates JS and returns result
  • browser clear clears persisted data
  • Data persists across CLI invocations
  • TypeScript compiles without errors

🤖 Generated with Claude Code

chadrwalters and others added 2 commits November 26, 2025 08:39
Add Chrome DevTools-like functionality to the browser CLI:

- `browser network [filter]` - List captured network requests with optional filtering
- `browser network-get <id>` - Get full request details including response body
- `browser console [filter]` - List console messages with optional filtering
- `browser eval "<js>"` - Evaluate JavaScript in page context
- `browser clear` - Clear captured network/console data

Implementation details:
- Network and console data persists across CLI invocations via JSON files
- Automatic capture starts when browser initializes (Network.enable, Runtime.enable)
- Filtering supports URL, method, type for network; text, type for console
- Results limited to prevent context bloat (50 network, 100 console)

This makes agent-browse a viable replacement for Chrome DevTools MCP
while maintaining the natural language interaction benefits.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Prevents stale CDP client reference after browser close which could
cause errors if DevTools commands are used after close/reopen cycle.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant