{"record":{"id":"4aa4ae55f1cc1ce4","repo":"paperclipai/paperclip","slug":"cannot-remove-the-shared-managed-cli-while-other-i","errorCode":null,"errorMessage":"Cannot remove the shared managed CLI while other instance services are installed: ${otherDefinitions.join(\", \")}. Uninstall those services first.","messagePattern":"Cannot remove the shared managed CLI while other instance services are installed: (.+?)\\. Uninstall those services first\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/uninstall.ts","lineNumber":49,"sourceCode":"  const pattern = platform === \"linux\"\n    ? /^paperclipai(?:-.+)?\\.service$/\n    : /^ing\\.paperclip\\.paperclipai(?:\\..+)?\\.plist$/;\n  return fs.readdirSync(directory)\n    .filter((name) => name !== currentName && pattern.test(name))\n    .map((name) => path.join(directory, name));\n}\n\nexport async function uninstallCommand(\n  dependencies: Partial<UninstallDependencies> = {},\n): Promise<void> {\n  const instanceId = resolvePaperclipInstanceId();\n  const detect = dependencies.detectServiceManager ?? detectServiceManager;\n  const platform = dependencies.platform ?? process.platform;\n  const userHomeDir = dependencies.userHomeDir ?? os.homedir();\n  const detection = await detect({ instanceId, platform });\n  const otherDefinitions = otherServiceDefinitions(platform, userHomeDir, instanceId);\n  if (otherDefinitions.length > 0) {\n    throw new Error(`Cannot remove the shared managed CLI while other instance services are installed: ${otherDefinitions.join(\", \")}. Uninstall those services first.`);\n  }\n  if (!detection.supported && platform === \"linux\") {\n    const definitionPath = path.join(\n      userHomeDir,\n      \".config\",\n      \"systemd\",\n      \"user\",\n      systemdServiceName(instanceId),\n    );\n    if (fs.existsSync(definitionPath)) {\n      throw new Error(\n        `Cannot verify or remove the background service: ${detection.reason}. Retry when the service manager is available.`,\n      );\n    }\n  }\n  if (detection.supported) {\n    const status = await detection.manager.status();\n    if (status.installed || status.active) await detection.manager.uninstall();","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/uninstall.ts#L31-L67","documentation":"uninstallCommand found other Paperclip instance service definitions still installed alongside the shared managed CLI; removing the shared CLI now would break those services, so the guard demands they be uninstalled first.","triggerScenarios":"Thrown at cli/src/commands/uninstall.ts:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Uninstall the other instance services first, then remove the shared managed CLI."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}