@volh/pi-network-monitor
v0.1.0
Published
Network request monitor for pi agent — live overlay showing all HTTP traffic
Readme
pi-network-monitor
Network request monitor for pi coding agent.
Shows every HTTP request that pi and its extensions make — LLM API calls, web searches, content fetches, auth flows — in a live overlay. Useful for understanding what's happening on the network, debugging slow requests, and seeing the full request chain behind tools like pi-web-access.
How it works
Uses Node.js diagnostics_channel to subscribe to undici's request lifecycle events. Since pi and all extensions run in the same Node.js process and use the global fetch(), this captures everything with zero monkey-patching.
Install
pi install npm:@volh/pi-network-monitorOr from git:
pi install https://github.com/volh/pi-network-monitorRequires pi v0.37.3+. No dependencies.
Usage
Open with Alt+N or /network.
List view
Each line shows method, status code (color-coded), host + path, and duration.
| Key | Action |
|-----|--------|
| ↑/↓ or j/k | Scroll |
| PgUp/PgDn | Jump 10 entries |
| Home/End | Jump to top/bottom |
| Enter or d | Detail view |
| f | Host filter |
| c | Clear history |
| Esc | Close |
Detail view
Full URL (wrapped), HTTP status, TTFB, total duration, timestamps with millisecond precision.
Host filter
Press f, start typing to search (e.g. ant → api.anthropic.com). Matching substring highlighted. Hosts sorted by request count. Enter to apply, Esc to cancel.
Configuration
~/.pi/network-monitor.json:
{
"shortcut": "alt+n",
"anchor": "center",
"width": "60%",
"maxHeight": "80%"
}| Key | Default | Description |
|-----|---------|-------------|
| shortcut | alt+n | Keyboard shortcut |
| anchor | center | Overlay position (center, right-center, top-right, etc.) |
| width | 60% | Overlay width (percentage or columns) |
| maxHeight | 80% | Maximum height |
What gets captured
Every fetch() call in the pi process — LLM API calls (any provider), search APIs, content fetches, auth flows, extension traffic. Per request: method, full URL, status code, TTFB, total duration, errors. Stores last 500 requests in memory, not persisted.
License
MIT
