procsi 0.4.0 → 0.4.1

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.
package/README.md CHANGED
@@ -56,17 +56,7 @@ Separate daemon, database, certificates etc. You can run procsi in multiple proj
56
56
 
57
57
  ## MCP Integration
58
58
 
59
- procsi has a built-in [MCP](https://modelcontextprotocol.io/) server that gives AI agents full access to your captured traffic and interceptor system. Agents can search through requests, inspect headers and bodies, and write interceptor files directly into `.procsi/interceptors/`.
60
-
61
- This means you can ask things like:
62
-
63
- - "Find all failing requests to the payments API and write mocks that return valid responses"
64
- - "Make every 5th request to /api/users return a 429 so I can test rate limiting"
65
- - "What's the average response time for requests to the auth service in the last hour?"
66
- - "Write an interceptor that logs all requests with missing auth headers"
67
- - "Send me a notification whenever an api request fails"
68
-
69
- The agent reads your traffic, writes the TypeScript, and procsi hot-reloads it.
59
+ procsi has a built-in [MCP](https://modelcontextprotocol.io/) server that gives AI agents full access to your captured traffic and interceptor system.
70
60
 
71
61
  ### Setup
72
62
 
@@ -85,23 +75,6 @@ Add procsi to your MCP client config:
85
75
 
86
76
  The proxy must be running (`eval "$(procsi on)"`) — the MCP server connects to the same daemon as the TUI.
87
77
 
88
- ### Agent Skill
89
-
90
- procsi also ships an agent skill that teaches AI assistants how to use the MCP tools properly. Gets you better results out of the box.
91
-
92
- **Claude Code:**
93
-
94
- ```bash
95
- /plugin marketplace add mtford90/procsi
96
- /plugin install procsi
97
- ```
98
-
99
- **npm-agentskills** (works with Cursor, Copilot, Codex, etc.):
100
-
101
- ```bash
102
- npx agents export --target claude
103
- ```
104
-
105
78
  ### Available Tools
106
79
 
107
80
  | Tool | Description |
@@ -117,64 +90,12 @@ npx agents export --target claude
117
90
  | `procsi_list_interceptors` | List loaded interceptors with status and errors |
118
91
  | `procsi_reload_interceptors` | Reload interceptors from disk |
119
92
 
120
- ### Filtering
121
-
122
- Most tools accept these filters:
123
-
124
- | Parameter | Description | Example |
125
- | ------------------ | ------------------------------------------- | ------------------------------------- |
126
- | `method` | HTTP method(s), comma-separated | `"GET,POST"` |
127
- | `status_range` | Status code, Nxx pattern, or range | `"4xx"`, `"401"`, `"500-503"` |
128
- | `search` | Substring match on URL/path | `"api/users"` |
129
- | `host` | Exact or suffix match (prefix with `.`) | `"api.example.com"`, `".example.com"` |
130
- | `path` | Path prefix match | `"/api/v2"` |
131
- | `since` / `before` | Time window (ISO 8601) | `"2024-01-15T10:30:00Z"` |
132
- | `header_name` | Filter by header existence or value | `"content-type"` |
133
- | `header_value` | Exact header value (requires `header_name`) | `"application/json"` |
134
- | `header_target` | Which headers to search | `"request"`, `"response"`, `"both"` |
135
- | `source` | Filter by request source | `"node"`, `"python"` |
136
- | `intercepted_by` | Filter by interceptor name | `"mock-users"` |
137
- | `offset` | Pagination offset (0-based) | `0` |
138
- | `limit` | Max results (default 50, max 500) | `100` |
139
-
140
- `procsi_get_request` accepts comma-separated IDs for batch fetching (e.g. `"id1,id2,id3"`).
141
-
142
- `procsi_query_json` also takes:
143
-
144
- | Parameter | Description | Example |
145
- | --------- | --------------------------------------------------------------------- | ------------ |
146
- | `target` | Which body to query: `"request"`, `"response"`, or `"both"` (default) | `"response"` |
147
- | `value` | Exact value match after JSONPath extraction | `"active"` |
148
-
149
- ### Output Formats
150
-
151
- All query tools accept a `format` parameter:
152
-
153
- - `text` (default) — markdown summaries, readable by humans and AI
154
- - `json` — structured JSON for programmatic use
155
-
156
- ### Examples
157
-
158
- ```
159
- procsi_list_requests({ status_range: "5xx", path: "/api" })
160
- procsi_search_bodies({ query: "error_code", method: "POST" })
161
- procsi_query_json({ json_path: "$.user.id", target: "response" })
162
- procsi_list_requests({ header_name: "authorization", header_target: "request" })
163
- ```
93
+ See [full MCP documentation](docs/mcp.md) for filtering, output formats, and examples.
164
94
 
165
95
  ## Interceptors
166
96
 
167
97
  TypeScript files in `.procsi/interceptors/` that intercept HTTP traffic as it passes through the proxy. They can return mock responses, modify upstream responses, or just observe.
168
98
 
169
- ```bash
170
- procsi interceptors init # scaffold an example
171
- procsi interceptors reload # reload after editing
172
- ```
173
-
174
- ### Mock
175
-
176
- Return a response without hitting upstream:
177
-
178
99
  ```typescript
179
100
  import type { Interceptor } from "procsi/interceptors";
180
101
 
@@ -189,102 +110,7 @@ export default {
189
110
  } satisfies Interceptor;
190
111
  ```
191
112
 
192
- ### Modify
193
-
194
- Forward to upstream, then alter the response:
195
-
196
- ```typescript
197
- import type { Interceptor } from "procsi/interceptors";
198
-
199
- export default {
200
- name: "inject-header",
201
- match: (req) => req.host.includes("example.com"),
202
- handler: async (ctx) => {
203
- const response = await ctx.forward();
204
- return { ...response, headers: { ...response.headers, "x-debug": "procsi" } };
205
- },
206
- } satisfies Interceptor;
207
- ```
208
-
209
- ### Observe
210
-
211
- Log traffic without altering it:
212
-
213
- ```typescript
214
- import type { Interceptor } from "procsi/interceptors";
215
-
216
- export default {
217
- name: "log-api",
218
- match: (req) => req.path.startsWith("/api/"),
219
- handler: async (ctx) => {
220
- ctx.log(`${ctx.request.method} ${ctx.request.url}`);
221
- const response = await ctx.forward();
222
- ctx.log(` -> ${response.status}`);
223
- return response;
224
- },
225
- } satisfies Interceptor;
226
- ```
227
-
228
- ### Query Past Traffic
229
-
230
- Interceptors can query the traffic database via `ctx.procsi`. This lets you build mocks that react to what's already happened — rate limiting, conditional failures, responses based on prior requests:
231
-
232
- ```typescript
233
- import type { Interceptor } from "procsi/interceptors";
234
-
235
- export default {
236
- name: "rate-limit",
237
- match: (req) => req.path.startsWith("/api/"),
238
- handler: async (ctx) => {
239
- // Count how many requests this endpoint has seen in the last minute
240
- const since = new Date(Date.now() - 60_000).toISOString();
241
- const count = await ctx.procsi.countRequests({
242
- path: ctx.request.path,
243
- since,
244
- });
245
-
246
- if (count >= 10) {
247
- return {
248
- status: 429,
249
- headers: { "retry-after": "60" },
250
- body: JSON.stringify({ error: "rate_limited" }),
251
- };
252
- }
253
-
254
- return ctx.forward();
255
- },
256
- } satisfies Interceptor;
257
- ```
258
-
259
- ### Handler Context
260
-
261
- | Property | Description |
262
- | --------------- | ----------------------------------------- |
263
- | `ctx.request` | The incoming request (frozen, read-only) |
264
- | `ctx.forward()` | Forward to upstream, returns the response |
265
- | `ctx.procsi` | Query captured traffic (see below) |
266
- | `ctx.log(msg)` | Write to `.procsi/procsi.log` |
267
-
268
- #### `ctx.procsi`
269
-
270
- | Method | Description |
271
- | -------------------------------------------- | -------------------------------------------- |
272
- | `countRequests(filter?)` | Count matching requests |
273
- | `listRequests({ filter?, limit?, offset? })` | List request summaries |
274
- | `getRequest(id)` | Full request details by ID |
275
- | `searchBodies({ query, ...filter? })` | Full-text search through bodies |
276
- | `queryJsonBodies({ json_path, ...filter? })` | Extract values from JSON bodies via JSONPath |
277
-
278
- ### How Interceptors Work
279
-
280
- - Any `.ts` file in `.procsi/interceptors/` is loaded automatically
281
- - Files load alphabetically; first match wins
282
- - `match` is optional — omit it to match everything
283
- - Hot-reloads on file changes, or run `procsi interceptors reload`
284
- - 30s handler timeout, 5s match timeout
285
- - Errors fall through gracefully (never crashes the proxy)
286
- - `ctx.log()` writes to `.procsi/procsi.log` since `console.log` goes nowhere in the daemon
287
- - Use `satisfies Interceptor` for full intellisense
113
+ See [full interceptors documentation](docs/interceptors.md) for modify, observe, querying past traffic, handler context, and how they work.
288
114
 
289
115
  ## How It Works
290
116
 
@@ -331,15 +157,23 @@ export default {
331
157
  | --------------------- | ------------------------------------ |
332
158
  | `HTTP_PROXY` | Proxy URL for HTTP clients |
333
159
  | `HTTPS_PROXY` | Proxy URL for HTTPS clients |
334
- | `SSL_CERT_FILE` | CA cert path (curl, git, etc.) |
160
+ | `SSL_CERT_FILE` | CA cert path (curl, OpenSSL) |
335
161
  | `REQUESTS_CA_BUNDLE` | CA cert path (Python requests) |
162
+ | `CURL_CA_BUNDLE` | CA cert path (curl/Python fallback) |
336
163
  | `NODE_EXTRA_CA_CERTS` | CA cert path (Node.js) |
164
+ | `DENO_CERT` | CA cert path (Deno) |
165
+ | `CARGO_HTTP_CAINFO` | CA cert path (Rust Cargo) |
166
+ | `GIT_SSL_CAINFO` | CA cert path (Git) |
167
+ | `AWS_CA_BUNDLE` | CA cert path (AWS CLI) |
168
+ | `CGI_HTTP_PROXY` | Proxy URL (PHP CGI, HTTPoxy-safe) |
337
169
  | `PROCSI_SESSION_ID` | UUID identifying the current session |
338
170
  | `PROCSI_LABEL` | Session label (when `-l` flag used) |
339
171
 
172
+ Additionally, `procsi on` sets `PYTHONPATH`, `RUBYOPT`, and `PHP_INI_SCAN_DIR` to load runtime-specific override scripts that ensure edge-case HTTP clients trust the proxy CA.
173
+
340
174
  ## Configuration
341
175
 
342
- Create `.procsi/config.json` to override defaults. All fields are optional:
176
+ Create `.procsi/config.json` to override defaults:
343
177
 
344
178
  ```json
345
179
  {
@@ -350,314 +184,58 @@ Create `.procsi/config.json` to override defaults. All fields are optional:
350
184
  }
351
185
  ```
352
186
 
353
- | Setting | Default | Description |
354
- | ------------------- | ------------------ | --------------------------------------------------------------------- |
355
- | `maxStoredRequests` | `5000` | Max requests in the database. Oldest evicted automatically. |
356
- | `maxBodySize` | `10485760` (10 MB) | Max body size to capture. Larger bodies are proxied but not stored. |
357
- | `maxLogSize` | `10485760` (10 MB) | Max log file size before rotation. |
358
- | `pollInterval` | `2000` | TUI polling interval in ms. Lower = faster updates, more IPC traffic. |
359
-
360
- Missing or invalid values fall back to defaults.
187
+ See [full configuration documentation](docs/configuration.md) for details on each setting.
361
188
 
362
189
  ## Supported HTTP Clients
363
190
 
364
- Anything that respects `HTTP_PROXY` works:
191
+ Anything that respects `HTTP_PROXY` works. procsi sets the right CA cert env vars for each runtime automatically.
192
+
193
+ **Works automatically (env vars only):**
365
194
 
366
195
  | Client | Support |
367
196
  | ---------------------------- | -------------------------- |
368
197
  | curl | Automatic |
369
198
  | wget | Automatic |
370
- | Node.js (fetch, axios, etc.) | With `NODE_EXTRA_CA_CERTS` |
371
- | Python (requests, httpx) | With `REQUESTS_CA_BUNDLE` |
372
- | Go | Automatic |
199
+ | Go (`net/http`) | Automatic |
373
200
  | Rust (reqwest) | Automatic |
201
+ | .NET (`HttpClient`) | Automatic |
202
+ | Deno | Automatic (`DENO_CERT`) |
203
+ | Bun | Automatic (`SSL_CERT_FILE`)|
204
+ | Git | Automatic (`GIT_SSL_CAINFO`)|
205
+ | AWS CLI | Automatic (`AWS_CA_BUNDLE`)|
206
+ | Cargo | Automatic (`CARGO_HTTP_CAINFO`)|
374
207
 
375
- ## Export
376
-
377
- Press `c` to copy a request as curl:
378
-
379
- ```bash
380
- curl -X POST 'https://api.example.com/users' \
381
- -H 'Content-Type: application/json' \
382
- -H 'Authorization: Bearer token123' \
383
- -d '{"name": "test"}'
384
- ```
385
-
386
- Press `H` to export all requests as a HAR file. Compatible with browser dev tools.
387
-
388
- Press `s` on a body to open the export modal — clipboard, `.procsi/exports/`, `~/Downloads/`, custom path, or open in default application.
389
-
390
- ## TUI Keybindings
391
-
392
- `j`/`k` to navigate, `Tab` to switch panels, `/` to filter, `c` to copy as curl, `Enter` to inspect bodies, `q` to quit.
393
-
394
- Mouse support: click to select, scroll to navigate, click panels to focus.
395
-
396
- <details>
397
- <summary>Full keybinding reference</summary>
398
-
399
- ### Main View
400
-
401
- | Key | Action |
402
- | ------------------- | -------------------------------------------------------------------------- |
403
- | `j`/`k` or `↑`/`↓` | Navigate up/down |
404
- | `g` / `G` | Jump to first / last item |
405
- | `Ctrl+u` / `Ctrl+d` | Half-page up / down |
406
- | `Ctrl+f` / `Ctrl+b` | Full-page down / up |
407
- | `Tab` / `Shift+Tab` | Next / previous panel |
408
- | `1`-`5` | Jump to section (list / request / request body / response / response body) |
409
- | `Enter` | Open body in full-screen viewer |
410
- | `/` | Open filter bar |
411
- | `u` | Toggle full URL display |
412
- | `c` | Copy request as curl |
413
- | `y` | Copy body to clipboard |
414
- | `s` | Export body (opens export modal) |
415
- | `H` | Export all as HAR |
416
- | `r` | Refresh |
417
- | `?` | Help |
418
- | `i` | Proxy connection info |
419
- | `q` | Quit |
420
-
421
- ### Filter Bar (`/`)
422
-
423
- | Key | Action |
424
- | ------------------- | -------------------------------------------------------------------- |
425
- | `Tab` / `Shift+Tab` | Cycle between search, method, status fields |
426
- | `←` / `→` | Cycle method (ALL/GET/POST/PUT/PATCH/DELETE) or status (ALL/2xx-5xx) |
427
- | `Return` | Apply filter |
428
- | `Esc` | Cancel and revert |
208
+ **Works with procsi overrides (injection scripts):**
429
209
 
430
- ### JSON Explorer (Enter on a JSON body)
210
+ | Client | Mechanism |
211
+ | ---------------------------- | ------------------------------------------ |
212
+ | Node.js (fetch, axios, etc.) | `NODE_OPTIONS --require` preload script |
213
+ | Python (requests, httplib2) | `PYTHONPATH` sitecustomize.py |
214
+ | Ruby (Net::HTTP, gems) | `RUBYOPT -r` OpenSSL CA patch |
215
+ | PHP (curl, streams) | `PHP_INI_SCAN_DIR` custom INI |
431
216
 
432
- | Key | Action |
433
- | ----------- | --------------------- |
434
- | `j`/`k` | Navigate nodes |
435
- | `Enter`/`l` | Expand/collapse node |
436
- | `h` | Collapse node |
437
- | `e` / `c` | Expand / collapse all |
438
- | `/` | Filter by path |
439
- | `n` / `N` | Next / previous match |
440
- | `y` | Copy value |
441
- | `q` / `Esc` | Close |
217
+ **Not currently supported (needs system-level config):**
442
218
 
443
- ### Text Viewer (Enter on a non-JSON body)
219
+ | Runtime | Reason |
220
+ | ----------------- | ------------------------------------------------ |
221
+ | Java/JVM | Needs `-javaagent` or JVM trust store config |
222
+ | Swift | Uses macOS Keychain only |
223
+ | Dart/Flutter | Requires code changes for proxy |
224
+ | Elixir/Erlang | Requires code changes for proxy |
444
225
 
445
- | Key | Action |
446
- | ----------- | --------------------- |
447
- | `j`/`k` | Scroll line by line |
448
- | `Space` | Page down |
449
- | `g` / `G` | Top / bottom |
450
- | `/` | Search text |
451
- | `n` / `N` | Next / previous match |
452
- | `y` | Copy to clipboard |
453
- | `q` / `Esc` | Close |
226
+ ## TUI
454
227
 
455
- </details>
228
+ `j`/`k` to navigate, `Tab` to switch panels, `/` to filter, `c` to copy as curl, `Enter` to inspect bodies, `q` to quit. Mouse support included.
456
229
 
457
- ## CLI Reference
230
+ See [full TUI documentation](docs/tui.md) for all keybindings and export features.
458
231
 
459
- ### Global Options
232
+ ## Documentation
460
233
 
461
- | Flag | Description |
462
- | ------------------ | ------------------------------------------------- |
463
- | `-v, --verbose` | Increase log verbosity (stackable: `-vv`, `-vvv`) |
464
- | `-d, --dir <path>` | Override project root directory |
465
-
466
- ### `procsi on`
467
-
468
- Output shell `export` statements to start intercepting HTTP traffic. Use with `eval`:
469
-
470
- ```bash
471
- eval "$(procsi on)"
472
- ```
473
-
474
- If run directly in a TTY (without `eval`), shows usage instructions.
475
-
476
- | Flag | Description |
477
- | --------------------- | --------------------------------------------- |
478
- | `-l, --label <label>` | Label this session (visible in TUI and MCP) |
479
- | `-s, --source <name>` | Label the source process (auto-detected from PID if omitted) |
480
- | `--no-restart` | Don't auto-restart daemon on version mismatch |
481
-
482
- ### `procsi off`
483
-
484
- Output shell `unset` statements to stop intercepting HTTP traffic. Use with `eval`:
485
-
486
- ```bash
487
- eval "$(procsi off)"
488
- ```
489
-
490
- ### `procsi tui`
491
-
492
- Open the interactive TUI.
493
-
494
- | Flag | Description |
495
- | ------ | ------------------------------------------- |
496
- | `--ci` | CI mode: render once and exit (for testing) |
497
-
498
- ### `procsi status`
499
-
500
- Show comprehensive status: daemon state, interception state, sessions, request count, loaded interceptors.
501
-
502
- ### `procsi daemon stop`
503
-
504
- Stop the daemon.
505
-
506
- ### `procsi daemon restart`
507
-
508
- Restart the daemon (or start it if not running).
509
-
510
- ### `procsi requests`
511
-
512
- List and filter captured requests. Output is a colour-coded table with short IDs — pipe to other tools or use `--json` for structured output.
513
-
514
- ```bash
515
- procsi requests # list recent (default limit 50)
516
- procsi requests --method GET,POST # filter by method
517
- procsi requests --status 4xx # filter by status range
518
- procsi requests --host api.example.com # filter by host
519
- procsi requests --path /api/v2 # filter by path prefix
520
- procsi requests --search "keyword" # substring match on URL
521
- procsi requests --since 5m # last 5 minutes
522
- procsi requests --since yesterday # since midnight yesterday
523
- procsi requests --since 10am --before 11am # time window
524
- procsi requests --header "content-type:application/json" # header filter
525
- procsi requests --intercepted-by mock-users # interceptor filter
526
- procsi requests --limit 100 --offset 50 # pagination
527
- procsi requests --json # JSON output
528
- ```
529
-
530
- | Flag | Description |
531
- | -------------------------- | -------------------------------------------------------- |
532
- | `--method <methods>` | Filter by HTTP method (comma-separated) |
533
- | `--status <range>` | Status range: `2xx`, `4xx`, exact `401`, etc. |
534
- | `--host <host>` | Filter by hostname |
535
- | `--path <prefix>` | Filter by path prefix |
536
- | `--search <text>` | Substring match on URL |
537
- | `--since <time>` | Since time (5m, 2h, 10am, yesterday, monday, 2024-01-01) |
538
- | `--before <time>` | Before time (same formats as --since) |
539
- | `--header <spec>` | Header name or name:value |
540
- | `--header-target <target>` | `request`, `response`, or `both` (default) |
541
- | `--source <name>` | Filter by request source (e.g. node, python) |
542
- | `--intercepted-by <name>` | Filter by interceptor name |
543
- | `--limit <n>` | Max results (default 50) |
544
- | `--offset <n>` | Skip results (default 0) |
545
- | `--json` | JSON output |
546
-
547
- #### `procsi requests search <query>`
548
-
549
- Full-text search through request and response bodies.
550
-
551
- #### `procsi requests query <jsonpath>`
552
-
553
- Query JSON bodies using JSONPath expressions (e.g. `$.data.id`). Supports `--value`, `--target` (request/response/both).
554
-
555
- #### `procsi requests count`
556
-
557
- Count requests matching the current filters.
558
-
559
- #### `procsi requests clear`
560
-
561
- Clear all captured requests. Prompts for confirmation unless `--yes` is passed.
562
-
563
- ### `procsi request <id>`
564
-
565
- View a single request in detail. Accepts full UUIDs or abbreviated prefixes (first 7+ characters).
566
-
567
- ```bash
568
- procsi request a1b2c3d # full detail view
569
- procsi request a1b2c3d --json # JSON output
570
- ```
571
-
572
- #### `procsi request <id> body`
573
-
574
- Dump the response body to stdout (raw, pipeable). Use `--request` for the request body instead.
575
-
576
- ```bash
577
- procsi request a1b2c3d body # response body
578
- procsi request a1b2c3d body --request # request body
579
- procsi request a1b2c3d body | jq . # pipe to jq
580
- ```
581
-
582
- #### `procsi request <id> export <format>`
583
-
584
- Export a request as `curl` or `har`.
585
-
586
- ```bash
587
- procsi request a1b2c3d export curl
588
- procsi request a1b2c3d export har
589
- ```
590
-
591
- ### `procsi sessions`
592
-
593
- List active proxy sessions.
594
-
595
- | Flag | Description |
596
- | -------- | ----------- |
597
- | `--json` | JSON output |
598
-
599
- ### `procsi clear`
600
-
601
- Clear all captured requests.
602
-
603
- ### `procsi debug-dump`
604
-
605
- Collect diagnostics (system info, daemon status, recent logs) into `.procsi/debug-dump-<timestamp>.json`.
606
-
607
- ### `procsi mcp`
608
-
609
- Start the MCP server (stdio transport). See [MCP Integration](#mcp-integration).
610
-
611
- ### `procsi project init`
612
-
613
- Manually initialise a `.procsi` directory in the current location.
614
-
615
- ### `procsi interceptors`
616
-
617
- List loaded interceptors, or manage them with subcommands.
618
-
619
- ### `procsi interceptors init`
620
-
621
- Scaffold an example interceptor in `.procsi/interceptors/`.
622
-
623
- ### `procsi interceptors reload`
624
-
625
- Reload interceptors from disk without restarting the daemon.
626
-
627
- ### `procsi interceptors logs`
628
-
629
- View the interceptor event log. Events include match results, mock responses, errors, timeouts, and `ctx.log()` output.
630
-
631
- ```bash
632
- procsi interceptors logs # recent events
633
- procsi interceptors logs --name mock-users # filter by interceptor
634
- procsi interceptors logs --level error # filter by level
635
- procsi interceptors logs --limit 100 # more results
636
- procsi interceptors logs --follow # live tail (Ctrl+C to stop)
637
- procsi interceptors logs --follow --json # live tail as NDJSON
638
- ```
639
-
640
- | Flag | Description |
641
- | ---------------------- | ----------------------------------- |
642
- | `--name <interceptor>` | Filter by interceptor name |
643
- | `--level <level>` | Filter by level (info, warn, error) |
644
- | `--limit <n>` | Max events (default 50) |
645
- | `--follow` | Live tail — poll for new events |
646
- | `--json` | JSON output |
647
-
648
- #### `procsi interceptors logs clear`
649
-
650
- Clear the interceptor event log.
651
-
652
- ### `procsi completions <shell>`
653
-
654
- Generate shell completion scripts. Supports `zsh`, `bash`, and `fish`.
655
-
656
- ```bash
657
- eval "$(procsi completions zsh)" # add to .zshrc
658
- eval "$(procsi completions bash)" # add to .bashrc
659
- procsi completions fish | source # add to fish config
660
- ```
234
+ - [CLI Reference](docs/cli-reference.md) — all commands, flags, and examples
235
+ - [Interceptors](docs/interceptors.md) mock, modify, observe, query traffic, handler context
236
+ - [MCP Integration](docs/mcp.md) tools, filtering, output formats, examples
237
+ - [TUI](docs/tui.md) keybindings, export features
238
+ - [Configuration](docs/configuration.md) — `.procsi/config.json` options
661
239
 
662
240
  ## Development
663
241
 
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmEpC,eAAO,MAAM,aAAa,SAGM,CAAC"}
1
+ {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoEpC,eAAO,MAAM,aAAa,SAGM,CAAC"}
@@ -40,6 +40,7 @@ const restartSubCommand = new Command("restart")
40
40
  console.log(`Restarting daemon${versionInfo}...`);
41
41
  const port = await restartDaemon(projectRoot, logLevel);
42
42
  console.log(`Daemon restarted on port ${port}`);
43
+ console.log('If your shell env vars are stale, run: eval "$(procsi on)"');
43
44
  }
44
45
  else {
45
46
  console.log("Daemon not running, starting...");
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../../src/cli/commands/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAA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,CAAC,KAAK,CAAC,6BAA6B,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,0BAA0B,CAAC;KACvC,UAAU,CAAC,cAAc,CAAC;KAC1B,UAAU,CAAC,iBAAiB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"off.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/off.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,eAAO,MAAM,UAAU,SAmBnB,CAAC"}
1
+ {"version":3,"file":"off.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/off.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,eAAO,MAAM,UAAU,SAsBnB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Command } from "commander";
2
- import { formatUnsetVars, formatNodeOptionsRestore } from "./on.js";
2
+ import { formatUnsetVars, formatNodeOptionsRestore, formatPythonPathRestore, formatRubyOptRestore, formatPhpIniScanDirRestore, } from "./on.js";
3
3
  // Environment variables managed by procsi
4
4
  const PROCSI_ENV_VARS = [
5
5
  "HTTP_PROXY",
@@ -8,7 +8,13 @@ const PROCSI_ENV_VARS = [
8
8
  "https_proxy",
9
9
  "SSL_CERT_FILE",
10
10
  "REQUESTS_CA_BUNDLE",
11
+ "CURL_CA_BUNDLE",
11
12
  "NODE_EXTRA_CA_CERTS",
13
+ "DENO_CERT",
14
+ "CARGO_HTTP_CAINFO",
15
+ "GIT_SSL_CAINFO",
16
+ "AWS_CA_BUNDLE",
17
+ "CGI_HTTP_PROXY",
12
18
  "GLOBAL_AGENT_HTTP_PROXY",
13
19
  "GLOBAL_AGENT_HTTPS_PROXY",
14
20
  "NODE_USE_ENV_PROXY",
@@ -26,8 +32,11 @@ export const offCommand = new Command("off")
26
32
  console.log(' eval "$(procsi off)"');
27
33
  return;
28
34
  }
29
- // Restore NODE_OPTIONS before standard unsets
35
+ // Restore modified env vars before standard unsets
30
36
  console.log(formatNodeOptionsRestore());
37
+ console.log(formatPythonPathRestore());
38
+ console.log(formatRubyOptRestore());
39
+ console.log(formatPhpIniScanDirRestore());
31
40
  // Output unset statements for eval
32
41
  console.log(formatUnsetVars(PROCSI_ENV_VARS));
33
42
  // Output confirmation as a comment (shown but not executed)
@@ -1 +1 @@
1
- {"version":3,"file":"off.js","sourceRoot":"","sources":["../../../src/cli/commands/off.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEpE,0CAA0C;AAC1C,MAAM,eAAe,GAAG;IACtB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,aAAa;IACb,eAAe;IACf,oBAAoB;IACpB,qBAAqB;IACrB,yBAAyB;IACzB,0BAA0B;IAC1B,oBAAoB;IACpB,mBAAmB;IACnB,sBAAsB;IACtB,cAAc;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC;KACzC,WAAW,CAAC,iEAAiE,CAAC;KAC9E,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,oEAAoE;IACpE,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACtC,OAAO;IACT,CAAC;IAED,8CAA8C;IAC9C,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAA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