proxitor 0.9.0-beta.1 → 0.9.0-beta.3

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
@@ -266,9 +266,9 @@ Both `cacheControl` and `sessionId` support `auto` / `always` / `never` modes:
266
266
 
267
267
  | Mode | `cacheControl` | `sessionId` |
268
268
  | --- | --- | --- |
269
- | `auto` (default) | Anthropic models on `/v1/chat/completions`; all models on `/v1/messages` and `/v1/responses` | Use `X-Claude-Code-Session-Id` header if present; otherwise generate proxy UUID |
270
- | `always` | All models, all endpoints | Generate a proxy UUID for sticky routing |
271
- | `never` | Disabled | Disabled |
269
+ | `auto` (default) | Anthropic models on `/v1/chat/completions`; all models on `/v1/messages` and `/v1/responses` | Passthrough client session ID if present; otherwise generate proxy UUID |
270
+ | `always` | All models, all endpoints | Always generate proxy session ID, ignoring client-provided |
271
+ | `never` | Disabled | Don't manage session headers — pass through as-is |
272
272
 
273
273
  `cacheControlTtl` values:
274
274
 
@@ -331,7 +331,7 @@ When both formats are present (e.g., OpenRouter relaying an Anthropic response),
331
331
 
332
332
  ## Interactive Config Manager
333
333
 
334
- Proxitor includes an interactive CLI for managing model overrides search models, pick providers, and write to config without editing YAML by hand.
334
+ Proxitor includes an interactive CLI for managing configurationglobal settings, model overrides, and diagnostics without editing YAML by hand.
335
335
 
336
336
  ### Setup wizard
337
337
 
@@ -345,13 +345,24 @@ The wizard asks for:
345
345
 
346
346
  - **OpenRouter API key** — stored in config or set as `OPENROUTER_API_KEY` env var
347
347
  - **Port** — default `8828` (avoids conflicts with common dev servers on 8080)
348
+ - **Listen address** — all interfaces (`0.0.0.0`), localhost only (`127.0.0.1`), or a custom address (IP, hostname, or `unix:/path`)
348
349
  - **API base URL** — default `https://openrouter.ai/api`; change for self-hosted or custom endpoints
349
- - **Data URL** — separate URL for provider/model data fetching; falls back to OpenRouter automatically if the custom API doesn't support these endpoints
350
350
  - **Authentication type** — `bearer` (default) or `oauth`; use `oauth` for custom proxy providers that pass tokens in the `Authorization: OAuth ...` header
351
- - **Host** — all interfaces (`0.0.0.0`) or localhost only (`127.0.0.1`)
352
351
  - **Save location** — project directory, `~/.config/proxitor/`, or `$XDG_CONFIG_HOME/proxitor/`
353
352
 
354
- If a config already exists, the wizard shows its location and asks whether to reconfigure. Existing `modelOverrides`, `provider`, and other fields are preserved only the wizard fields are updated.
353
+ After collecting the key, base URL, and auth type, the wizard performs a **best-effort upstream probe** (3 s timeout) to verify connectivity. If the upstream is unreachable or the key is rejected, a warning is shown but the config is still saved — this is informational only.
354
+
355
+ If a config already exists, the wizard shows its location and asks whether to reconfigure. All fields are **pre-filled** with current values — press Enter to keep, or type a new value. Existing `modelOverrides`, `provider`, and other fields are preserved — only the wizard fields are updated.
356
+
357
+ ### Config menu
358
+
359
+ `proxitor config` (or `proxitor config menu`) opens an interactive menu that loops until you exit. From there you can manage all settings:
360
+
361
+ - **Show current config** — display the resolved configuration
362
+ - **API key & connection** — change API key, port, listen address, base URL, auth type
363
+ - **Session routing** — set global `sessionId` mode (`auto` / `always` / `never`)
364
+ - **Cache control** — set global `cacheControl` mode and TTL
365
+ - **Model overrides** — add, edit, remove, list, or browse models
355
366
 
356
367
  ```sh
357
368
  proxitor config menu # interactive menu
@@ -359,11 +370,20 @@ proxitor config add # add a model override
359
370
  proxitor config edit # edit existing override
360
371
  proxitor config remove # remove override(s)
361
372
  proxitor config list # show current overrides
373
+ proxitor config list --json # overrides as JSON
374
+ proxitor config show # print the resolved config (merged)
375
+ proxitor config show --json # same, machine-readable
362
376
  proxitor config browse # explore models with pricing info
363
377
  proxitor config wizard # interactive setup wizard
364
- proxitor config validate # validate config file
378
+ proxitor config validate # validate config file (exit 0 ok, 1 invalid)
379
+ proxitor config validate --json # structured JSON result
380
+ proxitor doctor # diagnose environment + network + port + version
381
+ proxitor doctor --json # machine-readable diagnostic report
382
+ proxitor doctor --offline # skip network checks
365
383
  ```
