cbrowser 19.0.2 → 19.1.0

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/dist/cli.js CHANGED
@@ -716,6 +716,13 @@ MCP SERVER (v5.0.0)
716
716
  --port <port> Port to listen on (default: 3000)
717
717
  --host <host> Host to bind to (default: 0.0.0.0)
718
718
 
719
+ UNINSTALL
720
+ uninstall Remove CBrowser data: credentials, sessions, captures
721
+ Dry run by default — shows what would go, removes nothing
722
+ --yes Actually remove
723
+ --keep-config Keep API key and proxy config (for reinstalling)
724
+ 'npm uninstall -g cbrowser' does NOT remove any of this
725
+
719
726
  CLAUDE SKILL INSTALLATION & SYNC
720
727
  install-skill Install CBrowser as a Claude skill to ~/.claude/skills/
721
728
  sync-skill Sync local skill to match npm version (same as install-skill)
@@ -984,6 +991,10 @@ const COMMAND_FLAGS = {
984
991
  "after", "after-element", "after-delay",
985
992
  "until-element", "until-element-gone", "until-idle", "timeout",
986
993
  ],
994
+ // Declared so a mistyped flag errors instead of being silently ignored --
995
+ // this command deletes credentials, so "--kep-config did nothing" is a bad
996
+ // way to find out.
997
+ uninstall: ["yes", "keep-config"],
987
998
  evaluate: ["file", "arg", "json", "raw", "wait-for", "timeout", "expect-truthy"],
988
999
  eval: ["file", "arg", "json", "raw", "wait-for", "timeout", "expect-truthy"],
989
1000
  keyboard: ["delay", "selector", "hold", "repeat", "text"],
@@ -2695,6 +2706,34 @@ async function main() {
2695
2706
  process.exit(1);
2696
2707
  }
2697
2708
  }
2709
+ // Remove everything this tool wrote outside its own npm package.
2710
+ //
2711
+ // Dry run by default. The targets include the user's captured work, and
2712
+ // deleting it because someone typed a command to find out what it does is not
2713
+ // something they can undo.
2714
+ if (command === "uninstall") {
2715
+ const { planUninstall, executeUninstall, renderPlan } = await import("./uninstall.js");
2716
+ const confirmed = Boolean(options["yes"]);
2717
+ const plan = planUninstall({ keepConfig: Boolean(options["keep-config"]) });
2718
+ console.log(renderPlan(plan, !confirmed));
2719
+ if (!confirmed || plan.targets.length === 0) {
2720
+ return;
2721
+ }
2722
+ const result = executeUninstall(plan);
2723
+ console.log("");
2724
+ console.log(`Removed ${result.removed.length} items, freed ${formatBytes(result.bytesFreed)}.`);
2725
+ for (const f of result.failed) {
2726
+ console.error(` FAILED: ${f.path} — ${f.error}`);
2727
+ }
2728
+ console.log("");
2729
+ console.log("The npm package itself is still installed. To finish:");
2730
+ console.log(" npm uninstall -g cbrowser");
2731
+ // A credential reported as removed but still on disk is the one outcome
2732
+ // that must not exit 0.
2733
+ if (result.failed.length > 0)
2734
+ process.exit(1);
2735
+ return;
2736
+ }
2698
2737
  // Install/Sync Claude skill (both commands do the same thing)
2699
2738
  if (command === "install-skill" || command === "sync-skill") {
2700
2739
  const path = await import("path");