aiblueprint-cli 1.4.44 → 1.4.45
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 +103 -32
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -32265,7 +32265,7 @@ var lib_default = inquirer;
|
|
|
32265
32265
|
// src/commands/setup.ts
|
|
32266
32266
|
var import_fs_extra7 = __toESM(require_lib4(), 1);
|
|
32267
32267
|
import path9 from "path";
|
|
32268
|
-
import
|
|
32268
|
+
import os10 from "os";
|
|
32269
32269
|
|
|
32270
32270
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
32271
32271
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -33508,6 +33508,53 @@ async function createBackup(claudeDir) {
|
|
|
33508
33508
|
return backupPath;
|
|
33509
33509
|
}
|
|
33510
33510
|
|
|
33511
|
+
// src/lib/telemetry.ts
|
|
33512
|
+
import os9 from "os";
|
|
33513
|
+
var TELEMETRY_URL = "https://codelynx.dev/api/cli/events";
|
|
33514
|
+
var isDisabled = () => {
|
|
33515
|
+
return process.env.AIBLUEPRINT_TELEMETRY_DISABLED === "1";
|
|
33516
|
+
};
|
|
33517
|
+
var getBasePayload = () => ({
|
|
33518
|
+
cliVersion: getVersion(),
|
|
33519
|
+
platform: os9.platform(),
|
|
33520
|
+
arch: os9.arch(),
|
|
33521
|
+
nodeVersion: process.version
|
|
33522
|
+
});
|
|
33523
|
+
var pendingRequest = null;
|
|
33524
|
+
function trackEvent(event, data) {
|
|
33525
|
+
if (isDisabled())
|
|
33526
|
+
return;
|
|
33527
|
+
const payload = {
|
|
33528
|
+
...getBasePayload(),
|
|
33529
|
+
event,
|
|
33530
|
+
data
|
|
33531
|
+
};
|
|
33532
|
+
pendingRequest = fetch(TELEMETRY_URL, {
|
|
33533
|
+
method: "POST",
|
|
33534
|
+
headers: { "Content-Type": "application/json" },
|
|
33535
|
+
body: JSON.stringify(payload),
|
|
33536
|
+
signal: AbortSignal.timeout(5000)
|
|
33537
|
+
}).catch(() => {}).then(() => {
|
|
33538
|
+
pendingRequest = null;
|
|
33539
|
+
});
|
|
33540
|
+
}
|
|
33541
|
+
function trackError(error, context) {
|
|
33542
|
+
if (isDisabled())
|
|
33543
|
+
return;
|
|
33544
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
33545
|
+
const stack = error instanceof Error ? error.stack?.slice(0, 500) : undefined;
|
|
33546
|
+
trackEvent("error", {
|
|
33547
|
+
message,
|
|
33548
|
+
stack,
|
|
33549
|
+
...context
|
|
33550
|
+
});
|
|
33551
|
+
}
|
|
33552
|
+
async function flushTelemetry() {
|
|
33553
|
+
if (pendingRequest) {
|
|
33554
|
+
await pendingRequest;
|
|
33555
|
+
}
|
|
33556
|
+
}
|
|
33557
|
+
|
|
33511
33558
|
// src/commands/setup.ts
|
|
33512
33559
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
33513
33560
|
var __dirname2 = dirname2(__filename2);
|
|
@@ -33612,7 +33659,7 @@ async function setupCommand(params = {}) {
|
|
|
33612
33659
|
skipInteractive
|
|
33613
33660
|
};
|
|
33614
33661
|
const s = new SimpleSpinner;
|
|
33615
|
-
const claudeDir = customClaudeCodeFolder ? path9.resolve(customClaudeCodeFolder) : path9.join(
|
|
33662
|
+
const claudeDir = customClaudeCodeFolder ? path9.resolve(customClaudeCodeFolder) : path9.join(os10.homedir(), ".claude");
|
|
33616
33663
|
console.log(source_default.gray(`Installing to: ${claudeDir}`));
|
|
33617
33664
|
await import_fs_extra7.default.ensureDir(claudeDir);
|
|
33618
33665
|
s.start("Creating backup of existing configuration");
|
|
@@ -33722,10 +33769,11 @@ async function setupCommand(params = {}) {
|
|
|
33722
33769
|
await cleanupRepository(repoPath);
|
|
33723
33770
|
s.stop("Cleanup complete");
|
|
33724
33771
|
console.log(source_default.green("✨ Setup complete!"));
|
|
33772
|
+
trackEvent("setup", { features: options });
|
|
33725
33773
|
console.log(source_default.gray(`
|
|
33726
33774
|
Next steps:`));
|
|
33727
33775
|
if (options.shellShortcuts) {
|
|
33728
|
-
const platform =
|
|
33776
|
+
const platform = os10.platform();
|
|
33729
33777
|
if (platform === "win32") {
|
|
33730
33778
|
console.log(source_default.gray(" • Restart PowerShell to load the new functions"));
|
|
33731
33779
|
} else {
|
|
@@ -33738,6 +33786,8 @@ Next steps:`));
|
|
|
33738
33786
|
console.log(source_default.blue(`
|
|
33739
33787
|
\uD83D\uDC8E Want premium features? Get AIBlueprint CLI Pro at https://mlv.sh/claude-cli`));
|
|
33740
33788
|
} catch (error) {
|
|
33789
|
+
trackError(error, { command: "setup" });
|
|
33790
|
+
await flushTelemetry();
|
|
33741
33791
|
console.error(source_default.red(`
|
|
33742
33792
|
❌ Setup failed:`), error);
|
|
33743
33793
|
console.log(source_default.red("Setup failed!"));
|
|
@@ -33751,7 +33801,7 @@ Next steps:`));
|
|
|
33751
33801
|
// src/commands/setup-terminal.ts
|
|
33752
33802
|
var import_fs_extra8 = __toESM(require_lib4(), 1);
|
|
33753
33803
|
import path10 from "path";
|
|
33754
|
-
import
|
|
33804
|
+
import os11 from "os";
|
|
33755
33805
|
import { execSync as execSync3, exec as exec2 } from "child_process";
|
|
33756
33806
|
var OHMYZSH_INSTALL_URL = "https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh";
|
|
33757
33807
|
var INSTALL_TIMEOUT = 120000;
|
|
@@ -33918,7 +33968,7 @@ plugins=(${pluginsString})`;
|
|
|
33918
33968
|
}
|
|
33919
33969
|
async function setupTerminalCommand(options = {}) {
|
|
33920
33970
|
const { skipInteractive, homeDir: customHomeDir } = options;
|
|
33921
|
-
const homeDir = customHomeDir ||
|
|
33971
|
+
const homeDir = customHomeDir || os11.homedir();
|
|
33922
33972
|
try {
|
|
33923
33973
|
console.log(source_default.blue.bold(`
|
|
33924
33974
|
\uD83D\uDDA5️ AIBlueprint Terminal Setup ${source_default.gray(`v${getVersion()}`)}
|
|
@@ -34947,12 +34997,12 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
|
34947
34997
|
};
|
|
34948
34998
|
|
|
34949
34999
|
// src/commands/pro.ts
|
|
34950
|
-
import
|
|
35000
|
+
import os14 from "os";
|
|
34951
35001
|
import path13 from "path";
|
|
34952
35002
|
|
|
34953
35003
|
// src/lib/pro-installer.ts
|
|
34954
35004
|
var import_fs_extra9 = __toESM(require_lib4(), 1);
|
|
34955
|
-
import
|
|
35005
|
+
import os12 from "os";
|
|
34956
35006
|
import path11 from "path";
|
|
34957
35007
|
import { exec as exec3 } from "child_process";
|
|
34958
35008
|
import { promisify as promisify2 } from "util";
|
|
@@ -34960,7 +35010,7 @@ var execAsync2 = promisify2(exec3);
|
|
|
34960
35010
|
var PREMIUM_REPO = "Melvynx/aiblueprint-cli-premium";
|
|
34961
35011
|
var PREMIUM_BRANCH = "main";
|
|
34962
35012
|
function getCacheRepoDir() {
|
|
34963
|
-
return path11.join(
|
|
35013
|
+
return path11.join(os12.homedir(), ".config", "aiblueprint", "pro-repos", "aiblueprint-cli-premium");
|
|
34964
35014
|
}
|
|
34965
35015
|
async function execGitWithAuth(command, token, repoUrl, cwd) {
|
|
34966
35016
|
const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
|
|
@@ -35077,7 +35127,7 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
|
|
|
35077
35127
|
}
|
|
35078
35128
|
async function installProConfigs(options) {
|
|
35079
35129
|
const { githubToken, claudeCodeFolder, onProgress } = options;
|
|
35080
|
-
const claudeFolder = claudeCodeFolder || path11.join(
|
|
35130
|
+
const claudeFolder = claudeCodeFolder || path11.join(os12.homedir(), ".claude");
|
|
35081
35131
|
try {
|
|
35082
35132
|
const cacheConfigDir = await cloneOrUpdateRepo(githubToken);
|
|
35083
35133
|
await copyConfigFromCache(cacheConfigDir, claudeFolder, onProgress);
|
|
@@ -35085,7 +35135,7 @@ async function installProConfigs(options) {
|
|
|
35085
35135
|
} catch (error) {
|
|
35086
35136
|
console.warn("Git caching failed, falling back to API download");
|
|
35087
35137
|
}
|
|
35088
|
-
const tempDir = path11.join(
|
|
35138
|
+
const tempDir = path11.join(os12.tmpdir(), `aiblueprint-premium-${Date.now()}`);
|
|
35089
35139
|
try {
|
|
35090
35140
|
const success = await downloadDirectoryFromPrivateGitHub(PREMIUM_REPO, PREMIUM_BRANCH, "claude-code-config", tempDir, githubToken, onProgress);
|
|
35091
35141
|
if (!success) {
|
|
@@ -35110,15 +35160,15 @@ async function installProConfigs(options) {
|
|
|
35110
35160
|
|
|
35111
35161
|
// src/lib/token-storage.ts
|
|
35112
35162
|
var import_fs_extra10 = __toESM(require_lib4(), 1);
|
|
35113
|
-
import
|
|
35163
|
+
import os13 from "os";
|
|
35114
35164
|
import path12 from "path";
|
|
35115
35165
|
function getConfigDir() {
|
|
35116
|
-
const platform =
|
|
35166
|
+
const platform = os13.platform();
|
|
35117
35167
|
if (platform === "win32") {
|
|
35118
|
-
const appData = process.env.APPDATA || path12.join(
|
|
35168
|
+
const appData = process.env.APPDATA || path12.join(os13.homedir(), "AppData", "Roaming");
|
|
35119
35169
|
return path12.join(appData, "aiblueprint");
|
|
35120
35170
|
} else {
|
|
35121
|
-
const configHome = process.env.XDG_CONFIG_HOME || path12.join(
|
|
35171
|
+
const configHome = process.env.XDG_CONFIG_HOME || path12.join(os13.homedir(), ".config");
|
|
35122
35172
|
return path12.join(configHome, "aiblueprint");
|
|
35123
35173
|
}
|
|
35124
35174
|
}
|
|
@@ -35154,7 +35204,7 @@ async function getToken() {
|
|
|
35154
35204
|
function getTokenInfo() {
|
|
35155
35205
|
return {
|
|
35156
35206
|
path: getTokenFilePath(),
|
|
35157
|
-
platform:
|
|
35207
|
+
platform: os13.platform()
|
|
35158
35208
|
};
|
|
35159
35209
|
}
|
|
35160
35210
|
|
|
@@ -35261,8 +35311,11 @@ async function proActivateCommand(userToken) {
|
|
|
35261
35311
|
M2.info(`Token saved to: ${tokenInfo.path}`);
|
|
35262
35312
|
M2.info(source_default.cyan(`
|
|
35263
35313
|
\uD83D\uDCA1 Next step: Run 'npx aiblueprint-cli@latest claude-code pro setup' to install premium configs`));
|
|
35314
|
+
trackEvent("pro-activate");
|
|
35264
35315
|
Se(source_default.green("✅ Activation complete!"));
|
|
35265
35316
|
} catch (error) {
|
|
35317
|
+
trackError(error, { command: "pro-activate" });
|
|
35318
|
+
await flushTelemetry();
|
|
35266
35319
|
if (error instanceof Error) {
|
|
35267
35320
|
M2.error(error.message);
|
|
35268
35321
|
}
|
|
@@ -35304,7 +35357,7 @@ async function proSetupCommand(options = {}) {
|
|
|
35304
35357
|
Se(source_default.red("❌ Not activated"));
|
|
35305
35358
|
process.exit(1);
|
|
35306
35359
|
}
|
|
35307
|
-
const claudeDir = options.folder ? path13.resolve(options.folder) : path13.join(
|
|
35360
|
+
const claudeDir = options.folder ? path13.resolve(options.folder) : path13.join(os14.homedir(), ".claude");
|
|
35308
35361
|
const spinner = Y2();
|
|
35309
35362
|
const onProgress = (file, type) => {
|
|
35310
35363
|
spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
|
|
@@ -35341,6 +35394,11 @@ async function proSetupCommand(options = {}) {
|
|
|
35341
35394
|
spinner.start("Counting installed items...");
|
|
35342
35395
|
const counts = await countInstalledItems(claudeDir);
|
|
35343
35396
|
spinner.stop("Installation summary ready");
|
|
35397
|
+
trackEvent("pro-setup", {
|
|
35398
|
+
commands: counts.commands,
|
|
35399
|
+
agents: counts.agents,
|
|
35400
|
+
skills: counts.skills
|
|
35401
|
+
});
|
|
35344
35402
|
M2.success("✅ Setup complete!");
|
|
35345
35403
|
M2.info("Installed:");
|
|
35346
35404
|
M2.info(` • Commands (${counts.commands})`);
|
|
@@ -35351,6 +35409,8 @@ async function proSetupCommand(options = {}) {
|
|
|
35351
35409
|
M2.info(" • Settings.json with hooks and statusline");
|
|
35352
35410
|
Se(source_default.green("\uD83D\uDE80 Ready to use!"));
|
|
35353
35411
|
} catch (error) {
|
|
35412
|
+
trackError(error, { command: "pro-setup" });
|
|
35413
|
+
await flushTelemetry();
|
|
35354
35414
|
if (error instanceof Error) {
|
|
35355
35415
|
M2.error(error.message);
|
|
35356
35416
|
}
|
|
@@ -35375,8 +35435,11 @@ async function proUpdateCommand(options = {}) {
|
|
|
35375
35435
|
claudeCodeFolder: options.folder
|
|
35376
35436
|
});
|
|
35377
35437
|
spinner.stop("Premium configurations updated");
|
|
35438
|
+
trackEvent("pro-update");
|
|
35378
35439
|
Se(source_default.green("✅ Update completed"));
|
|
35379
35440
|
} catch (error) {
|
|
35441
|
+
trackError(error, { command: "pro-update" });
|
|
35442
|
+
await flushTelemetry();
|
|
35380
35443
|
if (error instanceof Error) {
|
|
35381
35444
|
M2.error(error.message);
|
|
35382
35445
|
}
|
|
@@ -35386,7 +35449,7 @@ async function proUpdateCommand(options = {}) {
|
|
|
35386
35449
|
}
|
|
35387
35450
|
|
|
35388
35451
|
// src/commands/sync.ts
|
|
35389
|
-
import
|
|
35452
|
+
import os15 from "os";
|
|
35390
35453
|
import path15 from "path";
|
|
35391
35454
|
|
|
35392
35455
|
// src/lib/sync-utils.ts
|
|
@@ -35873,7 +35936,7 @@ async function proSyncCommand(options = {}) {
|
|
|
35873
35936
|
Se(source_default.red("❌ Not activated"));
|
|
35874
35937
|
process.exit(1);
|
|
35875
35938
|
}
|
|
35876
|
-
const claudeDir = options.folder ? path15.resolve(options.folder) : path15.join(
|
|
35939
|
+
const claudeDir = options.folder ? path15.resolve(options.folder) : path15.join(os15.homedir(), ".claude");
|
|
35877
35940
|
const spinner = Y2();
|
|
35878
35941
|
spinner.start("Analyzing changes...");
|
|
35879
35942
|
const result = await analyzeSyncChanges(claudeDir, githubToken);
|
|
@@ -36107,8 +36170,16 @@ async function proSyncCommand(options = {}) {
|
|
|
36107
36170
|
await installScriptsDependencies(claudeDir);
|
|
36108
36171
|
spinner.stop("Scripts dependencies installed");
|
|
36109
36172
|
}
|
|
36173
|
+
trackEvent("pro-sync", {
|
|
36174
|
+
added: syncResult.success,
|
|
36175
|
+
deleted: syncResult.deleted,
|
|
36176
|
+
failed: syncResult.failed,
|
|
36177
|
+
hookssynced: selectedHooks.length
|
|
36178
|
+
});
|
|
36110
36179
|
Se(source_default.green("✅ Sync completed"));
|
|
36111
36180
|
} catch (error) {
|
|
36181
|
+
trackError(error, { command: "pro-sync" });
|
|
36182
|
+
await flushTelemetry();
|
|
36112
36183
|
if (error instanceof Error) {
|
|
36113
36184
|
M2.error(error.message);
|
|
36114
36185
|
}
|
|
@@ -36118,7 +36189,7 @@ async function proSyncCommand(options = {}) {
|
|
|
36118
36189
|
}
|
|
36119
36190
|
|
|
36120
36191
|
// src/commands/backup.ts
|
|
36121
|
-
import
|
|
36192
|
+
import os16 from "os";
|
|
36122
36193
|
import path16 from "path";
|
|
36123
36194
|
function formatBackupDate(date) {
|
|
36124
36195
|
const now = new Date;
|
|
@@ -36139,7 +36210,7 @@ function formatBackupDate(date) {
|
|
|
36139
36210
|
return `${date.toLocaleString()} (${relative})`;
|
|
36140
36211
|
}
|
|
36141
36212
|
async function backupLoadCommand(options = {}) {
|
|
36142
|
-
const claudeDir = options.folder || path16.join(
|
|
36213
|
+
const claudeDir = options.folder || path16.join(os16.homedir(), ".claude");
|
|
36143
36214
|
Ie(source_default.blue("\uD83D\uDCE6 Load Backup"));
|
|
36144
36215
|
const spinner = Y2();
|
|
36145
36216
|
spinner.start("Scanning for backups...");
|
|
@@ -36195,19 +36266,19 @@ async function backupLoadCommand(options = {}) {
|
|
|
36195
36266
|
}
|
|
36196
36267
|
|
|
36197
36268
|
// src/commands/openclaw-pro.ts
|
|
36198
|
-
import
|
|
36269
|
+
import os19 from "os";
|
|
36199
36270
|
import path19 from "path";
|
|
36200
36271
|
|
|
36201
36272
|
// src/lib/openclaw-installer.ts
|
|
36202
36273
|
var import_fs_extra13 = __toESM(require_lib4(), 1);
|
|
36203
|
-
import
|
|
36274
|
+
import os17 from "os";
|
|
36204
36275
|
import path17 from "path";
|
|
36205
36276
|
import { exec as exec4 } from "child_process";
|
|
36206
36277
|
import { promisify as promisify3 } from "util";
|
|
36207
36278
|
var execAsync3 = promisify3(exec4);
|
|
36208
36279
|
var OPENCLAW_PRO_REPO = "Melvynx/openclawpro";
|
|
36209
36280
|
function getCacheRepoDir2() {
|
|
36210
|
-
return path17.join(
|
|
36281
|
+
return path17.join(os17.homedir(), ".config", "openclaw", "pro-repos", "openclawpro");
|
|
36211
36282
|
}
|
|
36212
36283
|
async function execGitWithAuth2(command, token, repoUrl, cwd) {
|
|
36213
36284
|
const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
|
|
@@ -36256,7 +36327,7 @@ async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
|
|
|
36256
36327
|
}
|
|
36257
36328
|
async function installOpenclawProConfigs(options) {
|
|
36258
36329
|
const { githubToken, openclawFolder, onProgress } = options;
|
|
36259
|
-
const targetFolder = openclawFolder || path17.join(
|
|
36330
|
+
const targetFolder = openclawFolder || path17.join(os17.homedir(), ".openclaw");
|
|
36260
36331
|
try {
|
|
36261
36332
|
const cacheConfigDir = await cloneOrUpdateRepo2(githubToken);
|
|
36262
36333
|
await copyConfigFromCache2(cacheConfigDir, targetFolder, onProgress);
|
|
@@ -36268,14 +36339,14 @@ async function installOpenclawProConfigs(options) {
|
|
|
36268
36339
|
|
|
36269
36340
|
// src/lib/openclaw-token-storage.ts
|
|
36270
36341
|
var import_fs_extra14 = __toESM(require_lib4(), 1);
|
|
36271
|
-
import
|
|
36342
|
+
import os18 from "os";
|
|
36272
36343
|
import path18 from "path";
|
|
36273
36344
|
function getConfigDir2() {
|
|
36274
|
-
const platform =
|
|
36345
|
+
const platform = os18.platform();
|
|
36275
36346
|
if (platform === "win32") {
|
|
36276
|
-
return path18.join(process.env.APPDATA ||
|
|
36347
|
+
return path18.join(process.env.APPDATA || os18.homedir(), "openclaw");
|
|
36277
36348
|
}
|
|
36278
|
-
return path18.join(
|
|
36349
|
+
return path18.join(os18.homedir(), ".config", "openclaw");
|
|
36279
36350
|
}
|
|
36280
36351
|
function getTokenPath() {
|
|
36281
36352
|
return path18.join(getConfigDir2(), "token.txt");
|
|
@@ -36296,7 +36367,7 @@ async function getOpenclawToken() {
|
|
|
36296
36367
|
function getOpenclawTokenInfo() {
|
|
36297
36368
|
return {
|
|
36298
36369
|
path: getTokenPath(),
|
|
36299
|
-
platform:
|
|
36370
|
+
platform: os18.platform()
|
|
36300
36371
|
};
|
|
36301
36372
|
}
|
|
36302
36373
|
|
|
@@ -36408,7 +36479,7 @@ async function openclawProSetupCommand(options = {}) {
|
|
|
36408
36479
|
Se(source_default.red("❌ Not activated"));
|
|
36409
36480
|
process.exit(1);
|
|
36410
36481
|
}
|
|
36411
|
-
const openclawDir = options.folder ? path19.resolve(options.folder) : path19.join(
|
|
36482
|
+
const openclawDir = options.folder ? path19.resolve(options.folder) : path19.join(os19.homedir(), ".openclaw");
|
|
36412
36483
|
const spinner = Y2();
|
|
36413
36484
|
const onProgress = (file, type) => {
|
|
36414
36485
|
spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
|
|
@@ -36582,10 +36653,10 @@ var import_fs_extra17 = __toESM(require_lib4(), 1);
|
|
|
36582
36653
|
import { spawn as spawn2 } from "child_process";
|
|
36583
36654
|
import { execSync as execSync4 } from "child_process";
|
|
36584
36655
|
import path21 from "path";
|
|
36585
|
-
import
|
|
36656
|
+
import os20 from "os";
|
|
36586
36657
|
function checkCommand2(cmd) {
|
|
36587
36658
|
try {
|
|
36588
|
-
const isWindows2 =
|
|
36659
|
+
const isWindows2 = os20.platform() === "win32";
|
|
36589
36660
|
const whichCmd = isWindows2 ? `where ${cmd}` : `which ${cmd}`;
|
|
36590
36661
|
execSync4(whichCmd, { stdio: "ignore" });
|
|
36591
36662
|
return true;
|