bf-skills 1.1.2 → 1.2.0
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 +35 -10
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -31,6 +31,32 @@ Expected a full GitHub URL (https://github.com/owner/repo) or a local path.`
|
|
|
31
31
|
import fs from "fs";
|
|
32
32
|
import path from "path";
|
|
33
33
|
import { parse as parseYaml } from "yaml";
|
|
34
|
+
var SKILL_EMOJIS = {
|
|
35
|
+
"api-and-integrations": "\u{1F50C}",
|
|
36
|
+
"browser-boss": "\u{1F310}",
|
|
37
|
+
"cyber-security": "\u{1F510}",
|
|
38
|
+
"database-indexing-strategy": "\u{1F5C2}\uFE0F",
|
|
39
|
+
"deployment-architect": "\u{1F680}",
|
|
40
|
+
"document-manager": "\u{1F4C4}",
|
|
41
|
+
"email-specialist": "\u{1F4E7}",
|
|
42
|
+
"full-stack-marketer": "\u{1F4C8}",
|
|
43
|
+
"fusion-skills": "\u2697\uFE0F",
|
|
44
|
+
"github-ops": "\u{1F419}",
|
|
45
|
+
"hook-development": "\u{1FA9D}",
|
|
46
|
+
"networks-and-proxy-expert": "\u{1F500}",
|
|
47
|
+
"nextjs-fullstack": "\u26A1",
|
|
48
|
+
"open-router-master": "\u{1F916}",
|
|
49
|
+
"rtk-optimizer": "\u26A1",
|
|
50
|
+
"skill-creator": "\u{1F6E0}\uFE0F",
|
|
51
|
+
"stripe-manager": "\u{1F4B3}",
|
|
52
|
+
"supabase-developer": "\u{1F5C4}\uFE0F",
|
|
53
|
+
"uazapi-whatsapp-expert": "\u{1F4AC}",
|
|
54
|
+
"webdesign-pro-max": "\u{1F3A8}",
|
|
55
|
+
"websocket-manager": "\u{1F517}"
|
|
56
|
+
};
|
|
57
|
+
function skillEmoji(name) {
|
|
58
|
+
return SKILL_EMOJIS[name] ?? "\u2726";
|
|
59
|
+
}
|
|
34
60
|
function readFrontmatter(filePath) {
|
|
35
61
|
const content = fs.readFileSync(filePath, "utf-8");
|
|
36
62
|
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
@@ -309,7 +335,7 @@ async function runInstall(source, opts) {
|
|
|
309
335
|
message: `Pick skills to install (${allSkills.length} available \u2014 type to search)`,
|
|
310
336
|
options: allSkills.map((s) => ({
|
|
311
337
|
value: s.name,
|
|
312
|
-
label: pc.blue(s.name)
|
|
338
|
+
label: `${skillEmoji(s.name)} ${pc.blue(s.name)}`,
|
|
313
339
|
hint: s.description
|
|
314
340
|
})),
|
|
315
341
|
required: true
|
|
@@ -328,7 +354,7 @@ async function runInstall(source, opts) {
|
|
|
328
354
|
p.note(
|
|
329
355
|
[
|
|
330
356
|
`${pc.bold("Skills:")}`,
|
|
331
|
-
...selectedSkills.map((s) => ` ${
|
|
357
|
+
...selectedSkills.map((s) => ` ${skillEmoji(s.name)} ${pc.blue(s.name)} ${pc.dim(s.description)}`),
|
|
332
358
|
"",
|
|
333
359
|
`${pc.bold("Install to:")}`,
|
|
334
360
|
...targetLines
|
|
@@ -425,12 +451,14 @@ function runRemove(name, opts) {
|
|
|
425
451
|
|
|
426
452
|
// src/cli.ts
|
|
427
453
|
var args = process.argv.slice(2);
|
|
454
|
+
var DEFAULT_CATALOG = "https://github.com/BFLabsAI/bf-skills-catalog.git";
|
|
428
455
|
function printHelp() {
|
|
429
456
|
showLogo();
|
|
430
457
|
console.log(`${COLORS.bold} Usage${COLORS.reset}`);
|
|
431
458
|
console.log("");
|
|
432
|
-
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset}
|
|
433
|
-
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset}
|
|
459
|
+
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} Browse & install from catalog`);
|
|
460
|
+
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} --skill <name...> Install specific skill(s)`);
|
|
461
|
+
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} <url> Install from custom repo`);
|
|
434
462
|
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} list List installed skills`);
|
|
435
463
|
console.log(` ${COLORS.yellow}npx bf-skills${COLORS.reset} remove <name> Remove a skill`);
|
|
436
464
|
console.log("");
|
|
@@ -478,7 +506,7 @@ function parseArgs(argv) {
|
|
|
478
506
|
return { command, positionals, skills, agent, global, yes };
|
|
479
507
|
}
|
|
480
508
|
async function main() {
|
|
481
|
-
if (args
|
|
509
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
482
510
|
printHelp();
|
|
483
511
|
return;
|
|
484
512
|
}
|
|
@@ -496,11 +524,8 @@ async function main() {
|
|
|
496
524
|
runRemove(name, { global: isGlobal });
|
|
497
525
|
return;
|
|
498
526
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
await runInstall(command, { skills, agent, global: isGlobal, yes });
|
|
527
|
+
const source = command || DEFAULT_CATALOG;
|
|
528
|
+
await runInstall(source, { skills, agent, global: isGlobal, yes });
|
|
504
529
|
}
|
|
505
530
|
main().catch((err) => {
|
|
506
531
|
console.error(err instanceof Error ? err.message : err);
|