bitfab-cli 0.2.170 → 0.2.171
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/README.md +2 -0
- package/dist/index.js +200 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,4 +12,6 @@ npx bitfab-cli init --editor cursor # Install for Cursor
|
|
|
12
12
|
npx bitfab-cli session-logs enable # Enable session log collection
|
|
13
13
|
npx bitfab-cli session-logs disable # Disable session log collection
|
|
14
14
|
npx bitfab-cli session-logs status # Show the saved session log setting
|
|
15
|
+
npx bitfab-cli analyze-repo --help # Show help for analyze-repo
|
|
16
|
+
npx bitfab-cli help setup # Show help for setup
|
|
15
17
|
```
|
package/dist/index.js
CHANGED
|
@@ -8816,6 +8816,7 @@ var require_dist = __commonJS({
|
|
|
8816
8816
|
});
|
|
8817
8817
|
|
|
8818
8818
|
// src/index.ts
|
|
8819
|
+
import { pathToFileURL } from "url";
|
|
8819
8820
|
import { cancel as cancel2 } from "@clack/prompts";
|
|
8820
8821
|
|
|
8821
8822
|
// src/init.ts
|
|
@@ -31665,7 +31666,7 @@ function startUpdateCheck() {
|
|
|
31665
31666
|
}
|
|
31666
31667
|
|
|
31667
31668
|
// src/index.ts
|
|
31668
|
-
var
|
|
31669
|
+
var GLOBAL_HELP_TEXT = `Usage: bitfab <command> [options]
|
|
31669
31670
|
|
|
31670
31671
|
Commands:
|
|
31671
31672
|
init [--editor <name>] Full onboarding: plugin-install, login, and setup
|
|
@@ -31698,6 +31699,143 @@ Examples:
|
|
|
31698
31699
|
bitfab setup --skip-permissions Setup without permission prompts
|
|
31699
31700
|
bitfab assistant --skip-permissions Run assistant autonomously
|
|
31700
31701
|
`;
|
|
31702
|
+
var COMMAND_HELP_TEXT = {
|
|
31703
|
+
init: `Usage: bitfab init [--editor <name>] [--skip-permissions | --no-skip-permissions]
|
|
31704
|
+
|
|
31705
|
+
Full onboarding: install the Bitfab plugin, authenticate with Bitfab, and launch setup in the selected editor.
|
|
31706
|
+
|
|
31707
|
+
Options:
|
|
31708
|
+
--editor, -e <name> Target editor: claude, codex, cursor
|
|
31709
|
+
--skip-permissions Skip permission prompts when launching the setup agent
|
|
31710
|
+
--no-skip-permissions Keep permission prompts without being asked
|
|
31711
|
+
|
|
31712
|
+
Examples:
|
|
31713
|
+
bitfab init
|
|
31714
|
+
bitfab init --editor claude
|
|
31715
|
+
bitfab init --editor codex --no-skip-permissions
|
|
31716
|
+
`,
|
|
31717
|
+
"plugin-install": `Usage: bitfab plugin-install [--editor <name>]
|
|
31718
|
+
|
|
31719
|
+
Install the Bitfab plugin in one editor without authenticating or launching setup.
|
|
31720
|
+
|
|
31721
|
+
Options:
|
|
31722
|
+
--editor, -e <name> Target editor: claude, codex, cursor
|
|
31723
|
+
|
|
31724
|
+
Examples:
|
|
31725
|
+
bitfab plugin-install
|
|
31726
|
+
bitfab plugin-install --editor cursor
|
|
31727
|
+
`,
|
|
31728
|
+
login: `Usage: bitfab login
|
|
31729
|
+
|
|
31730
|
+
Authenticate with Bitfab in the browser and save credentials locally.
|
|
31731
|
+
|
|
31732
|
+
Options:
|
|
31733
|
+
This command has no options.
|
|
31734
|
+
|
|
31735
|
+
Examples:
|
|
31736
|
+
bitfab login
|
|
31737
|
+
`,
|
|
31738
|
+
logout: `Usage: bitfab logout
|
|
31739
|
+
|
|
31740
|
+
Remove locally stored Bitfab credentials.
|
|
31741
|
+
|
|
31742
|
+
Options:
|
|
31743
|
+
This command has no options.
|
|
31744
|
+
|
|
31745
|
+
Examples:
|
|
31746
|
+
bitfab logout
|
|
31747
|
+
`,
|
|
31748
|
+
"session-logs": `Usage: bitfab session-logs [status|enable|disable|set true|set false]
|
|
31749
|
+
|
|
31750
|
+
Read or update the saved session-log collection preference used by setup and analyze-repo.
|
|
31751
|
+
|
|
31752
|
+
Arguments:
|
|
31753
|
+
status Show the saved setting (default)
|
|
31754
|
+
enable Enable session log collection
|
|
31755
|
+
disable Disable session log collection
|
|
31756
|
+
set true Enable session log collection
|
|
31757
|
+
set false Disable session log collection
|
|
31758
|
+
|
|
31759
|
+
Examples:
|
|
31760
|
+
bitfab session-logs status
|
|
31761
|
+
bitfab session-logs enable
|
|
31762
|
+
bitfab session-logs disable
|
|
31763
|
+
`,
|
|
31764
|
+
setup: `Usage: bitfab setup [--editor <name>] [--skip-permissions | --no-skip-permissions]
|
|
31765
|
+
|
|
31766
|
+
Launch the Bitfab setup command in the selected editor without reinstalling the plugin.
|
|
31767
|
+
|
|
31768
|
+
Options:
|
|
31769
|
+
--editor, -e <name> Target editor: claude, codex, cursor
|
|
31770
|
+
--skip-permissions Skip permission prompts when launching the setup agent
|
|
31771
|
+
--no-skip-permissions Keep permission prompts without being asked
|
|
31772
|
+
|
|
31773
|
+
Examples:
|
|
31774
|
+
bitfab setup
|
|
31775
|
+
bitfab setup --editor codex
|
|
31776
|
+
bitfab setup --skip-permissions
|
|
31777
|
+
`,
|
|
31778
|
+
"analyze-repo": `Usage: bitfab analyze-repo [--editor <name>] [--limit <n>] [--upload-logs | --no-upload-logs]
|
|
31779
|
+
|
|
31780
|
+
Headlessly scan the repository for AI workflows and upload draft trace plans for the top candidates, with no prompts and no code edits.
|
|
31781
|
+
|
|
31782
|
+
Options:
|
|
31783
|
+
--editor, -e <name> Target editor: claude, codex, cursor
|
|
31784
|
+
--limit <n> Cap how many draft trace plans to upload (default 5)
|
|
31785
|
+
--upload-logs Upload this run's session logs to Bitfab
|
|
31786
|
+
--no-upload-logs Keep this run's session logs local
|
|
31787
|
+
|
|
31788
|
+
Examples:
|
|
31789
|
+
bitfab analyze-repo
|
|
31790
|
+
bitfab analyze-repo --limit 3
|
|
31791
|
+
bitfab analyze-repo --no-upload-logs
|
|
31792
|
+
`,
|
|
31793
|
+
assistant: `Usage: bitfab assistant [--editor <name>] [--skip-permissions | --no-skip-permissions] [args...]
|
|
31794
|
+
|
|
31795
|
+
Launch the Bitfab assistant in the selected editor. Extra arguments are passed through to the editor command.
|
|
31796
|
+
|
|
31797
|
+
Options:
|
|
31798
|
+
--editor, -e <name> Target editor: claude, codex, cursor
|
|
31799
|
+
--skip-permissions Skip permission prompts when launching the assistant agent
|
|
31800
|
+
--no-skip-permissions Keep permission prompts without being asked
|
|
31801
|
+
|
|
31802
|
+
Examples:
|
|
31803
|
+
bitfab assistant
|
|
31804
|
+
bitfab assistant investigate
|
|
31805
|
+
bitfab assistant --editor claude --skip-permissions
|
|
31806
|
+
`,
|
|
31807
|
+
update: `Usage: bitfab update [--editor <name>] [--skip-permissions | --no-skip-permissions] [all|plugin|sdk]
|
|
31808
|
+
|
|
31809
|
+
Update the Bitfab plugin, then launch the SDK update flow in the selected editor.
|
|
31810
|
+
|
|
31811
|
+
Arguments:
|
|
31812
|
+
all Update plugin and SDKs (default)
|
|
31813
|
+
plugin Update only the plugin
|
|
31814
|
+
sdk Update only SDKs
|
|
31815
|
+
|
|
31816
|
+
Options:
|
|
31817
|
+
--editor, -e <name> Target editor: claude, codex, cursor
|
|
31818
|
+
--skip-permissions Skip permission prompts when launching the update agent
|
|
31819
|
+
--no-skip-permissions Keep permission prompts without being asked
|
|
31820
|
+
|
|
31821
|
+
Examples:
|
|
31822
|
+
bitfab update
|
|
31823
|
+
bitfab update plugin
|
|
31824
|
+
bitfab update --editor codex sdk
|
|
31825
|
+
`,
|
|
31826
|
+
help: `Usage: bitfab help [command]
|
|
31827
|
+
|
|
31828
|
+
Show global help or help for a specific command.
|
|
31829
|
+
|
|
31830
|
+
Arguments:
|
|
31831
|
+
command One of: init, plugin-install, login, logout, session-logs, setup, analyze-repo, assistant, update, help
|
|
31832
|
+
|
|
31833
|
+
Examples:
|
|
31834
|
+
bitfab help
|
|
31835
|
+
bitfab help analyze-repo
|
|
31836
|
+
bitfab setup --help
|
|
31837
|
+
`
|
|
31838
|
+
};
|
|
31701
31839
|
function parseLimit(raw) {
|
|
31702
31840
|
const n = Number(raw);
|
|
31703
31841
|
if (!Number.isInteger(n) || n < 1) {
|
|
@@ -31705,9 +31843,39 @@ function parseLimit(raw) {
|
|
|
31705
31843
|
}
|
|
31706
31844
|
return n;
|
|
31707
31845
|
}
|
|
31846
|
+
function isHelpCommand(command) {
|
|
31847
|
+
return command !== void 0 && Object.hasOwn(COMMAND_HELP_TEXT, command);
|
|
31848
|
+
}
|
|
31849
|
+
function getHelpTopic(argv) {
|
|
31850
|
+
const [command, maybeTopic] = argv;
|
|
31851
|
+
if (command === void 0) {
|
|
31852
|
+
return void 0;
|
|
31853
|
+
}
|
|
31854
|
+
if (command === "help") {
|
|
31855
|
+
if (maybeTopic === "-h" || maybeTopic === "--help") {
|
|
31856
|
+
return "help";
|
|
31857
|
+
}
|
|
31858
|
+
return maybeTopic;
|
|
31859
|
+
}
|
|
31860
|
+
if (command === "-h" || command === "--help") {
|
|
31861
|
+
return void 0;
|
|
31862
|
+
}
|
|
31863
|
+
if (argv.includes("-h") || argv.includes("--help")) {
|
|
31864
|
+
return command;
|
|
31865
|
+
}
|
|
31866
|
+
return null;
|
|
31867
|
+
}
|
|
31868
|
+
function getHelpText(topic) {
|
|
31869
|
+
if (topic === void 0) {
|
|
31870
|
+
return GLOBAL_HELP_TEXT;
|
|
31871
|
+
}
|
|
31872
|
+
if (isHelpCommand(topic)) {
|
|
31873
|
+
return COMMAND_HELP_TEXT[topic];
|
|
31874
|
+
}
|
|
31875
|
+
return void 0;
|
|
31876
|
+
}
|
|
31708
31877
|
function wantsHelp(argv) {
|
|
31709
|
-
|
|
31710
|
-
return !command || command === "help" || argv.includes("-h") || argv.includes("--help");
|
|
31878
|
+
return getHelpTopic(argv) !== null;
|
|
31711
31879
|
}
|
|
31712
31880
|
function parseArgs2(argv) {
|
|
31713
31881
|
const [command, ...tail] = argv;
|
|
@@ -31751,13 +31919,23 @@ function parseArgs2(argv) {
|
|
|
31751
31919
|
return { command, editor, skipPermissions, uploadLogs, limit, rest };
|
|
31752
31920
|
}
|
|
31753
31921
|
async function main() {
|
|
31754
|
-
const
|
|
31755
|
-
const
|
|
31756
|
-
if (
|
|
31757
|
-
|
|
31758
|
-
|
|
31922
|
+
const argv = process.argv.slice(2);
|
|
31923
|
+
const helpTopic = getHelpTopic(argv);
|
|
31924
|
+
if (helpTopic !== null) {
|
|
31925
|
+
const helpText = getHelpText(helpTopic);
|
|
31926
|
+
if (helpText === void 0) {
|
|
31927
|
+
process.stderr.write(
|
|
31928
|
+
`Unknown command: ${helpTopic}
|
|
31929
|
+
|
|
31930
|
+
${GLOBAL_HELP_TEXT}`
|
|
31931
|
+
);
|
|
31932
|
+
process.exit(1);
|
|
31933
|
+
}
|
|
31934
|
+
process.stdout.write(helpText);
|
|
31759
31935
|
return;
|
|
31760
31936
|
}
|
|
31937
|
+
const { command, editor, skipPermissions, uploadLogs, limit, rest } = parseArgs2(argv);
|
|
31938
|
+
const abortUpdateCheck = startUpdateCheck();
|
|
31761
31939
|
if (command === "init") {
|
|
31762
31940
|
await runInit({ editor, skipPermissions });
|
|
31763
31941
|
abortUpdateCheck();
|
|
@@ -31805,16 +31983,24 @@ async function main() {
|
|
|
31805
31983
|
}
|
|
31806
31984
|
process.stderr.write(`Unknown command: ${command}
|
|
31807
31985
|
|
|
31808
|
-
${
|
|
31986
|
+
${GLOBAL_HELP_TEXT}`);
|
|
31809
31987
|
abortUpdateCheck();
|
|
31810
31988
|
process.exit(1);
|
|
31811
31989
|
}
|
|
31812
|
-
|
|
31813
|
-
const
|
|
31814
|
-
|
|
31815
|
-
|
|
31816
|
-
|
|
31990
|
+
function isDirectRun() {
|
|
31991
|
+
const entrypoint = process.argv[1];
|
|
31992
|
+
return entrypoint !== void 0 && import.meta.url === pathToFileURL(entrypoint).href;
|
|
31993
|
+
}
|
|
31994
|
+
if (isDirectRun()) {
|
|
31995
|
+
main().catch((err) => {
|
|
31996
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
31997
|
+
cancel2(message);
|
|
31998
|
+
process.exit(1);
|
|
31999
|
+
});
|
|
32000
|
+
}
|
|
31817
32001
|
export {
|
|
32002
|
+
getHelpText,
|
|
32003
|
+
getHelpTopic,
|
|
31818
32004
|
parseArgs2 as parseArgs,
|
|
31819
32005
|
wantsHelp
|
|
31820
32006
|
};
|