{"record":{"id":"ad5db427e41b38b7","repo":"zed-industries/zed","slug":"cannot-find-app-bundle-containing-cli-path","errorCode":null,"errorMessage":"cannot find app bundle containing {cli_path:?}","messagePattern":"cannot find app bundle containing (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/main.rs","lineNumber":1309,"sourceCode":"        #[serde(rename = \"CFBundleShortVersionString\")]\n        bundle_short_version_string: String,\n    }\n\n    enum Bundle {\n        App {\n            app_bundle: PathBuf,\n            plist: InfoPlist,\n        },\n        LocalPath {\n            executable: PathBuf,\n        },\n    }\n\n    fn locate_bundle() -> Result<PathBuf> {\n        let cli_path = std::env::current_exe()?.canonicalize()?;\n        let mut app_path = cli_path.clone();\n        while app_path.extension() != Some(OsStr::new(\"app\")) {\n            anyhow::ensure!(\n                app_path.pop(),\n                \"cannot find app bundle containing {cli_path:?}\"\n            );\n        }\n        Ok(app_path)\n    }\n\n    impl Detect {\n        pub fn detect(path: Option<&Path>) -> anyhow::Result<impl InstalledApp> {\n            let bundle_path = if let Some(bundle_path) = path {\n                bundle_path\n                    .canonicalize()\n                    .with_context(|| format!(\"Args bundle path {bundle_path:?} canonicalization\"))?\n            } else {\n                locate_bundle().context(\"bundle autodiscovery\")?\n            };\n\n            match bundle_path.extension().and_then(|ext| ext.to_str()) {","sourceCodeStart":1291,"sourceCodeEnd":1327,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/cli/src/main.rs#L1291-L1327","documentation":"macOS locate_bundle walks up from the CLI executable's path looking for a directory whose extension is .app; it reached the filesystem root without finding one, so the CLI is not running from inside an app bundle.","triggerScenarios":"Thrown at crates/cli/src/main.rs:1309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Invoke the CLI from inside the Zed.app bundle (e.g. symlink the bundled cli binary) so the .app ancestor exists","Install the CLI via Zed's built-in installer rather than copying the binary elsewhere","Run the standalone CLI outside bundle-launch mode if Zed.app is not installed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}