366
384
 
385
+ When adding or editing a model override, you can also configure per-model `sessionId` and `cacheControl` — useful for models that need different caching or routing behavior than the global default.
386
+
367
387
  ### Add override walkthrough
368
388
 
369
389
  ```sh
@@ -426,19 +446,92 @@ The interface uses live data from the OpenRouter API — model search with type-
426
446
 
427
447
  ---
428
448
 
449
+ ## Diagnostics
450
+
451
+ When something doesn't work, `proxitor doctor` runs a battery of checks and prints a report. Sections cover:
452
+
453
+ - **Environment** — Node version, platform, TTY
454
+ - **Config** — discovery path, validity, override count
455
+ - **API key** — resolution (env vs. file; never prints the key)
456
+ - **Network** — upstream reachability (with configurable timeout)
457
+ - **Port** — availability of the configured port
458
+ - **Version** — installed version
459
+
460
+ Statuses: `✓ ok` / `⚠ warn` / `✗ fail` / `ⓘ skip`. Exit code is `0` when no `fail`, `1` otherwise — scriptable from CI.
461
+
462
+ ```sh
463
+ $ proxitor doctor
464
+
465
+ ▲ Proxitor Doctor
466
+
467
+ ◇ Environment
468
+ │ ✓ node-version — v22.4.1
469
+ │ ✓ platform — darwin arm64
470
+ │ ✓ tty — true
471
+
472
+ ◇ Config
473
+ │ ✓ config-found — /Users/u/proj/proxitor.config.yaml
474
+ │ ✓ config-valid — 12 keys, 3 override(s)
475
+
476
+ ◇ API key
477
+ │ ✓ api-key — set (env: set, file: set)
478
+
479
+ ◇ Network
480
+ │ ✓ upstream — https://openrouter.ai/api — 200, 342 models
481
+
482
+ ◇ Port
483
+ │ ✓ port-8828 — 127.0.0.1:8828
484
+
485
+ ◇ Version
486
+ │ ✓ version — 0.9.0-beta.1
487
+
488
+ └ Done. All checks passed.
489
+ ```
490
+
491
+ Useful flags:
492
+
493
+ ```sh
494
+ proxitor doctor --json # structured JSON for CI / scripts
495
+ proxitor doctor --offline # skip network checks (no upstream, no npm)
496
+ proxitor doctor --timeout 5000 # custom per-check network timeout (ms)
497
+ ```
498
+
499
+ ---
500
+
429
501
  ## CLI Options
430
502
 
503
+ ```sh
504
+ proxitor # start the proxy (default command)
505
+ proxitor start # same as above
506
+ proxitor up # alias for start
507
+ proxitor run # alias for start
508
+ proxitor --port 9000 # override port
509
+ proxitor ./team.yaml # use an explicit config
510
+ proxitor config show # print the resolved config
511
+ proxitor config show --json # machine-readable config
512
+ proxitor config list --json # overrides as JSON
513
+ proxitor config wizard # interactive setup
514
+ proxitor config validate # check the current config (exit 0/1)
515
+ proxitor config validate --json # structured JSON result
516
+ proxitor doctor # diagnose environment, network, port, version
517
+ proxitor doctor --offline # skip network checks
518
+ proxitor --help # full help
519
+ proxitor --version # print version
520
+ ```
521
+
431
522
  | Flag | Default | Description |
432
523
  |---|---|---|
433
- | `-p, --port <port>` | `8828` | Server port |
524
+ | `-p, --port <port>` | `8828` | Server port (validated: 1-65535) |
434
525
  | `-h, --host <host>` | `0.0.0.0` | Server host |
435
- | `-c, --config <path>` | auto-discovered | Path to config file |
436
- | `--openrouter-key <key>` | `$OPENROUTER_API_KEY` | OpenRouter API key |
526
+ | `-c, --config <path>` | auto-discovered | Path to config file (positional `[config-path]` also accepted) |
527
+ | `--openrouter-key <key>` / `-k <key>` | `$OPENROUTER_API_KEY` | OpenRouter API key |
437
528
  | `--verbose` | `false` | Enable verbose logging |
438
529
  | `--no-config` | | Skip config file discovery |
439
530
  | `-v, --version` | | Print version |
440
531
  | `--help` | | Print help |
441
532
 
533
+ Subcommands live under `proxitor config <subcommand>`. Run `proxitor config --help` for the full list, or see [Interactive Config Manager](#interactive-config-manager) for the walkthroughs.
534
+
442
535
  ---
443
536
 
444
537
  ## Development