@robinpath/cli 3.5.0 → 3.5.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +20 -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.1" : "3.5.1";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -28813,6 +28813,19 @@ async function main() {
28813
28813
  process.stdin.setRawMode(true);
28814
28814
  process.stdin.resume();
28815
28815
  let input = "";
28816
+ function redraw() {
28817
+ process.stdout.write("\r\x1B[2K");
28818
+ if (input.length === 0) {
28819
+ process.stdout.write(color.cyan(" API key: "));
28820
+ } else if (input.length <= 8) {
28821
+ process.stdout.write(color.cyan(" API key: ") + color.dim(input));
28822
+ } else {
28823
+ const prefix = input.slice(0, 8);
28824
+ const masked = "\u2022".repeat(Math.min(input.length - 8, 20));
28825
+ const suffix = input.length > 10 ? input.slice(-3) : "";
28826
+ process.stdout.write(color.cyan(" API key: ") + color.dim(prefix + masked + suffix));
28827
+ }
28828
+ }
28816
28829
  const onData = (ch) => {
28817
28830
  const c = ch.toString();
28818
28831
  if (c === "\r" || c === "\n") {
@@ -28836,11 +28849,13 @@ async function main() {
28836
28849
  } else if (c === "\x7F" || c === "\b") {
28837
28850
  if (input.length > 0) {
28838
28851
  input = input.slice(0, -1);
28839
- process.stdout.write("\b \b");
28852
+ redraw();
28853
+ }
28854
+ } else {
28855
+ for (const char of c) {
28856
+ if (char.charCodeAt(0) >= 32) input += char;
28840
28857
  }
28841
- } else if (c.charCodeAt(0) >= 32) {
28842
- input += c;
28843
- process.stdout.write("*");
28858
+ redraw();
28844
28859
  }
28845
28860
  };
28846
28861
  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.1",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",