promptimizer-cli 0.1.20 → 0.1.22

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
@@ -3,19 +3,19 @@
3
3
  Gemini-style interactive routing CLI for Promptimizer.
4
4
 
5
5
  ```bash
6
- npm install -g promptimizer-cli
6
+ npm install -g promptimizer-cli@latest
7
7
  promptimizer
8
8
  ```
9
9
 
10
+ Requires **≥ 0.1.22** for REPL `/logout`. If `/help` does not list `/logout`, upgrade the global binary.
11
+
10
12
  ```text
11
- ██████╗ ███╗ ███╗███████╗
12
-
13
- Promptimizer v0.1.17
14
- Type a prompt, or /help /models /savings /clear /quit
13
+ Promptimizer v0.1.22
14
+ Type a prompt, or /help /models /savings /clear /logout /quit
15
15
  › What is 17 * 24?
16
16
 
17
17
  408
18
- thinkingmachines/inkling-small · economy · saved $0.0001
18
+ model · economy · bootstrap_heuristic · saved $0.0001 · miss
19
19
  ```
20
20
 
21
21
  ## Commands
@@ -24,6 +24,7 @@ promptimizer
24
24
  | --- | --- |
25
25
  | `promptimizer` | Interactive multi-turn session |
26
26
  | `promptimizer login --key pmz_live_…` | Save API key |
27
+ | `promptimizer logout` / REPL `/logout` | Remove `~/.promptimizer/config.json` |
27
28
  | `promptimizer connect baseten --key $BASETEN_API_KEY` | Attach provider |
28
29
  | `promptimizer chat "…"` | One-shot completion |
29
30
  | `promptimizer models` | List fleet |
@@ -242,11 +242,12 @@ function printMeta(result) {
242
242
  const meta = result.promptimizer ?? {};
243
243
  const saved = result.usage?.cost?.saved_usd;
244
244
  const bits = [meta.model || result.model, meta.tier].filter(Boolean);
245
+ if (meta.routing_policy) bits.push(String(meta.routing_policy));
245
246
  if (saved != null) bits.push(`saved ${usd(saved)}`);
246
247
  if (meta.exact_cache_hit) bits.push(color(ANSI.green, "cache hit"));
247
248
  else if (meta.prefix_cache_hit) bits.push(color(ANSI.green, "prefix cache"));
248
249
  else if ("cache_hit" in meta) bits.push(color(ANSI.gray, "miss"));
249
- if (meta.escalated) bits.push("escalated");
250
+ if (meta.escalated) bits.push(meta.escalation_reason ? `escalated:${meta.escalation_reason}` : "escalated");
250
251
  if (meta.latency_ms != null) bits.push(`${Math.round(Number(meta.latency_ms))}ms`);
251
252
  out(color(ANSI.dim, ` ↳ ${bits.join(" · ")}`));
252
253
  }
@@ -274,8 +275,14 @@ async function cmdLogin(flags) {
274
275
  }
275
276
 
276
277
  function cmdLogout() {
277
- rmSync(CONFIG_PATH, { force: true });
278
- out(`${color(ANSI.green, "✓")} Forgot saved key.`);
278
+ try {
279
+ rmSync(CONFIG_PATH, { force: true });
280
+ } catch (error) {
281
+ die(error instanceof Error ? error.message : String(error));
282
+ }
283
+ out(`${color(ANSI.green, "✓")} Logged out`);
284
+ out(color(ANSI.dim, ` Removed ${CONFIG_PATH}`));
285
+ out(color(ANSI.dim, " Run: promptimizer login --key pmz_live_…"));
279
286
  }
280
287
 
281
288
  async function cmdProviders(flags) {
@@ -417,7 +424,7 @@ async function interactive(flags) {
417
424
  out(` ${color(ANSI.bold, "/savings")} account ledger`);
418
425
  out(` ${color(ANSI.bold, "/session")} provider status`);
419
426
  out(` ${color(ANSI.bold, "/clear")} clear chat history`);
420
- out(` ${color(ANSI.bold, "/logout")} remove saved API key`);
427
+ out(` ${color(ANSI.bold, "/logout")} remove saved API key and exit`);
421
428
  out(` ${color(ANSI.bold, "/quit")} exit`);
422
429
  out();
423
430
  };
@@ -447,7 +454,7 @@ async function interactive(flags) {
447
454
  continue;
448
455
  }
449
456
 
450
- if (trimmed === "/logout") {
457
+ if (trimmed === "/logout" || trimmed === "/signout") {
451
458
  cmdLogout();
452
459
  break;
453
460
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptimizer-cli",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Interactive Promptimizer CLI — Gemini-style REPL for quality-aware routing.",
5
5
  "type": "module",
6
6
  "bin": {