{"record":{"id":"8d98f0e82441eff2","repo":"upstash/context7","slug":"installation-cancelled-8d98f0","errorCode":null,"errorMessage":"Installation cancelled","messagePattern":"Installation cancelled","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/cli/src/utils/ide.ts","lineNumber":134,"sourceCode":"\n    log.blank();\n\n    let confirmed: boolean;\n    if (options.yes) {\n      confirmed = true;\n    } else {\n      try {\n        confirmed = await confirm({\n          message: `Install to detected location(s)?\\n${pc.dim(pathLines.join(\"\\n\"))}`,\n          default: true,\n        });\n      } catch {\n        return null;\n      }\n    }\n\n    if (!confirmed) {\n      log.warn(\"Installation cancelled\");\n      return null;\n    }\n\n    return { ides: detectedIdes, scopes: [scope] };\n  }\n\n  // Nothing detected — show checkbox to pick\n  const universalLabel = `Universal \\u2014 ${UNIVERSAL_AGENTS_LABEL} ${pc.dim(`(${universalPath})`)}`;\n  const choices: { name: string; value: IDE; checked: boolean }[] = [\n    {\n      name: `${IDE_NAMES[\"claude\"]} ${pc.dim(`(${pathMap[\"claude\"]})`)}`,\n      value: \"claude\" as IDE,\n      checked: false,\n    },\n    { name: universalLabel, value: \"universal\", checked: false },\n  ];\n\n  for (const ide of VENDOR_SPECIFIC_AGENTS.filter((ide) => ide !== \"claude\")) {","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/upstash/context7/blob/5284672feb575908efead6fcf1b5e542f8d607bb/packages/cli/src/utils/ide.ts#L116-L152","documentation":"Logged in packages/cli/src/utils/ide.ts when install-target autodetection found candidate directories (universal .agents/ or vendor-specific agent dirs) but the user answered 'no' to the 'Install to detected location(s)?' confirm — or that confirm prompt threw (also caught and mapped to null). The helper returns null, which commands like add/search/suggest surface as 'Installation cancelled'. Nothing is written.","triggerScenarios":"Run an install command in a project that already has .agents/, .claude/, or .cursor/ directories; the CLI proposes those detected paths; you decline the confirmation. Also when the confirm prompt fails in a non-TTY environment.","commonSituations":"Users declining because the detected list missed the IDE they actually wanted (e.g. detected .agents but they target Cursor); automation hitting the confirm without -y; declining to rethink scope choice.","solutions":["Re-run and accept the confirm if the detected locations are correct","Name the target explicitly to skip detection+confirm: `--claude`, `--cursor`, `--universal`, or `--antigravity` (plus `--global`)","Add `-y/--yes` to auto-accept the detected-location confirm in scripts"],"exampleFix":"# before\n$ ctx7 skills add my-skill   # 'n' at 'Install to detected location(s)?' -> Installation cancelled\n\n# after\n$ ctx7 skills add my-skill --cursor -y","handlingStrategy":"validation","validationCode":"// Decide targets from flags first; only fall back to interactive detection when allowed\nfunction resolveTargets(options: AddOptions, interactive: boolean): InstallTargets | null {\n  if (options.claude || options.cursor || options.universal || options.antigravity) {\n    return {\n      ides: getSelectedIdes(options),\n      scopes: [options.global ? \"global\" : \"project\"],\n    };\n  }\n  if (!interactive) return null; // refuse to prompt in non-TTY contexts\n  return null; // caller falls through to promptForInstallTargets\n}","typeGuard":"function isConfirmResult(v: boolean | null | undefined): v is boolean {\n  return v === true || v === false;\n}","tryCatchPattern":"let confirmed: boolean;\ntry {\n  confirmed = await confirm({ message: `Install to detected location(s)?`, default: true });\n} catch {\n  return null; // prompt blew up (EOF/Ctrl+C) — treat as cancelled, not as confirmed=false\n}\nif (!confirmed) {\n  log.warn(\"Installation cancelled\");\n  return null;\n}","preventionTips":["Pass an explicit IDE flag whenever the detected locations might not match your intent","Use -y to auto-accept detected locations in automation","Treat a declined confirm as a clean no-op (null return), never as an error exit code"],"tags":["cli","interactive-prompt","user-cancellation","install","ide-detection"],"backgroundTag":"user-cancelled-prompt","analyzedSha":"5284672feb575908efead6fcf1b5e542f8d607bb","analyzedAt":"2026-08-18T18:00:18.510Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}