MCPcopy
hub / github.com/upstash/context7 / uninstallSkills

Function uninstallSkills

packages/cli/src/commands/remove.ts:403–432  ·  view source on GitHub ↗
(
  agentName: SetupAgent,
  scope: Scope,
  skillNames: readonly string[]
)

Source from the content-addressed store, hash-verified

401}
402
403async function uninstallSkills(
404 agentName: SetupAgent,
405 scope: Scope,
406 skillNames: readonly string[]
407): Promise<SkillCleanupStatus[]> {
408 const agent = getAgent(agentName);
409 const skillsDir =
410 scope === "global"
411 ? agent.skill.dir("global")
412 : join(process.cwd(), agent.skill.dir("project"));
413
414 const results: SkillCleanupStatus[] = [];
415
416 for (const skillName of skillNames) {
417 const skillPath = join(skillsDir, skillName);
418 try {
419 await rm(skillPath, { recursive: true });
420 results.push({ name: skillName, status: "removed", path: skillPath });
421 } catch (err) {
422 const error = err as NodeJS.ErrnoException;
423 if (error.code === "ENOENT") {
424 results.push({ name: skillName, status: "not found", path: skillPath });
425 } else {
426 results.push({ name: skillName, status: `failed: ${error.message}`, path: skillPath });
427 }
428 }
429 }
430
431 return results;
432}
433
434async function uninstallAgent(
435 agentName: SetupAgent,

Callers 1

uninstallAgentFunction · 0.85

Calls 1

getAgentFunction · 0.85

Tested by

no test coverage detected