Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,43 @@ stagehand tab_switch <index> # Switch to tab by index
stagehand tab_close [index] # Close tab by index (defaults to last tab)
```

### Network Capture

Capture HTTP requests to the filesystem for inspection with standard file tools:

```bash
stagehand network on # Enable capture, returns directory path
stagehand network off # Disable capture
stagehand network path # Get capture directory path
stagehand network clear # Clear all captured requests
```

Captured requests are saved as directories with separate files:

```
/tmp/stagehand-default-network/
001-GET-api.github.com-repos/
request.json # method, url, headers, body
response.json # status, headers, body, duration
002-POST-api.example.com-login/
request.json
response.json
```

**Agent workflow:**
```bash
stagehand network on
# {"enabled": true, "path": "/tmp/stagehand-default-network"}

stagehand open https://api.github.com
# ... interact with page ...

# Agent uses filesystem tools to inspect traffic:
# - list_dir /tmp/stagehand-default-network/
# - read_file .../001-GET-api.github.com-repos/response.json
# - grep "auth" /tmp/stagehand-default-network/
```

### Viewport & Misc

```bash
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Based on comparison with [agent-browser](https://github.com/vercel-labs/agent-br

## Network

- [x] **network on/off** - Enable/disable network capture to filesystem
- [x] **network path** - Get capture directory path for agent filesystem access
- [x] **network clear** - Clear captured requests
- [ ] **headers** - Set extra HTTP headers for all requests

## Not Planned (for now)
Expand Down
Loading
Loading