{"record":{"id":"8983a7f7577c6458","repo":"tonhowtf/omniget","slug":"kdeconnect-cli-nao-encontrado","errorCode":null,"errorMessage":"kdeconnect-cli nao encontrado","messagePattern":"kdeconnect-cli nao encontrado","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/kdeconnect.rs","lineNumber":97,"sourceCode":"    };\n    let devices = crate::core::process::command(&bin)\n        .args([\"-l\"])\n        .output()\n        .await\n        .map(|o| parse_devices(&String::from_utf8_lossy(&o.stdout)))\n        .unwrap_or_default();\n    KdeStatus {\n        installed: true,\n        path: Some(bin.to_string_lossy().to_string()),\n        devices,\n        install_hint: hint,\n    }\n}\n\nasync fn run(args: &[&str]) -> anyhow::Result<String> {\n    let bin = locate()\n        .await\n        .ok_or_else(|| anyhow!(\"kdeconnect-cli nao encontrado\"))?;\n    let out = crate::core::process::command(&bin)\n        .args(args)\n        .output()\n        .await?;\n    if !out.status.success() {\n        return Err(anyhow!(\n            \"kdeconnect-cli falhou: {}\",\n            String::from_utf8_lossy(&out.stderr).trim()\n        ));\n    }\n    Ok(String::from_utf8_lossy(&out.stdout).trim().to_string())\n}\n\npub async fn share_file(device: &str, path: &str) -> anyhow::Result<String> {\n    run(&[\"-d\", device, \"--share\", path]).await\n}\n\npub async fn share_url(device: &str, url: &str) -> anyhow::Result<String> {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/kdeconnect.rs#L79-L115","documentation":"kdeconnect.rs's run() is the single chokepoint all KDE Connect operations (share_file, share_url, share_text, ping, refresh) go through. Before spawning any command it calls locate(), an async search for the kdeconnect-cli binary on the system. If locate() returns None, it fails fast with this message rather than attempting to spawn a nonexistent binary.","triggerScenarios":"Calling any of share_file, share_url, share_text, ping, or refresh on a machine where kdeconnect-cli is not installed, is not on PATH, or lives in a nonstandard directory the locate() lookup does not scan.","commonSituations":"Linux machine without the kdeconnect package installed; minimal/containerized environments; installs via flatpak/snap where the binary is not on the standard PATH; macOS/Windows where kdeconnect-cli is absent or not added to PATH.","solutions":["Install KDE Connect so kdeconnect-cli exists: e.g. sudo apt install kdeconnect (Debian/Ubuntu), sudo dnf install kde-connect (Fedora), or pacman -S kdeconnect (Arch).","Verify the binary is discoverable: run `which kdeconnect-cli` or `command -v kdeconnect-cli`; if it prints a path but the app still fails, ensure that directory is in the PATH of the process running this code (GUI-launched apps often have a reduced PATH).","If installed via flatpak/snap, expose the CLI on the host PATH (e.g. a wrapper symlink in /usr/local/bin) since locate() only searches standard locations.","Pair a device first (`kdeconnect-cli --list-devices`) once the binary is found; the locate() call may also require kdeconnectindicated runtime setup."],"exampleFix":"// before (shell)\n./app --share-file report.pdf\n// error: kdeconnect-cli nao encontrado\n\n// after (shell)\nsudo apt install kdeconnect\nwhich kdeconnect-cli  # /usr/bin/kdeconnect-cli\n./app --share-file report.pdf","handlingStrategy":"fallback","validationCode":"if which::which(\"kdeconnect-cli\").is_err() {\n    eprintln!(\"kdeconnect-cli not installed; sharing disabled\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"match kdeconnect.ping().await {\n    Err(e) if e.to_string().contains(\"nao encontrado\") => fallback_to_other_share_channel(),\n    other => other?,\n}","preventionTips":["Install kdeconnect as part of environment setup before running the app","Feature-gate KDE Connect sharing behind a runtime capability check at startup","Document the flatpak/snap PATH caveat for users"],"tags":["missing-binary","external-tool","kdeconnect","path"],"backgroundTag":"command-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}