{"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/80e681a507c5287bc12e483367c40754e29461b9/packages/cli/src/commands/remove.ts#L126-L162","documentation":"Warning log (not a thrown exception) emitted by the CLI remove command's resolveAgents when no Context7-configured agents are detected for the given scope and no --<agent> flags were passed. It returns an empty agent list, so nothing is removed.","triggerScenarios":"Running `context7 remove` (or similar) with no --cursor/--claude/etc. flag, no --yes, and detectConfiguredAgents(scope) finds zero agent config files in the project/global scope.","commonSituations":"Running remove in a directory where Context7 was never initialized, config files were already deleted manually, or the scope (project vs global) differs from where setup was done.","solutions":["Pass an explicit agent flag matching your setup, e.g. context7 remove --cursor or --claude (see the listed ALL_AGENT_NAMES options).","Run in the project directory that actually contains the Context7 agent config files.","Check the correct scope: retry with global vs project scope depending on where setup ran.","List available agent flags via context7 remove --help and pick the one you configured."],"exampleFix":"// before\n$ context7 remove\n// warn: No Context7 setup detected...\n// after\n$ context7 remove --cursor --yes","handlingStrategy":"validation","validationCode":"// Check for setup before running remove\nimport { existsSync } from 'fs';\nconst hasSetup = ['.context7', '.cursor/mcp.json', '.claude/settings.json'].some(existsSync);\nif (!hasSetup) console.warn('No Context7 setup found in this directory; run context7 init first or pass an explicit --agent flag.');","typeGuard":null,"tryCatchPattern":"// CLI-level: check the warn output / empty agent list\nconst agents = await resolveAgents(options);\nif (agents.length === 0) {\n  console.error('Nothing removed: pass --cursor / --claude etc. explicitly.');\n  process.exitCode = 1;\n}","preventionTips":["Run remove from the project root where Context7 was initialized.","Pass explicit --<agent> flags in scripts/CI instead of relying on detection.","Confirm the scope (project vs global) matches where setup ran.","Run context7 init/list first to see what is configured."],"tags":["cli","configuration","detection"],"backgroundTag":"missing-config-file","analyzedSha":"80e681a507c5287bc12e483367c40754e29461b9","analyzedAt":"2026-09-08T05:18:41.043Z","contentChangedAt":"2026-09-08T05:18:41.043Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}