@robinpath/cli 3.2.0 → 3.2.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 +56 -20
  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.2.0" : "3.2.0";
18601
+ var CLI_VERSION = true ? "3.2.1" : "3.2.1";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -19858,32 +19858,68 @@ function handleInstall() {
19858
19858
  log("Restart your terminal, then run:");
19859
19859
  log(" robinpath --version");
19860
19860
  }
19861
- function handleUninstall() {
19862
- const installDir = getInstallDir();
19861
+ async function handleUninstall() {
19863
19862
  const robinpathHome = getRobinPathHome();
19864
- const isWindows = platform4() === "win32";
19863
+ log("");
19864
+ log(color.bold(" Uninstall RobinPath"));
19865
+ log("");
19866
+ log(" This will remove:");
19865
19867
  if (existsSync5(robinpathHome)) {
19866
- rmSync(robinpathHome, { recursive: true, force: true });
19867
- log(`Removed ${robinpathHome}`);
19868
- } else {
19869
- log("Nothing to remove.");
19868
+ log(` ${color.dim("\u2022")} ${robinpathHome} (config, sessions, modules, memory)`);
19870
19869
  }
19871
- if (isWindows) {
19870
+ log(` ${color.dim("\u2022")} @robinpath/cli npm package`);
19871
+ log("");
19872
+ if (process.stdin.isTTY) {
19873
+ const answer = await new Promise((resolve13) => {
19874
+ process.stdout.write(` ${color.red("Are you sure?")} [y/N] `);
19875
+ process.stdin.setRawMode(true);
19876
+ process.stdin.resume();
19877
+ const onKey = (buf) => {
19878
+ const key = buf.toString().toLowerCase();
19879
+ process.stdin.removeListener("data", onKey);
19880
+ try {
19881
+ process.stdin.setRawMode(false);
19882
+ } catch {
19883
+ }
19884
+ process.stdin.pause();
19885
+ process.stdout.write(key === "y" ? "yes\n" : "no\n");
19886
+ resolve13(key);
19887
+ };
19888
+ process.stdin.on("data", onKey);
19889
+ });
19890
+ if (answer !== "y") {
19891
+ log(color.dim(" Cancelled."));
19892
+ return;
19893
+ }
19894
+ }
19895
+ log("");
19896
+ if (existsSync5(robinpathHome)) {
19872
19897
  try {
19873
- execSync(
19874
- `powershell -NoProfile -Command "$p = [Environment]::GetEnvironmentVariable('Path','User'); $clean = ($p -split ';' | Where-Object { $_ -notlike '*\\.robinpath\\bin*' }) -join ';'; [Environment]::SetEnvironmentVariable('Path',$clean,'User')"`,
19875
- { encoding: "utf-8" }
19876
- );
19877
- log("Removed from PATH");
19898
+ rmSync(robinpathHome, { recursive: true, force: true });
19899
+ log(color.green(" \u2713") + ` Removed ${robinpathHome}`);
19900
+ } catch (err) {
19901
+ log(color.red(" \u2717") + ` Could not remove ${robinpathHome}: ${err.message}`);
19902
+ }
19903
+ }
19904
+ const oldBin = getInstallDir();
19905
+ if (existsSync5(oldBin)) {
19906
+ try {
19907
+ rmSync(oldBin, { recursive: true, force: true });
19908
+ log(color.green(" \u2713") + " Removed old binary");
19878
19909
  } catch {
19879
- log(`Could not update PATH automatically.`);
19880
- log(`Remove "${installDir}" from your PATH manually.`);
19881
19910
  }
19882
- } else {
19883
- log(`Remove the robinpath PATH line from your shell profile.`);
19884
19911
  }
19912
+ log(color.dim(" Removing npm package..."));
19913
+ try {
19914
+ execSync("npm uninstall -g @robinpath/cli", { stdio: "pipe" });
19915
+ log(color.green(" \u2713") + " Removed @robinpath/cli");
19916
+ } catch {
19917
+ log(color.dim(" npm uninstall skipped (may need manual: npm uninstall -g @robinpath/cli)"));
19918
+ }
19919
+ log("");
19920
+ log(color.green(" RobinPath completely uninstalled."));
19921
+ log(color.dim(" To reinstall: npm install -g @robinpath/cli"));
19885
19922
  log("");
19886
- log("RobinPath uninstalled. Restart your terminal.");
19887
19923
  }
19888
19924
  function resolveScriptPath(fileArg) {
19889
19925
  const filePath = resolve4(fileArg);
@@ -28628,7 +28664,7 @@ async function main() {
28628
28664
  return;
28629
28665
  }
28630
28666
  if (command === "uninstall") {
28631
- handleUninstall();
28667
+ await handleUninstall();
28632
28668
  return;
28633
28669
  }
28634
28670
  if (command === "update") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinpath/cli",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",