localpov 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +46 -124
  2. package/bin/localpov.js +23 -48
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,45 +1,41 @@
1
1
  # LocalPOV
2
2
 
3
- Development context bridge for AI coding agents. Terminal output, browser console, network failures, Docker logs, build errors — one MCP server.
3
+ [![npm version](https://img.shields.io/npm/v/localpov)](https://www.npmjs.com/package/localpov)
4
+ [![npm downloads](https://img.shields.io/npm/dw/localpov)](https://www.npmjs.com/package/localpov)
5
+ [![license](https://img.shields.io/npm/l/localpov)](https://github.com/localpov/localpov/blob/main/LICENSE)
6
+ [![Node.js 18+](https://img.shields.io/badge/Node.js-18%2B-brightgreen)](https://nodejs.org)
4
7
 
5
- ```
6
- npx -y localpov --mcp
7
- ```
8
-
9
- Your AI agent (Claude Code, Cursor, Windsurf, Claude Desktop) can now see everything happening in your dev environment — terminal errors, browser console output, failed network requests, build failures, Docker logs — without you copy-pasting anything.
10
-
11
- ## Why
8
+ Development context bridge for AI coding agents. One MCP server, 14 tools.
12
9
 
13
- AI coding agents are blind. They can read and write files, but they can't see:
14
-
15
- - What your terminal just printed
16
- - That the browser console is full of CORS errors
17
- - That `fetch('/api/users')` is returning 500
18
- - That the Docker container crashed 30 seconds ago
19
- - That TypeScript found 12 errors on build
10
+ - **Terminal capture** every shell session, auto-captured
11
+ - **Browser console** — errors, warnings, unhandled exceptions
12
+ - **Network failures** 4xx/5xx responses, CORS errors, slow requests
13
+ - **Build errors** structured `{file, line, col, message}` from TS, ESLint, Webpack, Vite, Rust, Go
14
+ - **Docker logs** container output without leaving your editor
15
+ - **Screenshots** on-demand browser viewport capture
16
+ - **Port scanning** what's up, what's down
17
+ - **System health** — memory, CPU, uptime
20
18
 
21
- You end up copy-pasting error messages into chat. LocalPOV fixes this the agent reads your dev environment directly.
19
+ Your AI agent sees everything happening in your dev environmentwithout you copy-pasting anything.
22
20
 
23
21
  ## Quick start
24
22
 
25
- ```bash
26
- # Install globally (optional — npx works without installing)
27
- npm i -g localpov
28
-
29
- # Interactive setup (shell integration + MCP config)
30
- localpov setup
23
+ ### Claude Code
31
24
 
32
- # Or just start the MCP server directly
33
- npx -y localpov --mcp
25
+ ```bash
26
+ claude mcp add localpov -- npx -y localpov --mcp
34
27
  ```
35
28
 
36
- ## Setup for your AI client
29
+ That's it. One command. Restart Claude Code and all 14 tools are available.
37
30
 
38
- LocalPOV works with every major AI coding tool. Pick yours:
31
+ Shell integration is installed automatically on first run restart your terminal to start capturing.
39
32
 
40
- ### Claude Code
33
+ ### Claude Desktop
41
34
 
42
- Add to `.mcp.json` in your project root:
35
+ Add to `claude_desktop_config.json`:
36
+
37
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
38
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
43
39
 
44
40
  ```json
45
41
  {
@@ -52,14 +48,9 @@ Add to `.mcp.json` in your project root:
52
48
  }
53
49
  ```
54
50
 
55
- Or run `localpov mcp-config` to generate this automatically.
56
-
57
- ### Claude Desktop
58
-
59
- Add to your `claude_desktop_config.json`:
51
+ ### Cursor
60
52
 
61
- - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
62
- - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
53
+ Add to `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json` for global):
63
54
 
64
55
  ```json
65
56
  {
@@ -72,13 +63,13 @@ Add to your `claude_desktop_config.json`:
72
63
  }
73
64
  ```
74
65
 
75
- ### Cursor
66
+ ### VS Code / Copilot
76
67
 
77
- Add to `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json` for global):
68
+ Add to `.vscode/mcp.json` in your project root:
78
69
 
79
70
  ```json
80
71
  {
81
- "mcpServers": {
72
+ "servers": {
82
73
  "localpov": {
83
74
  "command": "npx",
84
75
  "args": ["-y", "localpov", "--mcp"]
@@ -109,7 +100,7 @@ Or configure via Windsurf UI: Cascade panel → MCPs icon → Add server.
109
100
 
110
101
  ### Any other MCP client
111
102
 
112
- LocalPOV uses **stdio transport** — the universal standard. Any MCP client that supports stdio works with:
103
+ LocalPOV uses **stdio transport**. Any MCP client that supports stdio works with:
113
104
 
114
105
  ```json
115
106
  {
@@ -118,20 +109,17 @@ LocalPOV uses **stdio transport** — the universal standard. Any MCP client tha
118
109
  }
119
110
  ```
120
111
 
121
- ### Local development (from source)
112
+ ## Why
122
113
 
123
- If you've cloned the repo:
114
+ AI coding agents are blind. They can read and write files, but they can't see:
124
115
 
125
- ```json
126
- {
127
- "mcpServers": {
128
- "localpov": {
129
- "command": "node",
130
- "args": ["bin/localpov-mcp.js"]
131
- }
132
- }
133
- }
134
- ```
116
+ - What your terminal just printed
117
+ - That the browser console is full of CORS errors
118
+ - That `fetch('/api/users')` is returning 500
119
+ - That the Docker container crashed 30 seconds ago
120
+ - That TypeScript found 12 errors on build
121
+
122
+ You end up copy-pasting error messages into chat. LocalPOV fixes this — the agent reads your dev environment directly.
135
123
 
136
124
  ## What the AI agent sees
137
125
 
@@ -158,50 +146,22 @@ If you've cloned the repo:
158
146
 
159
147
  ### Terminal capture
160
148
 
161
- Shell integration hooks into your shell startup (`bash`, `zsh`, `fish`, `powershell`). Every terminal session's output is captured to `~/.localpov/sessions/` as plain text logs.
149
+ Shell integration hooks into your shell startup (`bash`, `zsh`, `fish`, `powershell`). Every terminal session's output is captured to `~/.localpov/sessions/` as plain text logs. The AI agent reads these via `read_terminal` or `get_errors`.
162
150
 
163
- ```bash
164
- # Install shell integration
165
- localpov setup
166
-
167
- # List captured sessions
168
- localpov sessions
151
+ This is installed automatically when you run `npx -y localpov` for the first time.
169
152
 
170
- # Read a session
171
- localpov sessions read <pid> [lines]
153
+ ### Browser capture (optional)
172
154
 
173
- # Find errors across all sessions
174
- localpov sessions errors
155
+ Start the proxy to capture browser console and network activity:
175
156
 
176
- # Remove shell integration
177
- localpov unsetup
157
+ ```bash
158
+ npx -y localpov --port 3000
178
159
  ```
179
160
 
180
- The agent calls `read_terminal` or `get_errors` — it reads these logs directly. No copy-pasting needed.
181
-
182
- ### Browser capture
183
-
184
- When the LocalPOV proxy is running, it injects a lightweight capture script into HTML responses. This gives the agent access to:
185
-
186
- - **Console output** — `console.error`, `console.warn`, unhandled exceptions, promise rejections
187
- - **Network requests** — failed fetches (4xx/5xx) with response bodies, slow requests, CORS errors
188
- - **Screenshots** — on-demand viewport capture
161
+ Then open `http://localhost:4000` instead of `http://localhost:3000` — your app works exactly the same, but the agent can now see console errors, network failures, and take screenshots.
189
162
 
190
163
  No browser extension needed. Works in any browser.
191
164
 
192
- ```bash
193
- # Start the proxy (auto-detects running dev servers)
194
- localpov
195
-
196
- # Or target a specific port
197
- localpov --port 3000
198
-
199
- # Change proxy listen port (default: 4000)
200
- localpov --listen 8080
201
- ```
202
-
203
- Then open `http://localhost:4000` instead of `http://localhost:3000` — your app works exactly the same, but the agent can now see console and network activity.
204
-
205
165
  ### Dashboard
206
166
 
207
167
  Open `http://localhost:4000/__localpov__/` to see a visual debug panel:
@@ -244,26 +204,6 @@ Create `.localpovrc` in your project root:
244
204
  }
245
205
  ```
246
206
 
247
- CLI flags override config file values.
248
-
249
- ## CLI reference
250
-
251
- ```bash
252
- localpov # Start proxy (auto-detect dev servers)
253
- localpov --port 3000 # Proxy a specific port
254
- localpov --listen 8080 # Change proxy listen port
255
- localpov --mcp # Start MCP server (stdio transport)
256
- localpov setup # Interactive first-run setup
257
- localpov setup --shell # Install shell integration only
258
- localpov unsetup # Remove shell integration
259
- localpov mcp-config # Print MCP config JSON
260
- localpov mcp-config cursor # Print config for Cursor
261
- localpov sessions # List captured terminal sessions
262
- localpov sessions read PID # Read a session's output
263
- localpov sessions errors # Find errors across sessions
264
- localpov doctor # Check your setup
265
- ```
266
-
267
207
  ## Supported shells
268
208
 
269
209
  | Shell | Capture method | Platforms |
@@ -273,24 +213,6 @@ localpov doctor # Check your setup
273
213
  | fish | `script` command + fish_preexec/fish_postexec | Linux, macOS |
274
214
  | PowerShell | `Start-Transcript` + prompt function flush | Windows, Linux, macOS |
275
215
 
276
- ## Supported frameworks
277
-
278
- Any HTTP dev server works. Framework detection is cosmetic (shown in dashboard):
279
-
280
- Next.js, Vite, Express, Angular, SvelteKit, Nuxt, Astro, Django, Flask, FastAPI, and anything else on a localhost port.
281
-
282
- ## Default scanned ports
283
-
284
- `3000, 3001, 3002, 4200, 5173, 5174, 5175, 8000, 8080, 8888, 8081, 4321`
285
-
286
- Customize via `.localpovrc`:
287
-
288
- ```json
289
- {
290
- "ports": [3000, 3001, 4000, 5173, 8080, 9000]
291
- }
292
- ```
293
-
294
216
  ## Safety
295
217
 
296
218
  - **Output capped at 50KB** per MCP response — prevents flooding the AI context
package/bin/localpov.js CHANGED
@@ -395,36 +395,24 @@ async function firstRunSetup() {
395
395
 
396
396
  console.log('');
397
397
  console.log(` ${c.b('Welcome to LocalPOV')} ${c.d(`v${pkg.version}`)}`);
398
- console.log(` ${c.d('First-time setup — takes 30 seconds')}`);
399
398
  console.log('');
400
399
 
401
- // ─── Step 1: Shell integration ───
400
+ // ─── Step 1: Shell integration (auto) ───
402
401
  const shell = detectShell();
403
- console.log(` ${c.b('1.')} Shell integration ${c.d('(auto-capture all terminals for AI agents)')}`);
404
- console.log(` Detected: ${c.c(shell)}`);
405
-
406
- const shellAnswer = await ask(` Add auto-capture to ${shell} profile? [Y/n] `);
407
- if (shellAnswer !== 'n' && shellAnswer !== 'no') {
408
- const result = setup(shell);
409
- if (result.success) {
410
- if (result.already) {
411
- console.log(` ${c.g('✓')} Already installed`);
412
- } else {
413
- console.log(` ${c.g('✓')} Added to ${c.d(result.profilePath)}`);
414
- console.log(` ${c.d('New terminals will be auto-captured after restart')}`);
415
- }
402
+ const result = setup(shell);
403
+ if (result.success) {
404
+ if (result.already) {
405
+ console.log(` ${c.g('✓')} Shell integration already installed ${c.d(`(${shell})`)}`);
416
406
  } else {
417
- console.log(` ${c.y('')} ${result.error}`);
418
- console.log(` ${c.d('You can run `localpov setup` later to retry')}`);
407
+ console.log(` ${c.g('')} Shell integration installed ${c.d(`(${shell} → ${result.profilePath})`)}`);
408
+ console.log(` ${c.d(' Restart your terminal to start capturing sessions')}`);
419
409
  }
420
410
  } else {
421
- console.log(` ${c.d('Skipped. Run `localpov setup` anytime to enable.')}`);
411
+ console.log(` ${c.y('⚠')} Shell integration: ${result.error}`);
412
+ console.log(` ${c.d(' Run `localpov setup` to retry')}`);
422
413
  }
423
- console.log('');
424
-
425
- // ─── Step 2: MCP config for AI agents ───
426
- console.log(` ${c.b('2.')} AI agent integration ${c.d('(MCP server for Claude Code, Cursor, etc.)')}`);
427
414
 
415
+ // ─── Step 2: MCP config (auto) ───
428
416
  const mcpPath = require('path').join(process.cwd(), '.mcp.json');
429
417
  let mcpExists = false;
430
418
  try {
@@ -433,36 +421,23 @@ async function firstRunSetup() {
433
421
  } catch {}
434
422
 
435
423
  if (mcpExists) {
436
- console.log(` ${c.g('✓')} Already configured in ${c.d('.mcp.json')}`);
424
+ console.log(` ${c.g('✓')} MCP config already in ${c.d('.mcp.json')}`);
437
425
  } else {
438
- const mcpAnswer = await ask(` Create .mcp.json in this project? [Y/n] `);
439
- if (mcpAnswer !== 'n' && mcpAnswer !== 'no') {
440
- const mcpConfig = {
441
- mcpServers: {
442
- localpov: {
443
- command: 'npx',
444
- args: ['-y', 'localpov', '--mcp'],
445
- },
446
- },
447
- };
448
- try {
449
- const existing = JSON.parse(fs.readFileSync(mcpPath, 'utf8'));
450
- existing.mcpServers = existing.mcpServers || {};
451
- existing.mcpServers.localpov = mcpConfig.mcpServers.localpov;
452
- fs.writeFileSync(mcpPath, JSON.stringify(existing, null, 2) + '\n', 'utf8');
453
- } catch {
454
- fs.writeFileSync(mcpPath, JSON.stringify(mcpConfig, null, 2) + '\n', 'utf8');
455
- }
456
- console.log(` ${c.g('✓')} Created ${c.d('.mcp.json')}`);
457
- console.log(` ${c.d('Restart your AI agent to activate the MCP server')}`);
458
- } else {
459
- console.log(` ${c.d('Skipped. Run `localpov mcp-config` to see the config.')}`);
460
- }
426
+ console.log(` ${c.b('Add to .mcp.json in your project root:')}`);
427
+ console.log('');
428
+ console.log(` ${c.c('{')}`)
429
+ console.log(` ${c.c(' "mcpServers": {')}`);
430
+ console.log(` ${c.c(' "localpov": {')}`);
431
+ console.log(` ${c.c(' "command": "npx",')}`);
432
+ console.log(` ${c.c(' "args": ["-y", "localpov", "--mcp"]')}`);
433
+ console.log(` ${c.c(' }')}`);
434
+ console.log(` ${c.c(' }')}`);
435
+ console.log(` ${c.c('}')}`);
461
436
  }
462
- console.log('');
463
437
 
438
+ console.log('');
464
439
  markSetupDone();
465
- console.log(` ${c.g('✓')} Setup complete. Starting LocalPOV...\n`);
440
+ console.log(` ${c.g('✓')} Ready. Starting LocalPOV...\n`);
466
441
  }
467
442
 
468
443
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "localpov",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Development context bridge for AI coding agents. Terminal capture, browser console, network logs, screenshots, Docker logs — one MCP server.",
5
5
  "bin": {
6
6
  "localpov": "bin/localpov.js",