bf-skills 1.0.2 → 1.1.1
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.mjs +61 -24
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -222,7 +222,7 @@ async function runInstall(source, opts) {
|
|
|
222
222
|
p.log.error(err.message);
|
|
223
223
|
process.exit(1);
|
|
224
224
|
}
|
|
225
|
-
p.intro(
|
|
225
|
+
p.intro(pc.bold("bf-skills installer"));
|
|
226
226
|
let targetAgents;
|
|
227
227
|
if (opts.agent) {
|
|
228
228
|
if (opts.agent === "all") {
|
|
@@ -239,17 +239,17 @@ async function runInstall(source, opts) {
|
|
|
239
239
|
targetAgents = AGENTS.filter((a) => DEFAULT_AGENT_IDS.includes(a.id));
|
|
240
240
|
} else {
|
|
241
241
|
const chosen = await p.multiselect({
|
|
242
|
-
message: "
|
|
242
|
+
message: "Where do you want to install skills?",
|
|
243
243
|
options: AGENTS.map((a) => ({
|
|
244
244
|
value: a.id,
|
|
245
245
|
label: a.label,
|
|
246
|
-
hint: opts.global ? a.globalPath :
|
|
246
|
+
hint: opts.global ? a.globalPath : `./${a.projectPath}`
|
|
247
247
|
})),
|
|
248
248
|
initialValues: DEFAULT_AGENT_IDS,
|
|
249
249
|
required: true
|
|
250
250
|
});
|
|
251
251
|
if (p.isCancel(chosen)) {
|
|
252
|
-
p.cancel("
|
|
252
|
+
p.cancel("Cancelled.");
|
|
253
253
|
process.exit(0);
|
|
254
254
|
}
|
|
255
255
|
targetAgents = AGENTS.filter((a) => chosen.includes(a.id));
|
|
@@ -262,14 +262,14 @@ async function runInstall(source, opts) {
|
|
|
262
262
|
} else {
|
|
263
263
|
tmpDir = fs3.mkdtempSync(path4.join(os2.tmpdir(), "bf-skills-"));
|
|
264
264
|
repoPath = tmpDir;
|
|
265
|
-
const
|
|
266
|
-
|
|
265
|
+
const s = p.spinner();
|
|
266
|
+
s.start("Fetching skills catalog...");
|
|
267
267
|
try {
|
|
268
268
|
await simpleGit().clone(repoUrl, repoPath, ["--depth", "1"]);
|
|
269
|
-
|
|
269
|
+
s.stop("Catalog ready");
|
|
270
270
|
} catch (err) {
|
|
271
|
-
|
|
272
|
-
p.log.error(
|
|
271
|
+
s.stop("Failed to fetch catalog");
|
|
272
|
+
p.log.error(`${err.message}`);
|
|
273
273
|
cleanup(tmpDir);
|
|
274
274
|
process.exit(1);
|
|
275
275
|
}
|
|
@@ -295,35 +295,72 @@ async function runInstall(source, opts) {
|
|
|
295
295
|
} else if (opts.yes) {
|
|
296
296
|
selectedSkills = allSkills;
|
|
297
297
|
} else {
|
|
298
|
-
const selected = await p.
|
|
299
|
-
message: `
|
|
298
|
+
const selected = await p.autocompleteMultiselect({
|
|
299
|
+
message: `Pick skills to install (${allSkills.length} available \u2014 type to search)`,
|
|
300
300
|
options: allSkills.map((s) => ({
|
|
301
301
|
value: s.name,
|
|
302
|
-
label:
|
|
302
|
+
label: s.name,
|
|
303
|
+
hint: s.description
|
|
303
304
|
})),
|
|
304
305
|
required: true
|
|
305
306
|
});
|
|
306
307
|
if (p.isCancel(selected)) {
|
|
307
|
-
p.cancel("
|
|
308
|
+
p.cancel("Cancelled.");
|
|
308
309
|
cleanup(tmpDir);
|
|
309
310
|
process.exit(0);
|
|
310
311
|
}
|
|
311
312
|
selectedSkills = allSkills.filter((s) => selected.includes(s.name));
|
|
312
313
|
}
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
const targetLines = targetAgents.map((a) => {
|
|
315
|
+
const dest = opts.global ? a.globalPath : `./${a.projectPath}`;
|
|
316
|
+
return ` ${pc.dim("\u2192")} ${pc.bold(a.label)} ${pc.dim(dest)}`;
|
|
317
|
+
});
|
|
318
|
+
p.note(
|
|
319
|
+
[
|
|
320
|
+
`${pc.bold("Skills:")}`,
|
|
321
|
+
...selectedSkills.map((s) => ` ${pc.cyan("\u2022")} ${s.name} ${pc.dim(s.description)}`),
|
|
322
|
+
"",
|
|
323
|
+
`${pc.bold("Install to:")}`,
|
|
324
|
+
...targetLines
|
|
325
|
+
].join("\n"),
|
|
326
|
+
"Ready to install"
|
|
327
|
+
);
|
|
328
|
+
if (!opts.yes) {
|
|
329
|
+
const go = await p.confirm({ message: "Proceed with installation?" });
|
|
330
|
+
if (p.isCancel(go) || go === false) {
|
|
331
|
+
p.cancel("Installation cancelled.");
|
|
332
|
+
cleanup(tmpDir);
|
|
333
|
+
process.exit(0);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const prog = p.progress({
|
|
337
|
+
indicator: "timer",
|
|
338
|
+
style: "block",
|
|
339
|
+
max: selectedSkills.length
|
|
340
|
+
});
|
|
341
|
+
prog.start(`Installing ${selectedSkills.length} skill${selectedSkills.length === 1 ? "" : "s"}...`);
|
|
342
|
+
const installed = [];
|
|
316
343
|
for (const skill of selectedSkills) {
|
|
344
|
+
prog.advance(1, `Installing ${pc.cyan(skill.name)}...`);
|
|
317
345
|
const paths = installSkill(skill.dir, skill.name, targetAgents, opts.global);
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
spinner2.stop(`Done \u2014 ${selectedSkills.length} skill${selectedSkills.length === 1 ? "" : "s"} installed`);
|
|
323
|
-
for (const line of results) {
|
|
324
|
-
p.log.step(line);
|
|
346
|
+
installed.push(...paths.map((dest, i) => {
|
|
347
|
+
const rel = dest.startsWith(process.cwd()) ? "." + dest.slice(process.cwd().length) : dest.replace(os2.homedir(), "~");
|
|
348
|
+
return `${pc.cyan(skill.name)} ${pc.dim("\u2192")} ${rel}${i > 0 ? pc.dim(" (symlink)") : ""}`;
|
|
349
|
+
}));
|
|
325
350
|
}
|
|
326
|
-
|
|
351
|
+
prog.stop(`${selectedSkills.length} skill${selectedSkills.length === 1 ? "" : "s"} installed`);
|
|
352
|
+
p.note(
|
|
353
|
+
[
|
|
354
|
+
`${pc.bold("Installed:")}`,
|
|
355
|
+
...installed.map((line) => ` ${line}`),
|
|
356
|
+
"",
|
|
357
|
+
`${pc.dim("Update a skill:")} npx bf-skills remove <name> then reinstall`,
|
|
358
|
+
`${pc.dim("List installed:")} npx bf-skills list`,
|
|
359
|
+
`${pc.dim("Remove a skill:")} npx bf-skills remove <name>`
|
|
360
|
+
].join("\n"),
|
|
361
|
+
"Next steps"
|
|
362
|
+
);
|
|
363
|
+
p.outro(pc.green("All done!"));
|
|
327
364
|
cleanup(tmpDir);
|
|
328
365
|
showFooter();
|
|
329
366
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bf-skills",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "BF Skills installer — Building the Future of Business with AI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"prepublishOnly": "npm run build"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@clack/prompts": "^
|
|
18
|
+
"@clack/prompts": "^1.2.0",
|
|
19
19
|
"picocolors": "^1.1.1",
|
|
20
20
|
"simple-git": "^3.27.0",
|
|
21
21
|
"yaml": "^2.7.0"
|