bitfab-cli 0.2.2 → 0.2.4

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 +96 -8
  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]);
@@ -27178,6 +27181,8 @@ var REPO = "Project-White-Rabbit/bitfab-claude-plugin";
27178
27181
  var MARKETPLACE = "bitfab";
27179
27182
  var PLUGIN_KEY = "bitfab@bitfab";
27180
27183
  var SETUP_COMMAND = "/bitfab:setup";
27184
+ var ASSISTANT_COMMAND = "/bitfab:assistant";
27185
+ var UPDATE_COMMAND = "/bitfab:update";
27181
27186
  var SHELL_OPTS = process.platform === "win32" ? { shell: true } : {};
27182
27187
  function runClaudeInstall() {
27183
27188
  const s = p.spinner();
@@ -27217,6 +27222,24 @@ function runClaudeSetup() {
27217
27222
  `);
27218
27223
  spawnSync("claude", [SETUP_COMMAND], { stdio: "inherit", ...SHELL_OPTS });
27219
27224
  }
27225
+ function runClaudeAssistant(args) {
27226
+ const cmd = [ASSISTANT_COMMAND, ...args].join(" ");
27227
+ p.log.info(`Launching ${cmd}...
27228
+ `);
27229
+ spawnSync("claude", [ASSISTANT_COMMAND, ...args], {
27230
+ stdio: "inherit",
27231
+ ...SHELL_OPTS
27232
+ });
27233
+ }
27234
+ function runClaudeUpdate(args) {
27235
+ const cmd = [UPDATE_COMMAND, ...args].join(" ");
27236
+ p.log.info(`Launching ${cmd}...
27237
+ `);
27238
+ spawnSync("claude", [UPDATE_COMMAND, ...args], {
27239
+ stdio: "inherit",
27240
+ ...SHELL_OPTS
27241
+ });
27242
+ }
27220
27243
  function runClaude(args) {
27221
27244
  const result = spawnSync("claude", [...args], {
27222
27245
  stdio: "pipe",
@@ -27261,6 +27284,8 @@ import * as p2 from "@clack/prompts";
27261
27284
  var REPO2 = "Project-White-Rabbit/bitfab-codex-plugin";
27262
27285
  var PLUGIN_KEY2 = "bitfab@bitfab";
27263
27286
  var SETUP_COMMAND2 = "$bitfab:setup";
27287
+ var ASSISTANT_COMMAND2 = "$bitfab:assistant";
27288
+ var UPDATE_COMMAND2 = "$bitfab:update";
27264
27289
  var SHELL_OPTS2 = process.platform === "win32" ? { shell: true } : {};
27265
27290
  function runCodexInstall() {
27266
27291
  const s = p2.spinner();
@@ -27296,6 +27321,24 @@ function runCodexSetup() {
27296
27321
  `);
27297
27322
  spawnSync2("codex", [SETUP_COMMAND2], { stdio: "inherit", ...SHELL_OPTS2 });
27298
27323
  }
