pub fn command_exists(cmd: &str) -> bool
Check if a command exists in PATH, caching the result to avoid repeated filesystem scans (which can be expensive when called frequently).