bf-skills 1.1.0 → 1.1.2
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 +72 -37
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -174,20 +174,29 @@ var R = "\x1B[0m";
|
|
|
174
174
|
var COLORS = {
|
|
175
175
|
reset: R,
|
|
176
176
|
bold: "\x1B[1m",
|
|
177
|
-
dim: "\x1B[
|
|
178
|
-
|
|
177
|
+
dim: "\x1B[2m",
|
|
178
|
+
// Text hierarchy (matches bf-scripts)
|
|
179
|
+
text: "\x1B[38;5;255m",
|
|
180
|
+
// bright white — primary labels
|
|
181
|
+
muted: "\x1B[38;5;240m",
|
|
182
|
+
// gray — secondary / metadata
|
|
183
|
+
// Branding
|
|
184
|
+
yellow: "\x1B[38;5;220m",
|
|
185
|
+
// gold yellow — title + tagline
|
|
179
186
|
blue: "\x1B[38;5;39m",
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
187
|
+
// electric blue — option labels
|
|
188
|
+
// Semantic
|
|
189
|
+
green: "\x1B[38;5;114m",
|
|
190
|
+
red: "\x1B[38;5;203m",
|
|
191
|
+
warn: "\x1B[38;5;221m"
|
|
183
192
|
};
|
|
184
|
-
var
|
|
185
|
-
"\x1B[38;5;
|
|
186
|
-
"\x1B[38;5;
|
|
187
|
-
"\x1B[38;5;
|
|
188
|
-
"\x1B[38;5;
|
|
189
|
-
"\x1B[38;5;
|
|
190
|
-
"\x1B[38;5;
|
|
193
|
+
var LOGO_GRADIENT = [
|
|
194
|
+
"\x1B[38;5;250m",
|
|
195
|
+
"\x1B[38;5;248m",
|
|
196
|
+
"\x1B[38;5;245m",
|
|
197
|
+
"\x1B[38;5;243m",
|
|
198
|
+
"\x1B[38;5;240m",
|
|
199
|
+
"\x1B[38;5;238m"
|
|
191
200
|
];
|
|
192
201
|
var LOGO_LINES = [
|
|
193
202
|
"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
|
|
@@ -200,15 +209,16 @@ var LOGO_LINES = [
|
|
|
200
209
|
function showLogo() {
|
|
201
210
|
console.log("");
|
|
202
211
|
LOGO_LINES.forEach((line, i) => {
|
|
203
|
-
console.log(`${
|
|
212
|
+
console.log(`${LOGO_GRADIENT[i]} ${line}${R}`);
|
|
204
213
|
});
|
|
205
214
|
console.log("");
|
|
206
|
-
console.log(
|
|
215
|
+
console.log(` ${COLORS.yellow}${COLORS.bold}BF SKILLS${R}`);
|
|
216
|
+
console.log(` ${COLORS.yellow}${COLORS.dim}Building the Future of Business with AI${R}`);
|
|
207
217
|
console.log("");
|
|
208
218
|
}
|
|
209
219
|
function showFooter() {
|
|
210
220
|
console.log("");
|
|
211
|
-
console.log(
|
|
221
|
+
console.log(` ${COLORS.muted}buildingthefuture.ai${R}`);
|
|
212
222
|
console.log("");
|
|
213
223
|
}
|
|
214
224
|
|
|
@@ -242,7 +252,7 @@ async function runInstall(source, opts) {
|
|
|
242
252
|
message: "Where do you want to install skills?",
|
|
243
253
|
options: AGENTS.map((a) => ({
|
|
244
254
|
value: a.id,
|
|
245
|
-
label: a.label,
|
|
255
|
+
label: pc.blue(a.label),
|
|
246
256
|
hint: opts.global ? a.globalPath : `./${a.projectPath}`
|
|
247
257
|
})),
|
|
248
258
|
initialValues: DEFAULT_AGENT_IDS,
|
|
@@ -299,7 +309,7 @@ async function runInstall(source, opts) {
|
|
|
299
309
|
message: `Pick skills to install (${allSkills.length} available \u2014 type to search)`,
|
|
300
310
|
options: allSkills.map((s) => ({
|
|
301
311
|
value: s.name,
|
|
302
|
-
label: s.name,
|
|
312
|
+
label: pc.blue(s.name),
|
|
303
313
|
hint: s.description
|
|
304
314
|
})),
|
|
305
315
|
required: true
|
|
@@ -311,31 +321,56 @@ async function runInstall(source, opts) {
|
|
|
311
321
|
}
|
|
312
322
|
selectedSkills = allSkills.filter((s) => selected.includes(s.name));
|
|
313
323
|
}
|
|
314
|
-
const
|
|
324
|
+
const targetLines = targetAgents.map((a) => {
|
|
315
325
|
const dest = opts.global ? a.globalPath : `./${a.projectPath}`;
|
|
316
|
-
return
|
|
326
|
+
return ` ${pc.dim("\u2192")} ${pc.bold(a.label)} ${pc.dim(dest)}`;
|
|
317
327
|
});
|
|
318
328
|
p.note(
|
|
319
329
|
[
|
|
320
|
-
`${pc.bold("Skills:")}
|
|
330
|
+
`${pc.bold("Skills:")}`,
|
|
331
|
+
...selectedSkills.map((s) => ` ${pc.cyan("\u2022")} ${s.name} ${pc.dim(s.description)}`),
|
|
332
|
+
"",
|
|
321
333
|
`${pc.bold("Install to:")}`,
|
|
322
|
-
...
|
|
334
|
+
...targetLines
|
|
323
335
|
].join("\n"),
|
|
324
336
|
"Ready to install"
|
|
325
337
|
);
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
+
if (!opts.yes) {
|
|
339
|
+
const go = await p.confirm({ message: "Proceed with installation?" });
|
|
340
|
+
if (p.isCancel(go) || go === false) {
|
|
341
|
+
p.cancel("Installation cancelled.");
|
|
342
|
+
cleanup(tmpDir);
|
|
343
|
+
process.exit(0);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const prog = p.progress({
|
|
347
|
+
indicator: "timer",
|
|
348
|
+
style: "block",
|
|
349
|
+
max: selectedSkills.length
|
|
350
|
+
});
|
|
351
|
+
prog.start(`Installing ${selectedSkills.length} skill${selectedSkills.length === 1 ? "" : "s"}...`);
|
|
352
|
+
const installed = [];
|
|
353
|
+
for (const skill of selectedSkills) {
|
|
354
|
+
prog.advance(1, `Installing ${pc.cyan(skill.name)}...`);
|
|
355
|
+
const paths = installSkill(skill.dir, skill.name, targetAgents, opts.global);
|
|
356
|
+
installed.push(...paths.map((dest, i) => {
|
|
357
|
+
const rel = dest.startsWith(process.cwd()) ? "." + dest.slice(process.cwd().length) : dest.replace(os2.homedir(), "~");
|
|
358
|
+
return `${pc.cyan(skill.name)} ${pc.dim("\u2192")} ${rel}${i > 0 ? pc.dim(" (symlink)") : ""}`;
|
|
359
|
+
}));
|
|
360
|
+
}
|
|
361
|
+
prog.stop(`${selectedSkills.length} skill${selectedSkills.length === 1 ? "" : "s"} installed`);
|
|
362
|
+
p.note(
|
|
363
|
+
[
|
|
364
|
+
`${pc.bold("Installed:")}`,
|
|
365
|
+
...installed.map((line) => ` ${line}`),
|
|
366
|
+
"",
|
|
367
|
+
`${pc.dim("Update a skill:")} npx bf-skills remove <name> then reinstall`,
|
|
368
|
+
`${pc.dim("List installed:")} npx bf-skills list`,
|
|
369
|
+
`${pc.dim("Remove a skill:")} npx bf-skills remove <name>`
|
|
370
|
+
].join("\n"),
|
|
371
|
+
"Next steps"
|
|
338
372
|
);
|
|
373
|
+
p.outro(pc.green("All done!"));
|
|
339
374
|
cleanup(tmpDir);
|
|
340
375
|
showFooter();
|
|
341
376
|
}
|
|
@@ -394,10 +429,10 @@ function printHelp() {
|
|
|
394
429
|
showLogo();
|
|
395
430
|
console.log(`${COLORS.bold} Usage${COLORS.reset}`);
|
|
396
431
|
console.log("");
|
|
397
|
-
console.log(` ${COLORS.
|
|
398
|
-
console.log(` ${COLORS.
|
|
399
|
-
console.log(` ${COLORS.
|
|
400
|
-
console.log(` ${COLORS.
|
|
432
|
+
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} <url> Browse & install from a repo`);
|
|
433
|
+
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} <url> --skill <name...> Install specific skill(s)`);
|
|
434
|
+
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} list List installed skills`);
|
|
435
|
+
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} remove <name> Remove a skill`);
|
|
401
436
|
console.log("");
|
|
402
437
|
console.log(`${COLORS.bold} Flags${COLORS.reset}`);
|
|
403
438
|
console.log("");
|