27324
+ function runCodexAssistant(args) {
27325
+ const cmd = [ASSISTANT_COMMAND2, ...args].join(" ");
27326
+ p2.log.info(`Launching ${cmd}...
27327
+ `);
27328
+ spawnSync2("codex", [ASSISTANT_COMMAND2, ...args], {
27329
+ stdio: "inherit",
27330
+ ...SHELL_OPTS2
27331
+ });
27332
+ }
27333
+ function runCodexUpdate(args) {
27334
+ const cmd = [UPDATE_COMMAND2, ...args].join(" ");
27335
+ p2.log.info(`Launching ${cmd}...
27336
+ `);
27337
+ spawnSync2("codex", [UPDATE_COMMAND2, ...args], {
27338
+ stdio: "inherit",
27339
+ ...SHELL_OPTS2
27340
+ });
27341
+ }
27299
27342
  function enableCodexPlugin(configPath) {
27300
27343
  let content = "";
27301
27344
  if (fs16.existsSync(configPath)) {
@@ -27337,6 +27380,8 @@ import * as p3 from "@clack/prompts";
27337
27380
  var REPO3 = "Project-White-Rabbit/bitfab-cursor-plugin";
27338
27381
  var ADD_PLUGIN_CMD = `/add-plugin ${REPO3}`;
27339
27382
  var SETUP_COMMAND3 = "/bitfab-setup";
27383
+ var ASSISTANT_COMMAND3 = "/bitfab-assistant";
27384
+ var UPDATE_COMMAND3 = "/bitfab-update";
27340
27385
  var SHELL_OPTS3 = process.platform === "win32" ? { shell: true } : {};
27341
27386
  function runCursorInstall() {
27342
27387
  const copied = copyToClipboard(ADD_PLUGIN_CMD);
@@ -27359,11 +27404,21 @@ function runCursorInstall() {
27359
27404
  windowsHide: true,
27360
27405
  ...SHELL_OPTS3
27361
27406
  });
27407
+ child.on("error", () => {
27408
+ });
27362
27409
  child.unref();
27363
27410
  }
27364
27411
  function runCursorSetup() {
27365
27412
  p3.log.info(`To complete setup, run ${SETUP_COMMAND3} in Cursor.`);
27366
27413
  }
27414
+ function runCursorAssistant(args) {
27415
+ const cmd = [ASSISTANT_COMMAND3, ...args].join(" ");
27416
+ p3.log.info(`To start the assistant, run ${cmd} in Cursor.`);
27417
+ }
27418
+ function runCursorUpdate(args) {
27419
+ const cmd = [UPDATE_COMMAND3, ...args].join(" ");
27420
+ p3.log.info(`To update, run ${cmd} in Cursor.`);
27421
+ }
27367
27422
  function copyToClipboard(text) {
27368
27423
  const cmd = clipboardCommand();
27369
27424
  if (!cmd) {
@@ -27441,6 +27496,16 @@ var SETUP_FN = {
27441
27496
  codex: runCodexSetup,
27442
27497
  cursor: runCursorSetup
27443
27498
  };
27499
+ var ASSISTANT_FN = {
27500
+ claude: runClaudeAssistant,
27501
+ codex: runCodexAssistant,
27502
+ cursor: runCursorAssistant
27503
+ };
27504
+ var UPDATE_FN = {
27505
+ claude: runClaudeUpdate,
27506
+ codex: runCodexUpdate,
27507
+ cursor: runCursorUpdate
27508
+ };
27444
27509
  function detectInstalledEditors() {
27445
27510
  return EDITORS.filter((e) => isOnPath(e));
27446
27511
  }
@@ -27507,6 +27572,14 @@ async function runSetup(opts) {
27507
27572
  const chosen = await resolveEditor(opts);
27508
27573
  SETUP_FN[chosen]();
27509
27574
  }
27575
+ async function runAssistant(opts, args) {
27576
+ const chosen = await resolveEditor(opts);
27577
+ ASSISTANT_FN[chosen](args);
27578
+ }
27579
+ async function runUpdate2(opts, args) {
27580
+ const chosen = await resolveEditor(opts);
27581
+ UPDATE_FN[chosen](args);
27582
+ }
27510
27583
  async function runInit(opts) {
27511
27584
  p4.intro("bitfab");
27512
27585
  const chosen = await resolveEditor(opts);
@@ -27563,6 +27636,8 @@ Commands:
27563
27636
  login Authenticate with Bitfab (opens browser)
27564
27637
  logout Remove stored credentials
27565
27638
  setup [--editor <name>] Launch /bitfab:setup in the editor
27639
+ assistant [--editor <name>] [args] Launch /bitfab:assistant in the editor
27640
+ update [--editor <name>] [args] Launch /bitfab:update in the editor
27566
27641
  help Show this help
27567
27642
 
27568
27643
  Editor names: claude, codex, cursor
@@ -27573,27 +27648,32 @@ Examples:
27573
27648
  bitfab plugin-install Install plugin only
27574
27649
  bitfab login Sign in to Bitfab
27575
27650
  bitfab logout Sign out
27651
+ bitfab assistant investigate Investigate traces
27652
+ bitfab update plugin Update the Bitfab plugin
27576
27653
  `;
27577
27654
  function parseArgs(argv) {
27578
- const [command, ...rest] = argv;
27655
+ const [command, ...tail] = argv;
27579
27656
  let editor;
27580
- for (let i = 0; i < rest.length; i++) {
27581
- const arg = rest[i];
27657
+ const rest = [];
27658
+ for (let i = 0; i < tail.length; i++) {
27659
+ const arg = tail[i];
27582
27660
  if (arg === "--editor" || arg === "-e") {
27583
- if (i + 1 < rest.length) {
27584
- editor = rest[i + 1];
27661
+ if (i + 1 < tail.length) {
27662
+ editor = tail[i + 1];
27585
27663
  i++;
27586
27664
  } else {
27587
27665
  throw new Error("--editor flag requires a value");
27588
27666
  }
27589
27667
  } else if (arg?.startsWith("--editor=")) {
27590
27668
  editor = arg.slice("--editor=".length);
27669
+ } else if (arg !== void 0) {
27670
+ rest.push(arg);
27591
27671
  }
27592
27672
  }
27593
- return { command, editor };
27673
+ return { command, editor, rest };
27594
27674
  }
27595
27675
  async function main() {
27596
- const { command, editor } = parseArgs(process.argv.slice(2));
27676
+ const { command, editor, rest } = parseArgs(process.argv.slice(2));
27597
27677
  if (!command || command === "help" || command === "--help" || command === "-h") {
27598
27678
  process.stdout.write(HELP_TEXT);
27599
27679
  return;
@@ -27618,6 +27698,14 @@ async function main() {
27618
27698
  await runSetup({ editor });
27619
27699
  return;
27620
27700
  }
27701
+ if (command === "assistant") {
27702
+ await runAssistant({ editor }, rest);
27703
+ return;
27704
+ }
27705
+ if (command === "update") {
27706
+ await runUpdate2({ editor }, rest);
27707
+ return;
27708
+ }
27621
27709
  process.stderr.write(`Unknown command: ${command}
27622
27710
 
27623
27711
  ${HELP_TEXT}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitfab-cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
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",