{"record":{"id":"2eb4a5114e8aa445","repo":"upstash/context7","slug":"remove-cancelled","errorCode":null,"errorMessage":"Remove cancelled","messagePattern":"Remove cancelled","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/cli/src/commands/remove.ts","lineNumber":165,"sourceCode":"\nasync function resolveAgents(options: UninstallOptions, scope: Scope): Promise<SetupAgent[]> {\n  const explicit = getSelectedAgents(options);\n  if (explicit.length > 0) return explicit;\n\n  const detected = await detectConfiguredAgents(scope);\n  if (detected.length > 0 && options.yes) return detected;\n\n  if (detected.length === 0) {\n    log.warn(\n      \"No Context7 setup detected. Pass --claude, --cursor, --opencode, --codex, --antigravity, or --gemini.\"\n    );\n    return [];\n  }\n\n  log.blank();\n  const selected = await promptAgents(detected);\n  if (!selected) {\n    log.warn(\"Remove cancelled\");\n    return [];\n  }\n\n  return selected;\n}\n\nfunction resolveFlagModes(options: UninstallOptions): UninstallMode[] {\n  if (options.all) return [\"mcp\", \"cli\"];\n\n  const selected: UninstallMode[] = [];\n\n  if (options.mcp) selected.push(\"mcp\");\n  if (options.cli) selected.push(\"cli\");\n\n  return selected.length > 0 ? selected : [\"mcp\", \"cli\"];\n}\n\nasync function pathExists(path: string): Promise<boolean> {","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/upstash/context7/blob/5284672feb575908efead6fcf1b5e542f8d607bb/packages/cli/src/commands/remove.ts#L147-L183","documentation":"In `context7 remove`, after detection finds configured agents and no --yes flag is set, promptAgents() shows a multi-select of detected agents. It returns null when the user cancels (Ctrl+C/Esc via @inquirer, or an empty selection), so resolveAgents() warns 'Remove cancelled' and returns an empty list — nothing is uninstalled.","triggerScenarios":"Cancelling or submitting an empty selection at the 'which agents to remove?' prompt when multiple Context7 setups are detected and --yes was not passed.","commonSituations":"User runs remove to 'see what would be removed' then bails at the selection; accidental Esc at the multi-select; user meant to run setup instead of remove.","solutions":["Re-run `context7 remove` and select at least one agent, or pass agent flags (--claude, --cursor, ...) to skip the prompt.","Use `context7 remove --yes` to accept all detected agents without an interactive prompt (useful in scripts)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// For scripted removals, skip the prompt entirely\n// context7 remove --claude --yes   (flags + --yes never show promptAgents)","typeGuard":"function selectedAgents(selected: SetupAgent[] | null): selected is SetupAgent[] {\n  return selected !== null && selected.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Use agent flags or --yes for non-interactive removals.","Treat a null promptAgents() result as a clean no-op exit, not an error.","Remember Ctrl+C and empty selections both produce null — select at least one agent."],"tags":["cli","remove","interactive-prompt","user-cancel"],"backgroundTag":"prompt-cancelled-by-user","analyzedSha":"5284672feb575908efead6fcf1b5e542f8d607bb","analyzedAt":"2026-08-18T18:00:18.510Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}