MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / installSkills

Function installSkills

src/skill-manager.ts:70–99  ·  view source on GitHub ↗
(workDir: string, skills: SkillEntry[])

Source from the content-addressed store, hash-verified

68}
69
70export function installSkills(workDir: string, skills: SkillEntry[]): void {
71 if (skills.length === 0) {
72 return;
73 }
74
75 for (const group of groupSkillsBySource(skills)) {
76 const args = buildInstallArgs(group);
77 const displayArgs = args
78 .map((arg) => (/\s/.test(arg) ? JSON.stringify(arg) : arg))
79 .join(" ");
80
81 console.log(chalk.dim(`> npx ${displayArgs}`));
82
83 const result = spawnSync("npx", args, {
84 cwd: workDir,
85 stdio: "inherit",
86 encoding: "utf-8",
87 });
88
89 if (result.error) {
90 throw result.error;
91 }
92
93 if (result.status !== 0) {
94 throw new Error(
95 `Failed to install skills from ${group.source} (exit code ${result.status ?? "unknown"})`,
96 );
97 }
98 }
99}
100
101export function scanInstalledSkills(workDir: string): InstalledSkill[] {
102 const installed: InstalledSkill[] = [];

Callers 3

installConfiguredSkillsFunction · 0.85
zipCommandFunction · 0.85
runCommandFunction · 0.85

Calls 2

groupSkillsBySourceFunction · 0.85
buildInstallArgsFunction · 0.85

Tested by

no test coverage detected