{"record":{"id":"97ac1cb2e6f67de4","repo":"upstash/context7","slug":"no-context7-setup-detected-pass-one-of-all-age","errorCode":null,"errorMessage":"No Context7 setup detected. Pass one of: ${ALL_AGENT_NAMES.map((name) => `--${name}`).join(\", \")}.","messagePattern":"No Context7 setup detected\\. Pass one of: (.+?)`\\)\\.join\\(\", \"\\)\\}\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/remove.ts","lineNumber":144,"sourceCode":"        loop: false,\n        theme: CHECKBOX_THEME,\n      },\n      { getName: (mode: UninstallMode) => MODE_LABELS[mode] }\n    );\n  } catch {\n    return null;\n  }\n}\n\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 one of: ${ALL_AGENT_NAMES.map((name) => `--${name}`).join(\", \")}.`\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","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/upstash/context7/blob/4416fb855b8f752be735e34f943b5d0762701aad/packages/cli/src/commands/remove.ts#L126-L162","documentation":"remove.ts resolveAgents() logs 'No Context7 setup detected...' when detectConfiguredAgents() finds zero installed Context7 integrations for the given scope and no explicit --<agent> flags were provided. It returns an empty array so the remove command exits without deleting anything.","triggerScenarios":"Running a remove command with no agent flags (explicit.length === 0) while detectConfiguredAgents(scope) returns an empty list — i.e. no Context7 MCP/rule config files found for any supported agent, and --yes was not used.","commonSituations":"Trying to uninstall Context7 from a machine where it was never installed (or installed under a different user/scope); wrong --scope (project vs global) so detection misses the config; configs were already removed by a prior run.","solutions":["Pass an explicit agent flag, e.g. `--cursor`, `--claude`, matching ALL_AGENT_NAMES, to force removal","Check you used the right --scope (project vs global) where the setup actually lives","Verify the agent's config file actually contains a Context7 entry (e.g. mcpServers.context7)","If setup was never run, there is nothing to remove — the warning is expected"],"exampleFix":"// before\n// $ context7 remove            # nothing detected\n// after\n// $ context7 remove --cursor   # explicit agent flag","handlingStrategy":"validation","validationCode":"const hasCtx7 = (cfg) => Boolean(cfg?.mcpServers?.context7 ?? cfg?.context7);\nif (!hasCtx7(readAgentConfig(scope))) {\n  console.warn(\"No Context7 entry found; pass an explicit --<agent> flag or skip remove.\");\n}","typeGuard":"function hasContext7Config(cfg) {\n  return typeof cfg === \"object\" && cfg !== null &&\n    (\"context7\" in cfg.mcpServers || \"context7\" in cfg);\n}","tryCatchPattern":null,"preventionTips":["Pass explicit agent flags instead of relying on auto-detection","Match the --scope to where setup originally installed","Check the agent config file for a context7 entry before removing","Expect this warning if Context7 was never set up"],"tags":["cli","detection","missing-config"],"backgroundTag":"missing-config-value","analyzedSha":"4416fb855b8f752be735e34f943b5d0762701aad","analyzedAt":"2026-09-16T20:28:07.148Z","contentChangedAt":"2026-09-16T20:28:07.148Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}