{"record":{"id":"e03bd5810a094919","repo":"Hmbown/CodeWhale","slug":"not-found-on-path","errorCode":null,"errorMessage":"{} not found on PATH","messagePattern":"(.+?) not found on PATH","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/dependencies.rs","lineNumber":354,"sourceCode":"    ///\n    /// Callers should chain `.args(...)`, `.current_dir(...)`, and then\n    /// call `.output()`, `.status()`, or `.spawn()`.\n    fn command() -> Option<Command> {\n        let spec = Self::resolve()?;\n        let (program, fixed_args) = split_interpreter_spec(&spec);\n        let mut cmd = Command::new(&program);\n        crate::utils::suppress_console_window(&mut cmd);\n        for arg in &fixed_args {\n            cmd.arg(arg);\n        }\n        Some(cmd)\n    }\n\n    /// Convenience: run the tool with arguments in a working directory\n    /// and return the captured output.\n    fn output(args: &[&str], cwd: &std::path::Path) -> std::io::Result<std::process::Output> {\n        let mut cmd = Self::command().ok_or_else(|| {\n            std::io::Error::new(\n                std::io::ErrorKind::NotFound,\n                format!(\"{} not found on PATH\", std::any::type_name::<Self>()),\n            )\n        })?;\n        cmd.args(args).current_dir(cwd).output()\n    }\n\n    /// Convenience: run the tool with arguments and return only the\n    /// exit status (discards stdout/stderr).\n    #[allow(dead_code)]\n    fn status(args: &[&str], cwd: &std::path::Path) -> std::io::Result<std::process::ExitStatus> {\n        let mut cmd = Self::command().ok_or_else(|| {\n            std::io::Error::new(\n                std::io::ErrorKind::NotFound,\n                format!(\"{} not found on PATH\", std::any::type_name::<Self>()),\n            )\n        })?;\n        cmd.args(args).current_dir(cwd).status()","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/dependencies.rs#L336-L372","documentation":"The dependencies::Gh-style tool wrapper's output() helper runs the external tool and captures stdout/stderr; if Self::command() cannot locate the tool binary on PATH it returns an io::Error (NotFound) formatted as '{type name} not found on PATH'. The type name in the message identifies which tool was missing.","triggerScenarios":"Calling the output() convenience (e.g. tool.output(&[\"arg\"], cwd)) for a tracked dependency whose executable is absent from PATH in the current process environment.","commonSituations":"Tools installed per-user (nvm/rustup shims) while codewhale runs under a different user or service; minimal containers; IDE-spawned processes inheriting a stripped PATH.","solutions":["Install the named tool (see type name in the message) and ensure it is on PATH","Relaunch codewhale from a shell where `which <tool>` resolves","Fix PATH in the launching environment (shell profile, systemd unit, IDE settings)"],"exampleFix":"// before\nGit::output(&[\"status\"], repo_dir)?  // Err: cratename::Git not found on PATH\n// after\n$ which git || apt install git\n$ codewhale  # relaunched with git on PATH","handlingStrategy":"try-catch","validationCode":"fn tool_on_path<T: Dependency>() -> bool { T::command().is_some() }","typeGuard":"fn tool_available(cmd: &mut std::process::Command) -> bool { cmd.args([\"--version\"]).output().map(|o| o.status.success()).unwrap_or(false) }","tryCatchPattern":"match Tool::output(&[\"arg\"], cwd) {\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => eprintln!(\"{}: install it and add to PATH\", e),\n    other => other?,\n}","preventionTips":["Validate all external tool dependencies at startup (doctor command)","Avoid relying on user-specific shims in service environments; use absolute tool paths","Keep PATH consistent between interactive shells and launched processes"],"tags":["cli","dependency","path"],"backgroundTag":"command-not-found","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}