bitfab-cli 0.2.4 → 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.
- package/dist/index.js +60 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27217,25 +27217,31 @@ function runClaudeInstall() {
|
|
|
27217
27217
|
}
|
|
27218
27218
|
p.log.success("Bitfab plugin ready in Claude Code");
|
|
27219
27219
|
}
|
|
27220
|
-
function runClaudeSetup() {
|
|
27220
|
+
function runClaudeSetup(skipPermissions) {
|
|
27221
27221
|
p.log.info(`Launching ${SETUP_COMMAND}...
|
|
27222
27222
|
`);
|
|
27223
|
-
|
|
27223
|
+
const flags = skipPermissions ? ["--dangerously-skip-permissions"] : [];
|
|
27224
|
+
spawnSync("claude", [...flags, SETUP_COMMAND], {
|
|
27225
|
+
stdio: "inherit",
|
|
27226
|
+
...SHELL_OPTS
|
|
27227
|
+
});
|
|
27224
27228
|
}
|
|
27225
|
-
function runClaudeAssistant(args) {
|
|
27229
|
+
function runClaudeAssistant(args, skipPermissions) {
|
|
27226
27230
|
const cmd = [ASSISTANT_COMMAND, ...args].join(" ");
|
|
27227
27231
|
p.log.info(`Launching ${cmd}...
|
|
27228
27232
|
`);
|
|
27229
|
-
|
|
27233
|
+
const flags = skipPermissions ? ["--dangerously-skip-permissions"] : [];
|
|
27234
|
+
spawnSync("claude", [...flags, ASSISTANT_COMMAND, ...args], {
|
|
27230
27235
|
stdio: "inherit",
|
|
27231
27236
|
...SHELL_OPTS
|
|
27232
27237
|
});
|
|
27233
27238
|
}
|
|
27234
|
-
function runClaudeUpdate(args) {
|
|
27239
|
+
function runClaudeUpdate(args, skipPermissions) {
|
|
27235
27240
|
const cmd = [UPDATE_COMMAND, ...args].join(" ");
|
|
27236
27241
|
p.log.info(`Launching ${cmd}...
|
|
27237
27242
|
`);
|
|
27238
|
-
|
|
27243
|
+
const flags = skipPermissions ? ["--dangerously-skip-permissions"] : [];
|
|
27244
|
+
spawnSync("claude", [...flags, UPDATE_COMMAND, ...args], {
|
|
27239
27245
|
stdio: "inherit",
|
|
27240
27246
|
...SHELL_OPTS
|
|
27241
27247
|
});
|
|
@@ -27316,25 +27322,31 @@ function runCodexInstall() {
|
|
|
27316
27322
|
}
|
|
27317
27323
|
p2.log.success("Bitfab plugin ready in Codex");
|
|
27318
27324
|
}
|
|
27319
|
-
function runCodexSetup() {
|
|
27325
|
+
function runCodexSetup(skipPermissions) {
|
|
27320
27326
|
p2.log.info(`Launching ${SETUP_COMMAND2}...
|
|
27321
27327
|
`);
|
|
27322
|
-
|
|
27328
|
+
const flags = skipPermissions ? ["--full-auto"] : [];
|
|
27329
|
+
spawnSync2("codex", [...flags, SETUP_COMMAND2], {
|
|
27330
|
+
stdio: "inherit",
|
|
27331
|
+
...SHELL_OPTS2
|
|
27332
|
+
});
|
|
27323
27333
|
}
|
|
27324
|
-
function runCodexAssistant(args) {
|
|
27334
|
+
function runCodexAssistant(args, skipPermissions) {
|
|
27325
27335
|
const cmd = [ASSISTANT_COMMAND2, ...args].join(" ");
|
|
27326
27336
|
p2.log.info(`Launching ${cmd}...
|
|
27327
27337
|
`);
|
|
27328
|
-
|
|
27338
|
+
const flags = skipPermissions ? ["--full-auto"] : [];
|
|
27339
|
+
spawnSync2("codex", [...flags, ASSISTANT_COMMAND2, ...args], {
|
|
27329
27340
|
stdio: "inherit",
|
|
27330
27341
|
...SHELL_OPTS2
|
|
27331
27342
|
});
|
|
27332
27343
|
}
|
|
27333
|
-
function runCodexUpdate(args) {
|
|
27344
|
+
function runCodexUpdate(args, skipPermissions) {
|
|
27334
27345
|
const cmd = [UPDATE_COMMAND2, ...args].join(" ");
|
|
27335
27346
|
p2.log.info(`Launching ${cmd}...
|
|
27336
27347
|
`);
|
|
27337
|
-
|
|
27348
|
+
const flags = skipPermissions ? ["--full-auto"] : [];
|
|
27349
|
+
spawnSync2("codex", [...flags, UPDATE_COMMAND2, ...args], {
|
|
27338
27350
|
stdio: "inherit",
|
|
27339
27351
|
...SHELL_OPTS2
|
|
27340
27352
|
});
|
|
@@ -27408,14 +27420,23 @@ function runCursorInstall() {
|
|
|
27408
27420
|
});
|
|
27409
27421
|
child.unref();
|
|
27410
27422
|
}
|
|
27411
|
-
function runCursorSetup() {
|
|
27423
|
+
function runCursorSetup(skipPermissions) {
|
|
27424
|
+
if (skipPermissions) {
|
|
27425
|
+
p3.log.warn("--skip-permissions is not supported for Cursor");
|
|
27426
|
+
}
|
|
27412
27427
|
p3.log.info(`To complete setup, run ${SETUP_COMMAND3} in Cursor.`);
|
|
27413
27428
|
}
|
|
27414
|
-
function runCursorAssistant(args) {
|
|
27429
|
+
function runCursorAssistant(args, skipPermissions) {
|
|
27430
|
+
if (skipPermissions) {
|
|
27431
|
+
p3.log.warn("--skip-permissions is not supported for Cursor");
|
|
27432
|
+
}
|
|
27415
27433
|
const cmd = [ASSISTANT_COMMAND3, ...args].join(" ");
|
|
27416
27434
|
p3.log.info(`To start the assistant, run ${cmd} in Cursor.`);
|
|
27417
27435
|
}
|
|
27418
|
-
function runCursorUpdate(args) {
|
|
27436
|
+
function runCursorUpdate(args, skipPermissions) {
|
|
27437
|
+
if (skipPermissions) {
|
|
27438
|
+
p3.log.warn("--skip-permissions is not supported for Cursor");
|
|
27439
|
+
}
|
|
27419
27440
|
const cmd = [UPDATE_COMMAND3, ...args].join(" ");
|
|
27420
27441
|
p3.log.info(`To update, run ${cmd} in Cursor.`);
|
|
27421
27442
|
}
|
|
@@ -27570,15 +27591,15 @@ async function runInstall(opts) {
|
|
|
27570
27591
|
}
|
|
27571
27592
|
async function runSetup(opts) {
|
|
27572
27593
|
const chosen = await resolveEditor(opts);
|
|
27573
|
-
SETUP_FN[chosen]();
|
|
27594
|
+
SETUP_FN[chosen](opts.skipPermissions);
|
|
27574
27595
|
}
|
|
27575
27596
|
async function runAssistant(opts, args) {
|
|
27576
27597
|
const chosen = await resolveEditor(opts);
|
|
27577
|
-
ASSISTANT_FN[chosen](args);
|
|
27598
|
+
ASSISTANT_FN[chosen](args, opts.skipPermissions);
|
|
27578
27599
|
}
|
|
27579
27600
|
async function runUpdate2(opts, args) {
|
|
27580
27601
|
const chosen = await resolveEditor(opts);
|
|
27581
|
-
UPDATE_FN[chosen](args);
|
|
27602
|
+
UPDATE_FN[chosen](args, opts.skipPermissions);
|
|
27582
27603
|
}
|
|
27583
27604
|
async function runInit(opts) {
|
|
27584
27605
|
p4.intro("bitfab");
|
|
@@ -27592,7 +27613,7 @@ async function runInit(opts) {
|
|
|
27592
27613
|
p4.log.step("Signing in to Bitfab");
|
|
27593
27614
|
await runLoginCommand({ exitOnComplete: false });
|
|
27594
27615
|
}
|
|
27595
|
-
SETUP_FN[chosen]();
|
|
27616
|
+
SETUP_FN[chosen](opts.skipPermissions);
|
|
27596
27617
|
const detected = detectInstalledEditors();
|
|
27597
27618
|
const others = detected.filter((e) => e !== chosen);
|
|
27598
27619
|
if (others.length > 0) {
|
|
@@ -27640,20 +27661,21 @@ Commands:
|
|
|
27640
27661
|
update [--editor <name>] [args] Launch /bitfab:update in the editor
|
|
27641
27662
|
help Show this help
|
|
27642
27663
|
|
|
27643
|
-
|
|
27664
|
+
Options:
|
|
27665
|
+
--editor, -e <name> Target editor: claude, codex, cursor
|
|
27666
|
+
--skip-permissions Skip permission prompts in the launched agent
|
|
27644
27667
|
|
|
27645
27668
|
Examples:
|
|
27646
|
-
bitfab init
|
|
27647
|
-
bitfab init --editor claude
|
|
27648
|
-
bitfab
|
|
27649
|
-
bitfab
|
|
27650
|
-
bitfab
|
|
27651
|
-
bitfab assistant investigate Investigate traces
|
|
27652
|
-
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
|
|
27653
27674
|
`;
|
|
27654
27675
|
function parseArgs(argv) {
|
|
27655
27676
|
const [command, ...tail] = argv;
|
|
27656
27677
|
let editor;
|
|
27678
|
+
let skipPermissions = false;
|
|
27657
27679
|
const rest = [];
|
|
27658
27680
|
for (let i = 0; i < tail.length; i++) {
|
|
27659
27681
|
const arg = tail[i];
|
|
@@ -27666,24 +27688,28 @@ function parseArgs(argv) {
|
|
|
27666
27688
|
}
|
|
27667
27689
|
} else if (arg?.startsWith("--editor=")) {
|
|
27668
27690
|
editor = arg.slice("--editor=".length);
|
|
27691
|
+
} else if (arg === "--skip-permissions") {
|
|
27692
|
+
skipPermissions = true;
|
|
27669
27693
|
} else if (arg !== void 0) {
|
|
27670
27694
|
rest.push(arg);
|
|
27671
27695
|
}
|
|
27672
27696
|
}
|
|
27673
|
-
return { command, editor, rest };
|
|
27697
|
+
return { command, editor, skipPermissions, rest };
|
|
27674
27698
|
}
|
|
27675
27699
|
async function main() {
|
|
27676
|
-
const { command, editor, rest } = parseArgs(
|
|
27700
|
+
const { command, editor, skipPermissions, rest } = parseArgs(
|
|
27701
|
+
process.argv.slice(2)
|
|
27702
|
+
);
|
|
27677
27703
|
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
27678
27704
|
process.stdout.write(HELP_TEXT);
|
|
27679
27705
|
return;
|
|
27680
27706
|
}
|
|
27681
27707
|
if (command === "init") {
|
|
27682
|
-
await runInit({ editor });
|
|
27708
|
+
await runInit({ editor, skipPermissions });
|
|
27683
27709
|
return;
|
|
27684
27710
|
}
|
|
27685
27711
|
if (command === "plugin-install") {
|
|
27686
|
-
await runInstall({ editor });
|
|
27712
|
+
await runInstall({ editor, skipPermissions });
|
|
27687
27713
|
return;
|
|
27688
27714
|
}
|
|
27689
27715
|
if (command === "login") {
|
|
@@ -27695,15 +27721,15 @@ async function main() {
|
|
|
27695
27721
|
return;
|
|
27696
27722
|
}
|
|
27697
27723
|
if (command === "setup") {
|
|
27698
|
-
await runSetup({ editor });
|
|
27724
|
+
await runSetup({ editor, skipPermissions });
|
|
27699
27725
|
return;
|
|
27700
27726
|
}
|
|
27701
27727
|
if (command === "assistant") {
|
|
27702
|
-
await runAssistant({ editor }, rest);
|
|
27728
|
+
await runAssistant({ editor, skipPermissions }, rest);
|
|
27703
27729
|
return;
|
|
27704
27730
|
}
|
|
27705
27731
|
if (command === "update") {
|
|
27706
|
-
await runUpdate2({ editor }, rest);
|
|
27732
|
+
await runUpdate2({ editor, skipPermissions }, rest);
|
|
27707
27733
|
return;
|
|
27708
27734
|
}
|
|
27709
27735
|
process.stderr.write(`Unknown command: ${command}
|