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

Function removeCommand

packages/cli/src/commands/remove.ts:505–527  ·  view source on GitHub ↗
(options: UninstallOptions)

Source from the content-addressed store, hash-verified

503}
504
505async function removeCommand(options: UninstallOptions): Promise<void> {
506 trackEvent("command", { name: "remove" });
507
508 const scope: Scope = options.project ? "project" : "global";
509 const agents = await resolveAgents(options, scope);
510 if (agents.length === 0) return;
511 const modes = await resolveModes(options, agents, scope);
512 if (modes.length === 0) return;
513
514 log.blank();
515 const spinner = ora("Removing Context7 setup...").start();
516
517 const results: AgentCleanupResult[] = [];
518 for (const agentName of agents) {
519 spinner.text = `Cleaning up ${getAgent(agentName).displayName}...`;
520 results.push(await uninstallAgent(agentName, scope, modes));
521 }
522
523 spinner.succeed("Context7 cleanup complete");
524 printResults(results, modes);
525
526 trackEvent("remove", { agents, scope, modes });
527}

Callers 1

registerRemoveCommandFunction · 0.70

Calls 6

trackEventFunction · 0.85
resolveModesFunction · 0.85
getAgentFunction · 0.85
uninstallAgentFunction · 0.85
printResultsFunction · 0.85
resolveAgentsFunction · 0.70

Tested by

no test coverage detected