aiblueprint-cli 1.3.3 → 1.3.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/cli.js +114 -24
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33401,13 +33401,13 @@ async function downloadDirectoryFromGitHub(dirPath, targetDir) {
|
|
|
33401
33401
|
import { readFileSync as readFileSync2 } from "fs";
|
|
33402
33402
|
import { dirname, join } from "path";
|
|
33403
33403
|
import { fileURLToPath } from "url";
|
|
33404
|
-
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
33405
33404
|
var cachedVersion = null;
|
|
33406
33405
|
function getVersion() {
|
|
33407
33406
|
if (cachedVersion)
|
|
33408
33407
|
return cachedVersion;
|
|
33409
33408
|
try {
|
|
33410
|
-
const
|
|
33409
|
+
const __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
33410
|
+
const packageJson = JSON.parse(readFileSync2(join(__dirname2, "../package.json"), "utf8"));
|
|
33411
33411
|
cachedVersion = packageJson.version;
|
|
33412
33412
|
return cachedVersion;
|
|
33413
33413
|
} catch {
|
|
@@ -33417,7 +33417,7 @@ function getVersion() {
|
|
|
33417
33417
|
|
|
33418
33418
|
// src/commands/setup.ts
|
|
33419
33419
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
33420
|
-
var
|
|
33420
|
+
var __dirname2 = dirname2(__filename2);
|
|
33421
33421
|
var GITHUB_RAW_BASE2 = "https://raw.githubusercontent.com/Melvynx/aiblueprint-cli/main/claude-code-config";
|
|
33422
33422
|
async function setupCommand(params = {}) {
|
|
33423
33423
|
const {
|
|
@@ -33534,8 +33534,8 @@ async function setupCommand(params = {}) {
|
|
|
33534
33534
|
const currentDir = process.cwd();
|
|
33535
33535
|
const possiblePaths = [
|
|
33536
33536
|
path7.join(currentDir, "claude-code-config"),
|
|
33537
|
-
path7.join(
|
|
33538
|
-
path7.join(
|
|
33537
|
+
path7.join(__dirname2, "../../claude-code-config"),
|
|
33538
|
+
path7.join(__dirname2, "../claude-code-config"),
|
|
33539
33539
|
path7.join(path7.dirname(process.argv[1]), "../claude-code-config")
|
|
33540
33540
|
];
|
|
33541
33541
|
sourceDir = possiblePaths.find((p) => {
|
|
@@ -33705,7 +33705,7 @@ import path8 from "path";
|
|
|
33705
33705
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
33706
33706
|
import { dirname as dirname3 } from "path";
|
|
33707
33707
|
var __filename3 = fileURLToPath3(import.meta.url);
|
|
33708
|
-
var
|
|
33708
|
+
var __dirname3 = dirname3(__filename3);
|
|
33709
33709
|
function parseYamlFrontmatter(content) {
|
|
33710
33710
|
const lines = content.split(`
|
|
33711
33711
|
`);
|
|
@@ -33732,8 +33732,8 @@ function parseYamlFrontmatter(content) {
|
|
|
33732
33732
|
}
|
|
33733
33733
|
function getLocalConfigPaths(subDir) {
|
|
33734
33734
|
return [
|
|
33735
|
-
path8.join(
|
|
33736
|
-
path8.join(
|
|
33735
|
+
path8.join(__dirname3, `../claude-code-config/${subDir}`),
|
|
33736
|
+
path8.join(__dirname3, `../../claude-code-config/${subDir}`)
|
|
33737
33737
|
];
|
|
33738
33738
|
}
|
|
33739
33739
|
async function findLocalConfigDir(subDir) {
|
|
@@ -33865,7 +33865,7 @@ async function getFileContentWithGitHubFallback(sourceDir, fileName) {
|
|
|
33865
33865
|
|
|
33866
33866
|
// src/commands/addHook.ts
|
|
33867
33867
|
var __filename4 = fileURLToPath4(import.meta.url);
|
|
33868
|
-
var
|
|
33868
|
+
var __dirname4 = dirname4(__filename4);
|
|
33869
33869
|
|
|
33870
33870
|
class SimpleSpinner2 {
|
|
33871
33871
|
message = "";
|
|
@@ -35324,6 +35324,8 @@ async function listRemoteFilesRecursive(dirPath, githubToken, basePath = "") {
|
|
|
35324
35324
|
const results = [];
|
|
35325
35325
|
const files = await listRemoteDirectory(dirPath, githubToken);
|
|
35326
35326
|
for (const file of files) {
|
|
35327
|
+
if (file.name === "node_modules")
|
|
35328
|
+
continue;
|
|
35327
35329
|
const relativePath = basePath ? `${basePath}/${file.name}` : file.name;
|
|
35328
35330
|
if (file.type === "file") {
|
|
35329
35331
|
results.push({ path: relativePath, sha: file.sha, isFolder: false });
|
|
@@ -35350,6 +35352,8 @@ async function listLocalFiles(dir) {
|
|
|
35350
35352
|
}
|
|
35351
35353
|
const items = await import_fs_extra15.default.readdir(dir);
|
|
35352
35354
|
for (const item of items) {
|
|
35355
|
+
if (item === "node_modules")
|
|
35356
|
+
continue;
|
|
35353
35357
|
const fullPath = path17.join(dir, item);
|
|
35354
35358
|
const stat = await import_fs_extra15.default.stat(fullPath);
|
|
35355
35359
|
if (stat.isDirectory()) {
|
|
@@ -35366,6 +35370,8 @@ async function listLocalFilesRecursive(dir, basePath) {
|
|
|
35366
35370
|
const files = [];
|
|
35367
35371
|
const items = await import_fs_extra15.default.readdir(dir);
|
|
35368
35372
|
for (const item of items) {
|
|
35373
|
+
if (item === "node_modules")
|
|
35374
|
+
continue;
|
|
35369
35375
|
const fullPath = path17.join(dir, item);
|
|
35370
35376
|
const relativePath = `${basePath}/${item}`;
|
|
35371
35377
|
const stat = await import_fs_extra15.default.stat(fullPath);
|
|
@@ -35528,6 +35534,91 @@ function groupByCategory(items) {
|
|
|
35528
35534
|
}
|
|
35529
35535
|
return grouped;
|
|
35530
35536
|
}
|
|
35537
|
+
function aggregateByTopLevelFolder(items) {
|
|
35538
|
+
const folderMap = new Map;
|
|
35539
|
+
for (const item of items) {
|
|
35540
|
+
const parts = item.name.split("/");
|
|
35541
|
+
const topLevel = parts[0];
|
|
35542
|
+
if (!folderMap.has(topLevel)) {
|
|
35543
|
+
folderMap.set(topLevel, { name: topLevel, newCount: 0, modifiedCount: 0, deletedCount: 0 });
|
|
35544
|
+
}
|
|
35545
|
+
const summary = folderMap.get(topLevel);
|
|
35546
|
+
if (item.status === "new")
|
|
35547
|
+
summary.newCount++;
|
|
35548
|
+
else if (item.status === "modified")
|
|
35549
|
+
summary.modifiedCount++;
|
|
35550
|
+
else if (item.status === "deleted")
|
|
35551
|
+
summary.deletedCount++;
|
|
35552
|
+
}
|
|
35553
|
+
return Array.from(folderMap.values());
|
|
35554
|
+
}
|
|
35555
|
+
function formatFolderSummary(summary) {
|
|
35556
|
+
const parts = [];
|
|
35557
|
+
if (summary.newCount > 0)
|
|
35558
|
+
parts.push(source_default.green(`+${summary.newCount}`));
|
|
35559
|
+
if (summary.modifiedCount > 0)
|
|
35560
|
+
parts.push(source_default.yellow(`~${summary.modifiedCount}`));
|
|
35561
|
+
if (summary.deletedCount > 0)
|
|
35562
|
+
parts.push(source_default.red(`-${summary.deletedCount}`));
|
|
35563
|
+
const countStr = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
35564
|
+
return `\uD83D\uDCC1 ${summary.name}${countStr}`;
|
|
35565
|
+
}
|
|
35566
|
+
function createSelectionChoices(changedItems) {
|
|
35567
|
+
const choices = [];
|
|
35568
|
+
const folderedCategories = ["scripts", "skills"];
|
|
35569
|
+
const grouped = groupByCategory(changedItems);
|
|
35570
|
+
for (const [category, items] of grouped) {
|
|
35571
|
+
if (folderedCategories.includes(category)) {
|
|
35572
|
+
const folderMap = new Map;
|
|
35573
|
+
for (const item of items) {
|
|
35574
|
+
const topLevel = item.name.split("/")[0];
|
|
35575
|
+
if (!folderMap.has(topLevel))
|
|
35576
|
+
folderMap.set(topLevel, []);
|
|
35577
|
+
folderMap.get(topLevel).push(item);
|
|
35578
|
+
}
|
|
35579
|
+
for (const [folder, folderItems] of folderMap) {
|
|
35580
|
+
const summary = aggregateByTopLevelFolder(folderItems)[0];
|
|
35581
|
+
choices.push({
|
|
35582
|
+
value: { type: "folder", folder, category, items: folderItems },
|
|
35583
|
+
label: `\uD83D\uDCC1 ${category}/${folder}`,
|
|
35584
|
+
hint: formatFolderHint(summary)
|
|
35585
|
+
});
|
|
35586
|
+
}
|
|
35587
|
+
} else {
|
|
35588
|
+
for (const item of items) {
|
|
35589
|
+
const icons = { new: "\uD83C\uDD95", modified: "\uD83D\uDCDD", deleted: "\uD83D\uDDD1️", unchanged: "" };
|
|
35590
|
+
const actions = { new: "add", modified: "update", deleted: "remove", unchanged: "" };
|
|
35591
|
+
choices.push({
|
|
35592
|
+
value: { type: "file", item },
|
|
35593
|
+
label: `${icons[item.status]} ${item.relativePath}`,
|
|
35594
|
+
hint: actions[item.status]
|
|
35595
|
+
});
|
|
35596
|
+
}
|
|
35597
|
+
}
|
|
35598
|
+
}
|
|
35599
|
+
return choices;
|
|
35600
|
+
}
|
|
35601
|
+
function formatFolderHint(summary) {
|
|
35602
|
+
const parts = [];
|
|
35603
|
+
if (summary.newCount > 0)
|
|
35604
|
+
parts.push(`+${summary.newCount}`);
|
|
35605
|
+
if (summary.modifiedCount > 0)
|
|
35606
|
+
parts.push(`~${summary.modifiedCount}`);
|
|
35607
|
+
if (summary.deletedCount > 0)
|
|
35608
|
+
parts.push(`-${summary.deletedCount}`);
|
|
35609
|
+
return parts.join(", ");
|
|
35610
|
+
}
|
|
35611
|
+
function expandSelections(selections) {
|
|
35612
|
+
const items = [];
|
|
35613
|
+
for (const sel of selections) {
|
|
35614
|
+
if (sel.type === "file") {
|
|
35615
|
+
items.push(sel.item);
|
|
35616
|
+
} else {
|
|
35617
|
+
items.push(...sel.items);
|
|
35618
|
+
}
|
|
35619
|
+
}
|
|
35620
|
+
return items;
|
|
35621
|
+
}
|
|
35531
35622
|
async function proSyncCommand(options = {}) {
|
|
35532
35623
|
oe(source_default.blue(`\uD83D\uDD04 Sync Premium Configurations ${source_default.gray(`v${getVersion()}`)}`));
|
|
35533
35624
|
try {
|
|
@@ -35553,24 +35644,23 @@ async function proSyncCommand(options = {}) {
|
|
|
35553
35644
|
f2.message("");
|
|
35554
35645
|
f2.message(source_default.bold("Changes by category:"));
|
|
35555
35646
|
const grouped = groupByCategory(changedItems);
|
|
35647
|
+
const folderedCategories = ["scripts", "skills"];
|
|
35556
35648
|
for (const [category, items] of grouped) {
|
|
35557
35649
|
f2.message("");
|
|
35558
35650
|
f2.message(source_default.cyan.bold(` ${category.toUpperCase()}`));
|
|
35559
|
-
|
|
35560
|
-
|
|
35651
|
+
if (folderedCategories.includes(category)) {
|
|
35652
|
+
const folderSummaries = aggregateByTopLevelFolder(items);
|
|
35653
|
+
for (const summary2 of folderSummaries) {
|
|
35654
|
+
f2.message(` ${formatFolderSummary(summary2)}`);
|
|
35655
|
+
}
|
|
35656
|
+
} else {
|
|
35657
|
+
for (const item of items) {
|
|
35658
|
+
f2.message(` ${formatItem(item)}`);
|
|
35659
|
+
}
|
|
35561
35660
|
}
|
|
35562
35661
|
}
|
|
35563
35662
|
f2.message("");
|
|
35564
|
-
const choices =
|
|
35565
|
-
for (const item of changedItems) {
|
|
35566
|
-
const icons = { new: "\uD83C\uDD95", modified: "\uD83D\uDCDD", deleted: "\uD83D\uDDD1️", unchanged: "" };
|
|
35567
|
-
const actions = { new: "add", modified: "update", deleted: "remove", unchanged: "" };
|
|
35568
|
-
choices.push({
|
|
35569
|
-
value: item,
|
|
35570
|
-
label: `${icons[item.status]} ${item.relativePath}`,
|
|
35571
|
-
hint: actions[item.status]
|
|
35572
|
-
});
|
|
35573
|
-
}
|
|
35663
|
+
const choices = createSelectionChoices(changedItems);
|
|
35574
35664
|
const selected = await ae({
|
|
35575
35665
|
message: "Select items to sync:",
|
|
35576
35666
|
options: choices,
|
|
@@ -35581,7 +35671,7 @@ async function proSyncCommand(options = {}) {
|
|
|
35581
35671
|
ue("Sync cancelled");
|
|
35582
35672
|
process.exit(0);
|
|
35583
35673
|
}
|
|
35584
|
-
const selectedItems = selected;
|
|
35674
|
+
const selectedItems = expandSelections(selected);
|
|
35585
35675
|
if (selectedItems.length === 0) {
|
|
35586
35676
|
f2.warn("No items selected");
|
|
35587
35677
|
$e(source_default.yellow("⚠️ Nothing to sync"));
|
|
@@ -35636,8 +35726,8 @@ async function proSyncCommand(options = {}) {
|
|
|
35636
35726
|
import { readFileSync as readFileSync3 } from "fs";
|
|
35637
35727
|
import { dirname as dirname5, join as join2 } from "path";
|
|
35638
35728
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
35639
|
-
var
|
|
35640
|
-
var packageJson = JSON.parse(readFileSync3(join2(
|
|
35729
|
+
var __dirname5 = dirname5(fileURLToPath5(import.meta.url));
|
|
35730
|
+
var packageJson = JSON.parse(readFileSync3(join2(__dirname5, "../package.json"), "utf8"));
|
|
35641
35731
|
var program2 = new Command;
|
|
35642
35732
|
program2.name("aiblueprint").description("AIBlueprint CLI for setting up Claude Code configurations").version(packageJson.version);
|
|
35643
35733
|
var claudeCodeCmd = program2.command("claude-code").description("Claude Code configuration commands").option("-f, --folder <path>", "Specify custom Claude Code folder path (default: ~/.claude) - alias for --claudeCodeFolder").option("--claudeCodeFolder <path>", "Specify custom Claude Code folder path (default: ~/.claude)").option("--codexFolder <path>", "Specify custom Codex folder path (default: ~/.codex)").option("--openCodeFolder <path>", "Specify custom OpenCode folder path (default: ~/.config/opencode)").option("--factoryAiFolder <path>", "Specify custom FactoryAI folder path (default: ~/.factory)").option("-s, --skip", "Skip interactive prompts and install all features");
|