upstash/context7 · info

Installation cancelled

Error message

Installation cancelled

What it means

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.

Source

Thrown at packages/cli/src/utils/ide.ts:134

    log.blank();

    let confirmed: boolean;
    if (options.yes) {
      confirmed = true;
    } else {
      try {
        confirmed = await confirm({
          message: `Install to detected location(s)?\n${pc.dim(pathLines.join("\n"))}`,
          default: true,
        });
      } catch {
        return null;
      }
    }

    if (!confirmed) {
      log.warn("Installation cancelled");
      return null;
    }

    return { ides: detectedIdes, scopes: [scope] };
  }

  // Nothing detected — show checkbox to pick
  const universalLabel = `Universal \u2014 ${UNIVERSAL_AGENTS_LABEL} ${pc.dim(`(${universalPath})`)}`;
  const choices: { name: string; value: IDE; checked: boolean }[] = [
    {
      name: `${IDE_NAMES["claude"]} ${pc.dim(`(${pathMap["claude"]})`)}`,
      value: "claude" as IDE,
      checked: false,
    },
    { name: universalLabel, value: "universal", checked: false },
  ];

  for (const ide of VENDOR_SPECIFIC_AGENTS.filter((ide) => ide !== "claude")) {

View on GitHub (pinned to 5284672feb)

Solutions

  1. Re-run and accept the confirm if the detected locations are correct
  2. Name the target explicitly to skip detection+confirm: `--claude`, `--cursor`, `--universal`, or `--antigravity` (plus `--global`)
  3. Add `-y/--yes` to auto-accept the detected-location confirm in scripts

Example fix

# before
$ ctx7 skills add my-skill   # 'n' at 'Install to detected location(s)?' -> Installation cancelled

# after
$ ctx7 skills add my-skill --cursor -y
Defensive patterns

Strategy: validation

Validate before calling

// Decide targets from flags first; only fall back to interactive detection when allowed
function resolveTargets(options: AddOptions, interactive: boolean): InstallTargets | null {
  if (options.claude || options.cursor || options.universal || options.antigravity) {
    return {
      ides: getSelectedIdes(options),
      scopes: [options.global ? "global" : "project"],
    };
  }
  if (!interactive) return null; // refuse to prompt in non-TTY contexts
  return null; // caller falls through to promptForInstallTargets
}

Type guard

function isConfirmResult(v: boolean | null | undefined): v is boolean {
  return v === true || v === false;
}

Try / catch

let confirmed: boolean;
try {
  confirmed = await confirm({ message: `Install to detected location(s)?`, default: true });
} catch {
  return null; // prompt blew up (EOF/Ctrl+C) — treat as cancelled, not as confirmed=false
}
if (!confirmed) {
  log.warn("Installation cancelled");
  return null;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of upstash/context7@5284672feb (2026-08-18). Data as JSON: /api/errors/8d98f0e82441eff2. Report an issue: GitHub.