{"record":{"id":"008c91012f47fc60","repo":"upstash/context7","slug":"no-context7-setup-detected-pass-claude-curso","errorCode":null,"errorMessage":"No Context7 setup detected. Pass --claude, --cursor, --opencode, --codex, --antigravity, or --gemini.","messagePattern":"No Context7 setup detected\\. Pass --claude, --cursor, --opencode, --codex, --antigravity, or --gemini\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/remove.ts","lineNumber":156,"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 --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","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/upstash/context7/blob/5284672feb575908efead6fcf1b5e542f8d607bb/packages/cli/src/commands/remove.ts#L138-L174","documentation":"`context7 remove` first resolves what to uninstall: explicit agent flags, then detectConfiguredAgents(scope) which scans config files (e.g. .mcp.json, agent rules) for Context7 setup. When nothing is found and no agent flags were passed, there is nothing to remove, so the CLI warns 'No Context7 setup detected' and lists the accepted flags instead of prompting.","triggerScenarios":"Running `context7 remove` on a machine/directory with no Context7 MCP or rule configuration for the selected scope; running with `--scope project` in a repo whose Context7 config lives in the user (global) scope, or vice versa; configs were already removed by a previous run.","commonSituations":"Wrong directory: the setup was done in another project so project-scope detection finds nothing; setup was installed under a different user account (homedir); the user manually deleted .mcp.json earlier; mixing up remove scope flags.","solutions":["Check which scope holds the config: re-run with the other scope flag (e.g. `--scope user`/`--global` vs default project).","Run `context7 remove` from the project root where setup originally ran (the one containing .mcp.json or agent rule files).","If you know the agent, pass its flag directly — `context7 remove --claude` skips detection entirely.","Verify a Context7 config actually exists (look for .mcp.json / agent config dirs) before invoking remove."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { access } from \"node:fs/promises\";\n\n// Pre-check the scopes a Context7 setup would live in before running remove\nasync function hasAnySetup(candidates: string[]): Promise<boolean> {\n  const results = await Promise.allSettled(candidates.map((p) => access(p)));\n  return results.some((r) => r.status === \"fulfilled\");\n}\n// e.g. candidates = [join(homedir(), \".claude\"), join(process.cwd(), \".mcp.json\")]","typeGuard":"import type { SetupAgent } from \"../agents.js\";\n\nfunction hasDetectedAgents(agents: SetupAgent[]): boolean {\n  return Array.isArray(agents) && agents.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Run remove from the same directory (and scope) where setup was originally executed.","Remember which scope you installed to (project vs user/global) and pass the matching scope flag.","When in doubt, pass explicit agent flags (--claude, ...) — they bypass detection.","Keep a note of which Context7 config files setup created so removal is deterministic."],"tags":["cli","remove","config-detection","setup"],"backgroundTag":"missing-config","analyzedSha":"5284672feb575908efead6fcf1b5e542f8d607bb","analyzedAt":"2026-08-18T18:00:18.510Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}