aiblueprint-cli 1.4.19 → 1.4.20
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 +106 -180
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -32251,7 +32251,7 @@ var lib_default = inquirer;
|
|
|
32251
32251
|
// src/commands/setup.ts
|
|
32252
32252
|
var import_fs_extra6 = __toESM(require_lib4(), 1);
|
|
32253
32253
|
import path8 from "path";
|
|
32254
|
-
import
|
|
32254
|
+
import os9 from "os";
|
|
32255
32255
|
|
|
32256
32256
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
32257
32257
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -33201,6 +33201,10 @@ async function updateSettings(options, claudeDir) {
|
|
|
33201
33201
|
// src/commands/setup/utils.ts
|
|
33202
33202
|
var import_fs_extra4 = __toESM(require_lib4(), 1);
|
|
33203
33203
|
import path6 from "path";
|
|
33204
|
+
import os7 from "os";
|
|
33205
|
+
import { exec } from "child_process";
|
|
33206
|
+
import { promisify } from "util";
|
|
33207
|
+
var execAsync = promisify(exec);
|
|
33204
33208
|
|
|
33205
33209
|
class SimpleSpinner {
|
|
33206
33210
|
message = "";
|
|
@@ -33212,57 +33216,24 @@ class SimpleSpinner {
|
|
|
33212
33216
|
console.log(source_default.green(`✓ ${message}`));
|
|
33213
33217
|
}
|
|
33214
33218
|
}
|
|
33215
|
-
var
|
|
33216
|
-
async function
|
|
33219
|
+
var GITHUB_REPO = "https://github.com/Melvynx/aiblueprint.git";
|
|
33220
|
+
async function cloneRepository() {
|
|
33221
|
+
const tmpDir = path6.join(os7.tmpdir(), `aiblueprint-${Date.now()}`);
|
|
33217
33222
|
try {
|
|
33218
|
-
|
|
33219
|
-
|
|
33220
|
-
|
|
33221
|
-
return false;
|
|
33222
|
-
}
|
|
33223
|
-
const content = await response.arrayBuffer();
|
|
33224
|
-
await import_fs_extra4.default.ensureDir(path6.dirname(targetPath));
|
|
33225
|
-
await import_fs_extra4.default.writeFile(targetPath, Buffer.from(content));
|
|
33226
|
-
return true;
|
|
33223
|
+
await import_fs_extra4.default.ensureDir(tmpDir);
|
|
33224
|
+
await execAsync(`git clone --depth 1 --quiet ${GITHUB_REPO} "${tmpDir}"`);
|
|
33225
|
+
return tmpDir;
|
|
33227
33226
|
} catch (error) {
|
|
33228
|
-
|
|
33227
|
+
console.error(source_default.yellow(` Warning: Failed to clone repository: ${error instanceof Error ? error.message : String(error)}`));
|
|
33228
|
+
await import_fs_extra4.default.remove(tmpDir).catch(() => {});
|
|
33229
|
+
return null;
|
|
33229
33230
|
}
|
|
33230
33231
|
}
|
|
33231
|
-
async function
|
|
33232
|
+
async function cleanupRepository(repoPath) {
|
|
33232
33233
|
try {
|
|
33233
|
-
|
|
33234
|
-
const response = await fetch(apiUrl);
|
|
33235
|
-
if (!response.ok) {
|
|
33236
|
-
console.error(source_default.yellow(` Warning: Failed to fetch directory from GitHub: ${dirPath} (HTTP ${response.status})`));
|
|
33237
|
-
return false;
|
|
33238
|
-
}
|
|
33239
|
-
const files = await response.json();
|
|
33240
|
-
if (!Array.isArray(files)) {
|
|
33241
|
-
console.error(source_default.yellow(` Warning: Invalid response from GitHub API for: ${dirPath}`));
|
|
33242
|
-
return false;
|
|
33243
|
-
}
|
|
33244
|
-
await import_fs_extra4.default.ensureDir(targetDir);
|
|
33245
|
-
let allSuccess = true;
|
|
33246
|
-
for (const file of files) {
|
|
33247
|
-
const relativePath = `${dirPath}/${file.name}`;
|
|
33248
|
-
const targetPath = path6.join(targetDir, file.name);
|
|
33249
|
-
if (file.type === "file") {
|
|
33250
|
-
const success = await downloadFromGitHub(relativePath, targetPath);
|
|
33251
|
-
if (!success) {
|
|
33252
|
-
console.error(source_default.yellow(` Warning: Failed to download file: ${relativePath}`));
|
|
33253
|
-
allSuccess = false;
|
|
33254
|
-
}
|
|
33255
|
-
} else if (file.type === "dir") {
|
|
33256
|
-
const success = await downloadDirectoryFromGitHub(relativePath, targetPath);
|
|
33257
|
-
if (!success) {
|
|
33258
|
-
allSuccess = false;
|
|
33259
|
-
}
|
|
33260
|
-
}
|
|
33261
|
-
}
|
|
33262
|
-
return allSuccess;
|
|
33234
|
+
await import_fs_extra4.default.remove(repoPath);
|
|
33263
33235
|
} catch (error) {
|
|
33264
|
-
console.error(source_default.yellow(` Warning:
|
|
33265
|
-
return false;
|
|
33236
|
+
console.error(source_default.yellow(` Warning: Failed to cleanup temporary directory: ${error instanceof Error ? error.message : String(error)}`));
|
|
33266
33237
|
}
|
|
33267
33238
|
}
|
|
33268
33239
|
|
|
@@ -33287,8 +33258,8 @@ function getVersion() {
|
|
|
33287
33258
|
// src/lib/backup-utils.ts
|
|
33288
33259
|
var import_fs_extra5 = __toESM(require_lib4(), 1);
|
|
33289
33260
|
import path7 from "path";
|
|
33290
|
-
import
|
|
33291
|
-
var BACKUP_BASE_DIR = path7.join(
|
|
33261
|
+
import os8 from "os";
|
|
33262
|
+
var BACKUP_BASE_DIR = path7.join(os8.homedir(), ".config", "aiblueprint", "backup");
|
|
33292
33263
|
function formatDate(date) {
|
|
33293
33264
|
const pad = (n) => n.toString().padStart(2, "0");
|
|
33294
33265
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}-${pad(date.getHours())}-${pad(date.getMinutes())}-${pad(date.getSeconds())}`;
|
|
@@ -33320,7 +33291,6 @@ async function createBackup(claudeDir) {
|
|
|
33320
33291
|
// src/commands/setup.ts
|
|
33321
33292
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
33322
33293
|
var __dirname2 = dirname2(__filename2);
|
|
33323
|
-
var GITHUB_RAW_BASE2 = "https://raw.githubusercontent.com/Melvynx/aiblueprint-cli/main/claude-code-config";
|
|
33324
33294
|
async function setupCommand(params = {}) {
|
|
33325
33295
|
const {
|
|
33326
33296
|
claudeCodeFolder: customClaudeCodeFolder,
|
|
@@ -33328,6 +33298,7 @@ async function setupCommand(params = {}) {
|
|
|
33328
33298
|
openCodeFolder: customOpenCodeFolder,
|
|
33329
33299
|
skipInteractive
|
|
33330
33300
|
} = params;
|
|
33301
|
+
let repoPath = null;
|
|
33331
33302
|
try {
|
|
33332
33303
|
console.log(source_default.blue.bold(`
|
|
33333
33304
|
\uD83D\uDE80 AIBlueprint Claude Code Setup ${source_default.gray(`v${getVersion()}`)}
|
|
@@ -33415,7 +33386,7 @@ async function setupCommand(params = {}) {
|
|
|
33415
33386
|
skipInteractive
|
|
33416
33387
|
};
|
|
33417
33388
|
const s = new SimpleSpinner;
|
|
33418
|
-
const claudeDir = customClaudeCodeFolder ? path8.resolve(customClaudeCodeFolder) : path8.join(
|
|
33389
|
+
const claudeDir = customClaudeCodeFolder ? path8.resolve(customClaudeCodeFolder) : path8.join(os9.homedir(), ".claude");
|
|
33419
33390
|
console.log(source_default.gray(`Installing to: ${claudeDir}`));
|
|
33420
33391
|
await import_fs_extra6.default.ensureDir(claudeDir);
|
|
33421
33392
|
s.start("Creating backup of existing configuration");
|
|
@@ -33425,37 +33396,17 @@ async function setupCommand(params = {}) {
|
|
|
33425
33396
|
} else {
|
|
33426
33397
|
s.stop("No existing config to backup");
|
|
33427
33398
|
}
|
|
33428
|
-
|
|
33429
|
-
|
|
33430
|
-
|
|
33431
|
-
|
|
33432
|
-
|
|
33433
|
-
|
|
33434
|
-
|
|
33435
|
-
|
|
33436
|
-
|
|
33437
|
-
if (!useGitHub) {
|
|
33438
|
-
const currentDir = process.cwd();
|
|
33439
|
-
const possiblePaths = [
|
|
33440
|
-
path8.join(currentDir, "claude-code-config"),
|
|
33441
|
-
path8.join(__dirname2, "../../claude-code-config"),
|
|
33442
|
-
path8.join(__dirname2, "../claude-code-config"),
|
|
33443
|
-
path8.join(path8.dirname(process.argv[1]), "../claude-code-config")
|
|
33444
|
-
];
|
|
33445
|
-
sourceDir = possiblePaths.find((p) => {
|
|
33446
|
-
try {
|
|
33447
|
-
return import_fs_extra6.default.existsSync(p);
|
|
33448
|
-
} catch {
|
|
33449
|
-
return false;
|
|
33450
|
-
}
|
|
33451
|
-
});
|
|
33452
|
-
if (!sourceDir) {
|
|
33453
|
-
throw new Error("Could not find claude-code-config directory locally and GitHub is not accessible");
|
|
33454
|
-
}
|
|
33455
|
-
console.log(source_default.yellow(" Using local configuration files (GitHub not accessible)"));
|
|
33456
|
-
} else {
|
|
33457
|
-
console.log(source_default.green(" Downloading latest configuration from GitHub"));
|
|
33399
|
+
s.start("Cloning configuration repository");
|
|
33400
|
+
repoPath = await cloneRepository();
|
|
33401
|
+
if (!repoPath) {
|
|
33402
|
+
throw new Error("Failed to clone repository. Please check your internet connection and try again.");
|
|
33403
|
+
}
|
|
33404
|
+
const sourceDir = path8.join(repoPath, "claude-code-config");
|
|
33405
|
+
if (!await import_fs_extra6.default.pathExists(sourceDir)) {
|
|
33406
|
+
await cleanupRepository(repoPath);
|
|
33407
|
+
throw new Error("Configuration directory not found in cloned repository");
|
|
33458
33408
|
}
|
|
33409
|
+
s.stop("Repository cloned successfully");
|
|
33459
33410
|
if (options.shellShortcuts) {
|
|
33460
33411
|
s.start("Setting up shell shortcuts");
|
|
33461
33412
|
await setupShellShortcuts();
|
|
@@ -33463,31 +33414,15 @@ async function setupCommand(params = {}) {
|
|
|
33463
33414
|
}
|
|
33464
33415
|
if (options.commandValidation || options.customStatusline || options.notificationSounds) {
|
|
33465
33416
|
s.start("Setting up scripts");
|
|
33466
|
-
|
|
33467
|
-
|
|
33468
|
-
await import_fs_extra6.default.ensureDir(
|
|
33469
|
-
if (options.commandValidation) {
|
|
33470
|
-
await downloadDirectoryFromGitHub("scripts/command-validator", path8.join(scriptsDir, "command-validator"));
|
|
33471
|
-
}
|
|
33472
|
-
if (options.customStatusline) {
|
|
33473
|
-
await downloadDirectoryFromGitHub("scripts/statusline", path8.join(scriptsDir, "statusline"));
|
|
33474
|
-
await import_fs_extra6.default.ensureDir(path8.join(scriptsDir, "statusline/data"));
|
|
33475
|
-
}
|
|
33476
|
-
} else {
|
|
33477
|
-
await import_fs_extra6.default.copy(path8.join(sourceDir, "scripts"), path8.join(claudeDir, "scripts"), { overwrite: true });
|
|
33478
|
-
if (options.customStatusline) {
|
|
33479
|
-
await import_fs_extra6.default.ensureDir(path8.join(claudeDir, "scripts/statusline/data"));
|
|
33480
|
-
}
|
|
33417
|
+
await import_fs_extra6.default.copy(path8.join(sourceDir, "scripts"), path8.join(claudeDir, "scripts"), { overwrite: true });
|
|
33418
|
+
if (options.customStatusline) {
|
|
33419
|
+
await import_fs_extra6.default.ensureDir(path8.join(claudeDir, "scripts/statusline/data"));
|
|
33481
33420
|
}
|
|
33482
33421
|
s.stop("Scripts installed");
|
|
33483
33422
|
}
|
|
33484
33423
|
if (options.aiblueprintCommands) {
|
|
33485
33424
|
s.start("Setting up AIBlueprint commands");
|
|
33486
|
-
|
|
33487
|
-
await downloadDirectoryFromGitHub("commands", path8.join(claudeDir, "commands"));
|
|
33488
|
-
} else {
|
|
33489
|
-
await import_fs_extra6.default.copy(path8.join(sourceDir, "commands"), path8.join(claudeDir, "commands"), { overwrite: true });
|
|
33490
|
-
}
|
|
33425
|
+
await import_fs_extra6.default.copy(path8.join(sourceDir, "commands"), path8.join(claudeDir, "commands"), { overwrite: true });
|
|
33491
33426
|
s.stop("Commands installed");
|
|
33492
33427
|
}
|
|
33493
33428
|
if (options.codexSymlink && options.aiblueprintCommands) {
|
|
@@ -33502,48 +33437,22 @@ async function setupCommand(params = {}) {
|
|
|
33502
33437
|
}
|
|
33503
33438
|
if (options.aiblueprintAgents) {
|
|
33504
33439
|
s.start("Setting up AIBlueprint agents");
|
|
33505
|
-
|
|
33506
|
-
await downloadDirectoryFromGitHub("agents", path8.join(claudeDir, "agents"));
|
|
33507
|
-
} else {
|
|
33508
|
-
await import_fs_extra6.default.copy(path8.join(sourceDir, "agents"), path8.join(claudeDir, "agents"), { overwrite: true });
|
|
33509
|
-
}
|
|
33440
|
+
await import_fs_extra6.default.copy(path8.join(sourceDir, "agents"), path8.join(claudeDir, "agents"), { overwrite: true });
|
|
33510
33441
|
s.stop("Agents installed");
|
|
33511
33442
|
}
|
|
33512
33443
|
if (options.aiblueprintSkills) {
|
|
33513
33444
|
s.start("Setting up AIBlueprint Skills");
|
|
33514
|
-
|
|
33515
|
-
|
|
33516
|
-
|
|
33517
|
-
|
|
33518
|
-
if (testResponse.ok) {
|
|
33519
|
-
await downloadDirectoryFromGitHub("skills", path8.join(claudeDir, "skills"));
|
|
33520
|
-
s.stop("Skills installed");
|
|
33521
|
-
} else {
|
|
33522
|
-
s.stop("Skills not available in repository");
|
|
33523
|
-
}
|
|
33524
|
-
} catch {
|
|
33525
|
-
s.stop("Skills not available in repository");
|
|
33526
|
-
}
|
|
33445
|
+
const skillsSourcePath = path8.join(sourceDir, "skills");
|
|
33446
|
+
if (await import_fs_extra6.default.pathExists(skillsSourcePath)) {
|
|
33447
|
+
await import_fs_extra6.default.copy(skillsSourcePath, path8.join(claudeDir, "skills"), { overwrite: true });
|
|
33448
|
+
s.stop("Skills installed");
|
|
33527
33449
|
} else {
|
|
33528
|
-
|
|
33529
|
-
if (await import_fs_extra6.default.pathExists(skillsSourcePath)) {
|
|
33530
|
-
await import_fs_extra6.default.copy(skillsSourcePath, path8.join(claudeDir, "skills"), { overwrite: true });
|
|
33531
|
-
s.stop("Skills installed");
|
|
33532
|
-
} else {
|
|
33533
|
-
s.stop("Skills not available in local repository");
|
|
33534
|
-
}
|
|
33450
|
+
s.stop("Skills not available in repository");
|
|
33535
33451
|
}
|
|
33536
33452
|
}
|
|
33537
33453
|
if (options.notificationSounds) {
|
|
33538
33454
|
s.start("Setting up notification sounds");
|
|
33539
|
-
|
|
33540
|
-
const songDir = path8.join(claudeDir, "song");
|
|
33541
|
-
await import_fs_extra6.default.ensureDir(songDir);
|
|
33542
|
-
await downloadFromGitHub("song/finish.mp3", path8.join(songDir, "finish.mp3"));
|
|
33543
|
-
await downloadFromGitHub("song/need-human.mp3", path8.join(songDir, "need-human.mp3"));
|
|
33544
|
-
} else {
|
|
33545
|
-
await import_fs_extra6.default.copy(path8.join(sourceDir, "song"), path8.join(claudeDir, "song"), { overwrite: true });
|
|
33546
|
-
}
|
|
33455
|
+
await import_fs_extra6.default.copy(path8.join(sourceDir, "song"), path8.join(claudeDir, "song"), { overwrite: true });
|
|
33547
33456
|
s.stop("Notification sounds installed");
|
|
33548
33457
|
}
|
|
33549
33458
|
if (options.customStatusline) {
|
|
@@ -33574,11 +33483,14 @@ async function setupCommand(params = {}) {
|
|
|
33574
33483
|
s.start("Updating settings.json");
|
|
33575
33484
|
await updateSettings(options, claudeDir);
|
|
33576
33485
|
s.stop("Settings updated");
|
|
33486
|
+
s.start("Cleaning up temporary files");
|
|
33487
|
+
await cleanupRepository(repoPath);
|
|
33488
|
+
s.stop("Cleanup complete");
|
|
33577
33489
|
console.log(source_default.green("✨ Setup complete!"));
|
|
33578
33490
|
console.log(source_default.gray(`
|
|
33579
33491
|
Next steps:`));
|
|
33580
33492
|
if (options.shellShortcuts) {
|
|
33581
|
-
const platform =
|
|
33493
|
+
const platform = os9.platform();
|
|
33582
33494
|
if (platform === "win32") {
|
|
33583
33495
|
console.log(source_default.gray(" • Restart PowerShell to load the new functions"));
|
|
33584
33496
|
} else {
|
|
@@ -33594,6 +33506,9 @@ Next steps:`));
|
|
|
33594
33506
|
console.error(source_default.red(`
|
|
33595
33507
|
❌ Setup failed:`), error);
|
|
33596
33508
|
console.log(source_default.red("Setup failed!"));
|
|
33509
|
+
if (repoPath) {
|
|
33510
|
+
await cleanupRepository(repoPath);
|
|
33511
|
+
}
|
|
33597
33512
|
process.exit(1);
|
|
33598
33513
|
}
|
|
33599
33514
|
}
|
|
@@ -33601,8 +33516,8 @@ Next steps:`));
|
|
|
33601
33516
|
// src/commands/setup-terminal.ts
|
|
33602
33517
|
var import_fs_extra7 = __toESM(require_lib4(), 1);
|
|
33603
33518
|
import path9 from "path";
|
|
33604
|
-
import
|
|
33605
|
-
import { execSync as execSync3, exec } from "child_process";
|
|
33519
|
+
import os10 from "os";
|
|
33520
|
+
import { execSync as execSync3, exec as exec2 } from "child_process";
|
|
33606
33521
|
var OHMYZSH_INSTALL_URL = "https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh";
|
|
33607
33522
|
var INSTALL_TIMEOUT = 120000;
|
|
33608
33523
|
var PLUGIN_TIMEOUT = 60000;
|
|
@@ -33684,7 +33599,7 @@ async function installOhMyZsh(homeDir) {
|
|
|
33684
33599
|
return new Promise((resolve, reject) => {
|
|
33685
33600
|
const installCmd = `sh -c "$(curl -fsSL ${OHMYZSH_INSTALL_URL})" "" --unattended`;
|
|
33686
33601
|
const env2 = { ...process.env, HOME: homeDir, ZSH: path9.join(homeDir, ".oh-my-zsh") };
|
|
33687
|
-
|
|
33602
|
+
exec2(installCmd, { timeout: INSTALL_TIMEOUT, env: env2 }, (error, stdout, stderr) => {
|
|
33688
33603
|
if (error) {
|
|
33689
33604
|
if ("killed" in error && error.killed) {
|
|
33690
33605
|
reject(new Error("Oh My ZSH installation timed out. Please check your network connection."));
|
|
@@ -33709,7 +33624,7 @@ async function installPlugin(pluginName, repoUrl, homeDir) {
|
|
|
33709
33624
|
return;
|
|
33710
33625
|
}
|
|
33711
33626
|
return new Promise((resolve, reject) => {
|
|
33712
|
-
|
|
33627
|
+
exec2(`git clone ${repoUrl} "${customPluginsDir}"`, { timeout: PLUGIN_TIMEOUT }, (error, stdout, stderr) => {
|
|
33713
33628
|
if (error) {
|
|
33714
33629
|
if ("killed" in error && error.killed) {
|
|
33715
33630
|
reject(new Error(`Plugin ${pluginName} installation timed out. Please check your network connection.`));
|
|
@@ -33768,7 +33683,7 @@ plugins=(${pluginsString})`;
|
|
|
33768
33683
|
}
|
|
33769
33684
|
async function setupTerminalCommand(options = {}) {
|
|
33770
33685
|
const { skipInteractive, homeDir: customHomeDir } = options;
|
|
33771
|
-
const homeDir = customHomeDir ||
|
|
33686
|
+
const homeDir = customHomeDir || os10.homedir();
|
|
33772
33687
|
try {
|
|
33773
33688
|
console.log(source_default.blue.bold(`
|
|
33774
33689
|
\uD83D\uDDA5️ AIBlueprint Terminal Setup ${source_default.gray(`v${getVersion()}`)}
|
|
@@ -34094,37 +34009,48 @@ async function statuslineCommand(options) {
|
|
|
34094
34009
|
console.log(source_default.cyan("\uD83D\uDCE6 Checking dependencies..."));
|
|
34095
34010
|
await checkAndInstallDependencies();
|
|
34096
34011
|
console.log(source_default.cyan(`
|
|
34097
|
-
\uD83D\uDCE5
|
|
34098
|
-
const
|
|
34099
|
-
|
|
34100
|
-
|
|
34101
|
-
if (!success) {
|
|
34102
|
-
console.log(source_default.red(" Failed to download statusline files from GitHub"));
|
|
34012
|
+
\uD83D\uDCE5 Cloning configuration repository...`));
|
|
34013
|
+
const repoPath = await cloneRepository();
|
|
34014
|
+
if (!repoPath) {
|
|
34015
|
+
console.log(source_default.red(" Failed to clone repository. Please check your internet connection."));
|
|
34103
34016
|
return;
|
|
34104
34017
|
}
|
|
34105
|
-
|
|
34018
|
+
const sourceDir = path10.join(repoPath, "claude-code-config");
|
|
34019
|
+
if (!await import_fs_extra8.default.pathExists(sourceDir)) {
|
|
34020
|
+
await cleanupRepository(repoPath);
|
|
34021
|
+
console.log(source_default.red(" Configuration directory not found in cloned repository"));
|
|
34022
|
+
return;
|
|
34023
|
+
}
|
|
34024
|
+
try {
|
|
34025
|
+
const scriptsDir = path10.join(claudeDir, "scripts");
|
|
34026
|
+
await import_fs_extra8.default.ensureDir(scriptsDir);
|
|
34027
|
+
await import_fs_extra8.default.copy(path10.join(sourceDir, "scripts/statusline"), path10.join(scriptsDir, "statusline"), { overwrite: true });
|
|
34028
|
+
console.log(source_default.cyan(`
|
|
34106
34029
|
\uD83D\uDCE6 Installing statusline dependencies...`));
|
|
34107
|
-
|
|
34108
|
-
|
|
34030
|
+
await installStatuslineDependencies(claudeDir);
|
|
34031
|
+
console.log(source_default.cyan(`
|
|
34109
34032
|
⚙️ Configuring settings.json...`));
|
|
34110
|
-
|
|
34111
|
-
|
|
34112
|
-
|
|
34113
|
-
|
|
34114
|
-
|
|
34115
|
-
|
|
34116
|
-
|
|
34117
|
-
|
|
34118
|
-
|
|
34119
|
-
|
|
34120
|
-
|
|
34121
|
-
|
|
34122
|
-
|
|
34033
|
+
const settingsPath = path10.join(claudeDir, "settings.json");
|
|
34034
|
+
let settings = {};
|
|
34035
|
+
try {
|
|
34036
|
+
const existingSettings = await import_fs_extra8.default.readFile(settingsPath, "utf-8");
|
|
34037
|
+
settings = JSON.parse(existingSettings);
|
|
34038
|
+
} catch {}
|
|
34039
|
+
settings.statusLine = {
|
|
34040
|
+
type: "command",
|
|
34041
|
+
command: `bun ${path10.join(claudeDir, "scripts/statusline/src/index.ts")}`,
|
|
34042
|
+
padding: 0
|
|
34043
|
+
};
|
|
34044
|
+
await import_fs_extra8.default.writeJson(settingsPath, settings, { spaces: 2 });
|
|
34045
|
+
console.log(source_default.green(`
|
|
34123
34046
|
✅ Statusline setup complete!`));
|
|
34124
|
-
|
|
34047
|
+
console.log(source_default.gray(`
|
|
34125
34048
|
Your Claude Code statusline is now configured.`));
|
|
34126
|
-
|
|
34049
|
+
console.log(source_default.gray(`Restart Claude Code to see the changes.
|
|
34127
34050
|
`));
|
|
34051
|
+
} finally {
|
|
34052
|
+
await cleanupRepository(repoPath);
|
|
34053
|
+
}
|
|
34128
34054
|
}
|
|
34129
34055
|
|
|
34130
34056
|
// node_modules/@clack/core/dist/index.mjs
|
|
@@ -34843,26 +34769,26 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
|
34843
34769
|
};
|
|
34844
34770
|
|
|
34845
34771
|
// src/commands/pro.ts
|
|
34846
|
-
import
|
|
34772
|
+
import os13 from "os";
|
|
34847
34773
|
import path13 from "path";
|
|
34848
34774
|
|
|
34849
34775
|
// src/lib/pro-installer.ts
|
|
34850
34776
|
var import_fs_extra9 = __toESM(require_lib4(), 1);
|
|
34851
|
-
import
|
|
34777
|
+
import os11 from "os";
|
|
34852
34778
|
import path11 from "path";
|
|
34853
|
-
import { exec as
|
|
34854
|
-
import { promisify } from "util";
|
|
34855
|
-
var
|
|
34779
|
+
import { exec as exec3 } from "child_process";
|
|
34780
|
+
import { promisify as promisify2 } from "util";
|
|
34781
|
+
var execAsync2 = promisify2(exec3);
|
|
34856
34782
|
var PREMIUM_REPO = "Melvynx/aiblueprint-cli-premium";
|
|
34857
34783
|
var PREMIUM_BRANCH = "main";
|
|
34858
34784
|
function getCacheRepoDir() {
|
|
34859
|
-
return path11.join(
|
|
34785
|
+
return path11.join(os11.homedir(), ".config", "aiblueprint", "pro-repos", "aiblueprint-cli-premium");
|
|
34860
34786
|
}
|
|
34861
34787
|
async function execGitWithAuth(command, token, repoUrl, cwd) {
|
|
34862
34788
|
const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
|
|
34863
34789
|
const fullCommand = `git ${command.replace(repoUrl, authenticatedUrl)}`;
|
|
34864
34790
|
try {
|
|
34865
|
-
await
|
|
34791
|
+
await execAsync2(fullCommand, { cwd, timeout: 120000 });
|
|
34866
34792
|
} catch (error) {
|
|
34867
34793
|
throw new Error(`Git command failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
34868
34794
|
}
|
|
@@ -34963,7 +34889,7 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
|
|
|
34963
34889
|
}
|
|
34964
34890
|
async function installProConfigs(options) {
|
|
34965
34891
|
const { githubToken, claudeCodeFolder, onProgress } = options;
|
|
34966
|
-
const claudeFolder = claudeCodeFolder || path11.join(
|
|
34892
|
+
const claudeFolder = claudeCodeFolder || path11.join(os11.homedir(), ".claude");
|
|
34967
34893
|
try {
|
|
34968
34894
|
const cacheConfigDir = await cloneOrUpdateRepo(githubToken);
|
|
34969
34895
|
await copyConfigFromCache(cacheConfigDir, claudeFolder, onProgress);
|
|
@@ -34971,7 +34897,7 @@ async function installProConfigs(options) {
|
|
|
34971
34897
|
} catch (error) {
|
|
34972
34898
|
console.warn("Git caching failed, falling back to API download");
|
|
34973
34899
|
}
|
|
34974
|
-
const tempDir = path11.join(
|
|
34900
|
+
const tempDir = path11.join(os11.tmpdir(), `aiblueprint-premium-${Date.now()}`);
|
|
34975
34901
|
try {
|
|
34976
34902
|
const success = await downloadDirectoryFromPrivateGitHub(PREMIUM_REPO, PREMIUM_BRANCH, "claude-code-config", tempDir, githubToken, onProgress);
|
|
34977
34903
|
if (!success) {
|
|
@@ -34991,15 +34917,15 @@ async function installProConfigs(options) {
|
|
|
34991
34917
|
|
|
34992
34918
|
// src/lib/token-storage.ts
|
|
34993
34919
|
var import_fs_extra10 = __toESM(require_lib4(), 1);
|
|
34994
|
-
import
|
|
34920
|
+
import os12 from "os";
|
|
34995
34921
|
import path12 from "path";
|
|
34996
34922
|
function getConfigDir() {
|
|
34997
|
-
const platform =
|
|
34923
|
+
const platform = os12.platform();
|
|
34998
34924
|
if (platform === "win32") {
|
|
34999
|
-
const appData = process.env.APPDATA || path12.join(
|
|
34925
|
+
const appData = process.env.APPDATA || path12.join(os12.homedir(), "AppData", "Roaming");
|
|
35000
34926
|
return path12.join(appData, "aiblueprint");
|
|
35001
34927
|
} else {
|
|
35002
|
-
const configHome = process.env.XDG_CONFIG_HOME || path12.join(
|
|
34928
|
+
const configHome = process.env.XDG_CONFIG_HOME || path12.join(os12.homedir(), ".config");
|
|
35003
34929
|
return path12.join(configHome, "aiblueprint");
|
|
35004
34930
|
}
|
|
35005
34931
|
}
|
|
@@ -35026,7 +34952,7 @@ async function getToken() {
|
|
|
35026
34952
|
function getTokenInfo() {
|
|
35027
34953
|
return {
|
|
35028
34954
|
path: getTokenFilePath(),
|
|
35029
|
-
platform:
|
|
34955
|
+
platform: os12.platform()
|
|
35030
34956
|
};
|
|
35031
34957
|
}
|
|
35032
34958
|
|
|
@@ -35176,7 +35102,7 @@ async function proSetupCommand(options = {}) {
|
|
|
35176
35102
|
Se(source_default.red("❌ Not activated"));
|
|
35177
35103
|
process.exit(1);
|
|
35178
35104
|
}
|
|
35179
|
-
const claudeDir = options.folder ? path13.resolve(options.folder) : path13.join(
|
|
35105
|
+
const claudeDir = options.folder ? path13.resolve(options.folder) : path13.join(os13.homedir(), ".claude");
|
|
35180
35106
|
const spinner = Y2();
|
|
35181
35107
|
const onProgress = (file, type) => {
|
|
35182
35108
|
spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
|
|
@@ -35258,7 +35184,7 @@ async function proUpdateCommand(options = {}) {
|
|
|
35258
35184
|
}
|
|
35259
35185
|
|
|
35260
35186
|
// src/commands/sync.ts
|
|
35261
|
-
import
|
|
35187
|
+
import os14 from "os";
|
|
35262
35188
|
import path15 from "path";
|
|
35263
35189
|
|
|
35264
35190
|
// src/lib/sync-utils.ts
|
|
@@ -35739,7 +35665,7 @@ async function proSyncCommand(options = {}) {
|
|
|
35739
35665
|
Se(source_default.red("❌ Not activated"));
|
|
35740
35666
|
process.exit(1);
|
|
35741
35667
|
}
|
|
35742
|
-
const claudeDir = options.folder ? path15.resolve(options.folder) : path15.join(
|
|
35668
|
+
const claudeDir = options.folder ? path15.resolve(options.folder) : path15.join(os14.homedir(), ".claude");
|
|
35743
35669
|
const spinner = Y2();
|
|
35744
35670
|
spinner.start("Analyzing changes...");
|
|
35745
35671
|
const result = await analyzeSyncChanges(claudeDir, githubToken);
|