@robinpath/cli 3.5.0 → 3.5.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 (2) hide show
  1. package/dist/cli.mjs +42 -5
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -18598,7 +18598,7 @@ function getNativeModules() {
18598
18598
  import { join as join3, basename as basename2 } from "node:path";
18599
18599
  import { homedir as homedir2, platform as platform2 } from "node:os";
18600
18600
  import { existsSync as existsSync2 } from "node:fs";
18601
- var CLI_VERSION = true ? "3.5.0" : "3.5.0";
18601
+ var CLI_VERSION = true ? "3.5.2" : "3.5.2";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -24266,6 +24266,7 @@ var COMMANDS = {
24266
24266
  "/remember": "Save a fact",
24267
24267
  "/forget": "Remove a memory",
24268
24268
  "/usage": "Token usage & cost",
24269
+ "/settings": "API key, model, shell",
24269
24270
  "/shell": "Switch shell",
24270
24271
  "/init": "Create ROBINPATH.md",
24271
24272
  "/help": "All commands"
@@ -24802,6 +24803,27 @@ Any context the AI should know about this project.
24802
24803
  const c = this.usage.cost > 0 ? `$${this.usage.cost.toFixed(4)}` : "$0.00 (free)";
24803
24804
  return `${this.usage.totalTokens.toLocaleString()} tokens \xB7 ${this.usage.requests} requests \xB7 ${c}`;
24804
24805
  }
24806
+ if (text === "/settings") {
24807
+ const cfg = readAiConfig();
24808
+ const key = cfg.apiKey || "";
24809
+ const masked = key.length > 10 ? key.slice(0, 8) + "\u2022".repeat(Math.min(key.length - 11, 15)) + key.slice(-3) : key ? "(set)" : "(not set)";
24810
+ const model = cfg.model || "anthropic/claude-sonnet-4.6";
24811
+ const provider = cfg.provider || "openrouter";
24812
+ const shell = getShellConfig().name;
24813
+ return [
24814
+ "Settings:",
24815
+ ` API key: ${masked}`,
24816
+ ` Provider: ${provider}`,
24817
+ ` Model: ${model.includes("/") ? model.split("/").pop() : model}`,
24818
+ ` Shell: ${shell}`,
24819
+ "",
24820
+ "Commands:",
24821
+ " /model Switch model",
24822
+ " /shell <name> Switch shell",
24823
+ " robinpath ai config set-key ... Change API key",
24824
+ " robinpath ai config remove Remove all config"
24825
+ ].join("\n");
24826
+ }
24805
24827
  if (text === "/memory") {
24806
24828
  const m = loadMemory();
24807
24829
  return m.facts.length ? m.facts.map((f, i) => `${i + 1}. ${f}`).join("\n") : "No memories saved yet.\nUse /remember <fact> to save something.";
@@ -28813,6 +28835,19 @@ async function main() {
28813
28835
  process.stdin.setRawMode(true);
28814
28836
  process.stdin.resume();
28815
28837
  let input = "";
28838
+ function redraw() {
28839
+ process.stdout.write("\r\x1B[2K");
28840
+ if (input.length === 0) {
28841
+ process.stdout.write(color.cyan(" API key: "));
28842
+ } else if (input.length <= 8) {
28843
+ process.stdout.write(color.cyan(" API key: ") + color.dim(input));
28844
+ } else {
28845
+ const prefix = input.slice(0, 8);
28846
+ const masked = "\u2022".repeat(Math.min(input.length - 8, 20));
28847
+ const suffix = input.length > 10 ? input.slice(-3) : "";
28848
+ process.stdout.write(color.cyan(" API key: ") + color.dim(prefix + masked + suffix));
28849
+ }
28850
+ }
28816
28851
  const onData = (ch) => {
28817
28852
  const c = ch.toString();
28818
28853
  if (c === "\r" || c === "\n") {
@@ -28836,11 +28871,13 @@ async function main() {
28836
28871
  } else if (c === "\x7F" || c === "\b") {
28837
28872
  if (input.length > 0) {
28838
28873
  input = input.slice(0, -1);
28839
- process.stdout.write("\b \b");
28874
+ redraw();
28875
+ }
28876
+ } else {
28877
+ for (const char of c) {
28878
+ if (char.charCodeAt(0) >= 32) input += char;
28840
28879
  }
28841
- } else if (c.charCodeAt(0) >= 32) {
28842
- input += c;
28843
- process.stdout.write("*");
28880
+ redraw();
28844
28881
  }
28845
28882
  };
28846
28883
  process.stdin.on("data", onData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinpath/cli",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",