{"record":{"id":"9110442d794d0fe6","repo":"stablyai/orca","slug":"refusing-to-remove-non-orca-command-at-status-co","errorCode":null,"errorMessage":"Refusing to remove non-Orca command at ${status.commandPath}.","messagePattern":"Refusing to remove non-Orca command at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/main/cli/cli-installer.ts","lineNumber":229,"sourceCode":"\n    return this.getStatus()\n  }\n\n  async remove(): Promise<CliInstallStatus> {\n    const status = await this.getStatus()\n    if (!status.supported || !status.commandPath || !status.launcherPath || !status.installMethod) {\n      return status\n    }\n    if (status.state === 'not_installed') {\n      await this.removeLegacyLinuxCommandIfManaged(status.launcherPath)\n      if (this.platform === 'win32') {\n        await this.removeWindowsPathEntry(dirname(status.commandPath))\n        return this.getStatus()\n      }\n      return status\n    }\n    if (status.state === 'conflict') {\n      throw new Error(`Refusing to remove non-Orca command at ${status.commandPath}.`)\n    }\n    if (status.state === 'stale') {\n      throw new Error(`Refusing to remove a command not owned by Orca at ${status.commandPath}.`)\n    }\n\n    if (status.installMethod === 'symlink') {\n      await this.removeSymlink(status.commandPath)\n      await this.removeLegacyLinuxCommandIfManaged(status.launcherPath)\n    } else if (this.isWindowsPackagedBundledCommand(status.commandPath, status.launcherPath)) {\n      await this.removeWindowsPathEntry(dirname(status.commandPath))\n    } else {\n      await unlink(status.commandPath)\n      await this.removeWindowsPathEntry(dirname(status.commandPath))\n    }\n\n    return this.getStatus()\n  }\n","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/cli/cli-installer.ts#L211-L247","documentation":"Thrown by CliInstaller.remove() when status.state is 'conflict'. Orca will not delete a command at the target path that it did not create, to prevent removing another application's binary.","triggerScenarios":"Calling remove() when a non-Orca command exists at commandPath. The status probe determined the existing file lacks Orca's managed marker, so it's classified as a conflict rather than an Orca-owned command.","commonSituations":"Same as install conflict: another tool named 'orca' exists at the target path. A user is trying to unregister Orca's CLI but a different tool is now at that location.","solutions":["Verify the file at status.commandPath is not Orca's: check for the managed marker.","If you want it gone, manually remove it: 'rm <status.commandPath>'.","If it's a tool you want to keep, no action is needed — Orca correctly refused to touch it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const status = await installer.getStatus()\nif (status.state === 'conflict') {\n  // Do not call remove(); it's not Orca's command\n  showInfo('The command at the target path is not owned by Orca and will not be removed.')\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await installer.remove()\n} catch (error) {\n  if (error instanceof Error && error.message.includes('Refusing to remove non-Orca command')) {\n    // Safe no-op; the command belongs to another tool\n  } else { throw error }\n}","preventionTips":["Check status.state before calling remove().","Document that Orca will never remove foreign commands — this is by design."],"tags":["cli-installer","removal","conflict","safety-guard"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}