bitfab-cli 0.2.3 → 0.2.5

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/index.js +66 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7019,7 +7019,10 @@ function getWindowSizeArgs() {
7019
7019
  return computeWindowArgs(getWorkArea());
7020
7020
  }
7021
7021
  function spawnDetached(command, args) {
7022
- spawn(command, [...args], { detached: true, stdio: "ignore" }).unref();
7022
+ const child = spawn(command, [...args], { detached: true, stdio: "ignore" });
7023
+ child.on("error", () => {
7024
+ });
7025
+ child.unref();
7023
7026
  }
7024
7027
  function openChromiumApp(binaryPath, url2, sizeArgs) {
7025
7028
  spawnDetached(binaryPath, [`--app=${url2}`, ...sizeArgs]);
@@ -27214,25 +27217,31 @@ function runClaudeInstall() {
27214
27217
  }
27215
27218
  p.log.success("Bitfab plugin ready in Claude Code");
27216
27219
  }
27217
- function runClaudeSetup() {
27220
+ function runClaudeSetup(skipPermissions) {
27218
27221
  p.log.info(`Launching ${SETUP_COMMAND}...
27219
27222
  `);
27220
- spawnSync("claude", [SETUP_COMMAND], { stdio: "inherit", ...SHELL_OPTS });
27223
+ const flags = skipPermissions ? ["--dangerously-skip-permissions"] : [];
27224
+ spawnSync("claude", [...flags, SETUP_COMMAND], {
27225
+ stdio: "inherit",
27226
+ ...SHELL_OPTS
27227
+ });
27221
27228
  }
27222
- function runClaudeAssistant(args) {
27229
+ function runClaudeAssistant(args, skipPermissions) {
27223
27230
  const cmd = [ASSISTANT_COMMAND, ...args].join(" ");
27224
27231
  p.log.info(`Launching ${cmd}...
27225
27232
  `);
27226
- spawnSync("claude", [ASSISTANT_COMMAND, ...args], {
27233
+ const flags = skipPermissions ? ["--dangerously-skip-permissions"] : [];
27234
+ spawnSync("claude", [...flags, ASSISTANT_COMMAND, ...args], {
27227
27235
  stdio: "inherit",
27228
27236
  ...SHELL_OPTS
27229
27237
  });
27230
27238
  }
27231
- function runClaudeUpdate(args) {
27239
+ function runClaudeUpdate(args, skipPermissions) {
27232
27240
  const cmd = [UPDATE_COMMAND, ...args].join(" ");
27233
27241
  p.log.info(`Launching ${cmd}...
27234
27242
  `);
27235
- spawnSync("claude", [UPDATE_COMMAND, ...args], {
27243
+ const flags = skipPermissions ? ["--dangerously-skip-permissions"] : [];
27244
+ spawnSync("claude", [...flags, UPDATE_COMMAND, ...args], {
27236
27245
  stdio: "inherit",
27237
27246
  ...SHELL_OPTS
27238
27247
  });
@@ -27313,25 +27322,31 @@ function runCodexInstall() {
27313
27322
  }
27314
27323
  p2.log.success("Bitfab plugin ready in Codex");
27315
27324
  }
27316
- function runCodexSetup() {
27325
+ function runCodexSetup(skipPermissions) {
27317
27326
  p2.log.info(`Launching ${SETUP_COMMAND2}...
27318
27327
  `);
27319
- spawnSync2("codex", [SETUP_COMMAND2], { stdio: "inherit", ...SHELL_OPTS2 });
27328
+ const flags = skipPermissions ? ["--full-auto"] : [];
27329
+ spawnSync2("codex", [...flags, SETUP_COMMAND2], {
27330
+ stdio: "inherit",
27331
+ ...SHELL_OPTS2
27332
+ });
27320
27333
  }
27321
- function runCodexAssistant(args) {
27334
+ function runCodexAssistant(args, skipPermissions) {
27322
27335
  const cmd = [ASSISTANT_COMMAND2, ...args].join(" ");
27323
27336
  p2.log.info(`Launching ${cmd}...
27324
27337
  `);
27325
- spawnSync2("codex", [ASSISTANT_COMMAND2, ...args], {
27338
+ const flags = skipPermissions ? ["--full-auto"] : [];
27339
+ spawnSync2("codex", [...flags, ASSISTANT_COMMAND2, ...args], {
27326
27340
  stdio: "inherit",
27327
27341
  ...SHELL_OPTS2
27328
27342
  });
27329
27343
  }
27330
- function runCodexUpdate(args) {
27344
+ function runCodexUpdate(args, skipPermissions) {
27331
27345
  const cmd = [UPDATE_COMMAND2, ...args].join(" ");
27332
27346
  p2.log.info(`Launching ${cmd}...
27333
27347
  `);
27334
- spawnSync2("codex", [UPDATE_COMMAND2, ...args], {
27348
+ const flags = skipPermissions ? ["--full-auto"] : [];
27349
+ spawnSync2("codex", [...flags, UPDATE_COMMAND2, ...args], {
27335
27350
  stdio: "inherit",
27336
27351
  ...SHELL_OPTS2
27337
27352
  });
@@ -27401,16 +27416,27 @@ function runCursorInstall() {
27401
27416
  windowsHide: true,
27402
27417
  ...SHELL_OPTS3
27403
27418
  });
27419
+ child.on("error", () => {
27420
+ });
27404
27421
  child.unref();
27405
27422
  }
27406
- function runCursorSetup() {
27423
+ function runCursorSetup(skipPermissions) {
27424
+ if (skipPermissions) {
27425
+ p3.log.warn("--skip-permissions is not supported for Cursor");
27426
+ }
27407
27427
  p3.log.info(`To complete setup, run ${SETUP_COMMAND3} in Cursor.`);
27408
27428
  }
27409
- function runCursorAssistant(args) {
27429
+ function runCursorAssistant(args, skipPermissions) {
27430
+ if (skipPermissions) {
27431
+ p3.log.warn("--skip-permissions is not supported for Cursor");
27432
+ }
27410
27433
  const cmd = [ASSISTANT_COMMAND3, ...args].join(" ");
27411
27434
  p3.log.info(`To start the assistant, run ${cmd} in Cursor.`);
27412
27435
  }
27413
- function runCursorUpdate(args) {
27436
+ function runCursorUpdate(args, skipPermissions) {
27437
+ if (skipPermissions) {
27438
+ p3.log.warn("--skip-permissions is not supported for Cursor");
27439
+ }
27414
27440
  const cmd = [UPDATE_COMMAND3, ...args].join(" ");
27415
27441
  p3.log.info(`To update, run ${cmd} in Cursor.`);
27416
27442
  }
@@ -27565,15 +27591,15 @@ async function runInstall(opts) {
27565
27591
  }
27566
27592
  async function runSetup(opts) {
27567
27593
  const chosen = await resolveEditor(opts);
27568
- SETUP_FN[chosen]();
27594
+ SETUP_FN[chosen](opts.skipPermissions);
27569
27595
  }
27570
27596
  async function runAssistant(opts, args) {
27571
27597
  const chosen = await resolveEditor(opts);
27572
- ASSISTANT_FN[chosen](args);
27598
+ ASSISTANT_FN[chosen](args, opts.skipPermissions);
27573
27599
  }
27574
27600
  async function runUpdate2(opts, args) {
27575
27601
  const chosen = await resolveEditor(opts);
27576
- UPDATE_FN[chosen](args);
27602
+ UPDATE_FN[chosen](args, opts.skipPermissions);
27577
27603
  }
27578
27604
  async function runInit(opts) {
27579
27605
  p4.intro("bitfab");
@@ -27587,7 +27613,7 @@ async function runInit(opts) {
27587
27613
  p4.log.step("Signing in to Bitfab");
27588
27614
  await runLoginCommand({ exitOnComplete: false });
27589
27615
  }
27590
- SETUP_FN[chosen]();
27616
+ SETUP_FN[chosen](opts.skipPermissions);
27591
27617
  const detected = detectInstalledEditors();
27592
27618
  const others = detected.filter((e) => e !== chosen);
27593
27619
  if (others.length > 0) {
@@ -27635,20 +27661,21 @@ Commands:
27635
27661
  update [--editor <name>] [args] Launch /bitfab:update in the editor
27636
27662
  help Show this help
27637
27663
 
27638
- Editor names: claude, codex, cursor
27664
+ Options:
27665
+ --editor, -e <name> Target editor: claude, codex, cursor
27666
+ --skip-permissions Skip permission prompts in the launched agent
27639
27667
 
27640
27668
  Examples:
27641
- bitfab init Full setup (detect editor, install, login, setup)
27642
- bitfab init --editor claude Full setup for Claude Code
27643
- bitfab plugin-install Install plugin only
27644
- bitfab login Sign in to Bitfab
27645
- bitfab logout Sign out
27646
- bitfab assistant investigate Investigate traces
27647
- bitfab update plugin Update the Bitfab plugin
27669
+ bitfab init Full setup (detect editor, install, login, setup)
27670
+ bitfab init --editor claude Full setup for Claude Code
27671
+ bitfab assistant investigate Investigate traces
27672
+ bitfab setup --skip-permissions Setup without permission prompts
27673
+ bitfab assistant --skip-permissions Run assistant autonomously
27648
27674
  `;
27649
27675
  function parseArgs(argv) {
27650
27676
  const [command, ...tail] = argv;
27651
27677
  let editor;
27678
+ let skipPermissions = false;
27652
27679
  const rest = [];
27653
27680
  for (let i = 0; i < tail.length; i++) {
27654
27681
  const arg = tail[i];
@@ -27661,24 +27688,28 @@ function parseArgs(argv) {
27661
27688
  }
27662
27689
  } else if (arg?.startsWith("--editor=")) {
27663
27690
  editor = arg.slice("--editor=".length);
27691
+ } else if (arg === "--skip-permissions") {
27692
+ skipPermissions = true;
27664
27693
  } else if (arg !== void 0) {
27665
27694
  rest.push(arg);
27666
27695
  }
27667
27696
  }
27668
- return { command, editor, rest };
27697
+ return { command, editor, skipPermissions, rest };
27669
27698
  }
27670
27699
  async function main() {
27671
- const { command, editor, rest } = parseArgs(process.argv.slice(2));
27700
+ const { command, editor, skipPermissions, rest } = parseArgs(
27701
+ process.argv.slice(2)
27702
+ );
27672
27703
  if (!command || command === "help" || command === "--help" || command === "-h") {
27673
27704
  process.stdout.write(HELP_TEXT);
27674
27705
  return;
27675
27706
  }
27676
27707
  if (command === "init") {
27677
- await runInit({ editor });
27708
+ await runInit({ editor, skipPermissions });
27678
27709
  return;
27679
27710
  }
27680
27711
  if (command === "plugin-install") {
27681
- await runInstall({ editor });
27712
+ await runInstall({ editor, skipPermissions });
27682
27713
  return;
27683
27714
  }
27684
27715
  if (command === "login") {
@@ -27690,15 +27721,15 @@ async function main() {
27690
27721
  return;
27691
27722
  }
27692
27723
  if (command === "setup") {
27693
- await runSetup({ editor });
27724
+ await runSetup({ editor, skipPermissions });
27694
27725
  return;
27695
27726
  }
27696
27727
  if (command === "assistant") {
27697
- await runAssistant({ editor }, rest);
27728
+ await runAssistant({ editor, skipPermissions }, rest);
27698
27729
  return;
27699
27730
  }
27700
27731
  if (command === "update") {
27701
- await runUpdate2({ editor }, rest);
27732
+ await runUpdate2({ editor, skipPermissions }, rest);
27702
27733
  return;
27703
27734
  }
27704
27735
  process.stderr.write(`Unknown command: ${command}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitfab-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Install and configure the Bitfab plugin in Claude Code, Codex, or Cursor.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",