{"record":{"id":"cb181c2f08e5993a","repo":"gitbutlerapp/gitbutler","slug":"cli-installation-from-the-app-is-only-supported-on-macos","errorCode":null,"errorMessage":"CLI installation from the app is only supported on macOS","messagePattern":"CLI installation from the app is only supported on macOS","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-api/src/legacy/cli.rs","lineNumber":58,"sourceCode":"            symlink_policy,\n        ) {\n            Ok(()) => Ok(true),\n            Err(err)\n                if err\n                    .downcast_ref::<but_error::Context>()\n                    .is_some_and(|context| {\n                        matches!(context.code, but_error::Code::CliInstallCancelled)\n                    }) =>\n            {\n                Ok(false)\n            }\n            Err(err) => Err(err),\n        }\n    }\n    #[cfg(not(target_os = \"macos\"))]\n    {\n        let _ = (cli_path, symlink_policy);\n        anyhow::bail!(\"CLI installation from the app is only supported on macOS\")\n    }\n}\n\n#[but_api]\n#[instrument(err(Debug))]\npub fn cli_path() -> Result<String> {\n    let cli_path = get_cli_path()?;\n    Ok(cli_path.to_string_lossy().to_string())\n}\n","sourceCodeStart":40,"sourceCodeEnd":68,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-api/src/legacy/cli.rs#L40-L68","documentation":"install_cli_v2, the newer CLI installation entry point, is only implemented for macOS. On non-macOS platforms the parameters are ignored and the function bails, telling users installation from the app is macOS-only and manual steps are required.","triggerScenarios":"Calling install_cli_v2(cli_path, symlink_policy) on a non-macOS platform.","commonSituations":"Desktop app running on Linux/Windows invoking the v2 install API; CLI setup flows not gated by OS.","solutions":["Install the CLI manually per the instructions in Settings","Hide the install action on non-macOS platforms","Use the platform's own package manager or symlink the binary yourself"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (process.platform !== 'darwin') {\n  showManualInstallInstructions();\n} else {\n  await installCliV2(cliPath, policy);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await installCliV2(cliPath, policy);\n} catch (e) {\n  if (String(e).includes('only supported on macOS')) {\n    openManualInstallDocs();\n  } else throw e;\n}","preventionTips":["Gate v2 install UI to darwin builds","Document manual installation for Linux/Windows users","Add platform checks in the command layer, not just UI"],"tags":["rust","cli","platform"],"backgroundTag":"unsupported-platform","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}