{"record":{"id":"ddbfec2a13fbb3b7","repo":"stablyai/orca","slug":"refusing-to-replace-non-orca-command-at-status-c","errorCode":null,"errorMessage":"Refusing to replace non-Orca command at ${status.commandPath}.","messagePattern":"Refusing to replace non-Orca command at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/cli/cli-installer.ts","lineNumber":189,"sourceCode":"    const spec = await this.resolveActiveInstallSpec(defaultSpec, launcherPath)\n    const baseStatus =\n      spec.installMethod === 'symlink'\n        ? await this.inspectSymlink(spec.commandPath, launcherPath)\n        : this.isLinuxAppImage()\n          ? await this.inspectAppImageWrapper(spec.commandPath, launcherPath)\n          : await this.inspectWindowsWrapper(spec.commandPath, launcherPath)\n    const pathDirectory = dirname(spec.commandPath)\n    const pathProbe = await this.probePathConfiguration(pathDirectory)\n    return this.withPathInfo(baseStatus, pathDirectory, pathProbe)\n  }\n\n  async install(): Promise<CliInstallStatus> {\n    const status = await this.getStatus()\n    if (!status.supported || !status.commandPath || !status.launcherPath || !status.installMethod) {\n      throw new Error(status.detail ?? 'CLI registration is unavailable on this build.')\n    }\n    if (status.state === 'conflict') {\n      throw new Error(`Refusing to replace non-Orca command at ${status.commandPath}.`)\n    }\n\n    // eslint-disable-next-line unicorn/prefer-ternary -- Why: the install path performs async side effects and is easier to audit as an explicit branch than as an awaited ternary.\n    if (status.installMethod === 'symlink') {\n      await this.installSymlink(status)\n      await this.removeLegacyLinuxCommandIfManaged(status.launcherPath)\n    } else if (this.isLinuxAppImage()) {\n      await this.installAppImageWrapper(status.commandPath, status.launcherPath)\n      await this.removeLegacyLinuxCommandIfManaged(status.launcherPath)\n    } else if (this.isWindowsPackagedBundledCommand(status.commandPath, status.launcherPath)) {\n      // Why: packaged Windows already ships resources/bin/orca.exe; registration only owns the PATH entry.\n    } else {\n      // Why: the Windows wrapper dir is user-writable (%LOCALAPPDATA%), so mkdir here can't hit EACCES.\n      await mkdir(dirname(status.commandPath), { recursive: true })\n      await this.installWindowsWrapper(status.commandPath, status.launcherPath)\n    }\n\n    if (this.platform === 'win32') {","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/cli/cli-installer.ts#L171-L207","documentation":"Thrown by CliInstaller.install() when status.state is 'conflict', meaning a non-Orca command already exists at the target commandPath. Orca refuses to overwrite a command it did not create to avoid clobbering a user's existing tool.","triggerScenarios":"Another application installed a command with the same name (e.g., 'orca') at the target path. The status probe (inspectSymlink/inspectWindowsWrapper) detected the existing file is not marked with Orca's managed marker.","commonSituations":"GNOME Orca screen reader's 'orca' command on Linux. A different tool named 'orca' in /usr/local/bin. A previous Orca install was partially removed leaving an unmanaged file.","solutions":["Check what is at status.commandPath: 'ls -la <path>' and 'file <path>'.","If it's safe to replace, manually remove or rename the conflicting file, then retry install.","If it's a different tool you need, change Orca's command name or install location if configurable.","On Linux, the rename to 'orca' from the legacy name was specifically to avoid GNOME Orca — verify the PATH order."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const status = await installer.getStatus()\nif (status.state === 'conflict') {\n  // Do not call install(); inform user about the conflicting command\n  showConflictGuidance(status.commandPath)\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await installer.install()\n} catch (error) {\n  if (error instanceof Error && error.message.includes('Refusing to replace non-Orca command')) {\n    // Prompt user to manually remove the conflicting file\n  } else { throw error }\n}","preventionTips":["Check for existing commands at the target path before installing.","On Linux, be aware GNOME Orca screen reader may own the 'orca' name.","Clean up old installs before re-registering."],"tags":["cli-installer","installation","conflict","safety-guard"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}