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

Function resolveAgents

packages/cli/src/commands/remove.ts:148–170  ·  view source on GitHub ↗
(options: UninstallOptions, scope: Scope)

Source from the content-addressed store, hash-verified

146}
147
148async function resolveAgents(options: UninstallOptions, scope: Scope): Promise<SetupAgent[]> {
149 const explicit = getSelectedAgents(options);
150 if (explicit.length > 0) return explicit;
151
152 const detected = await detectConfiguredAgents(scope);
153 if (detected.length > 0 && options.yes) return detected;
154
155 if (detected.length === 0) {
156 log.warn(
157 "No Context7 setup detected. Pass --claude, --cursor, --opencode, --codex, --antigravity, or --gemini."
158 );
159 return [];
160 }
161
162 log.blank();
163 const selected = await promptAgents(detected);
164 if (!selected) {
165 log.warn("Remove cancelled");
166 return [];
167 }
168
169 return selected;
170}
171
172function resolveFlagModes(options: UninstallOptions): UninstallMode[] {
173 if (options.all) return ["mcp", "cli"];

Callers 1

removeCommandFunction · 0.70

Calls 3

detectConfiguredAgentsFunction · 0.85
getSelectedAgentsFunction · 0.70
promptAgentsFunction · 0.70

Tested by

no test coverage detected