tonhowtf/omniget · error
kdeconnect-cli nao encontrado
Error message
kdeconnect-cli nao encontrado
What it means
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.
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.
Example fix
// before (shell) ./app --share-file report.pdf // error: kdeconnect-cli nao encontrado // after (shell) sudo apt install kdeconnect which kdeconnect-cli # /usr/bin/kdeconnect-cli ./app --share-file report.pdf
Defensive patterns
Strategy: fallback
Validate before calling
if which::which("kdeconnect-cli").is_err() {
eprintln!("kdeconnect-cli not installed; sharing disabled");
return;
} Try / catch
match kdeconnect.ping().await {
Err(e) if e.to_string().contains("nao encontrado") => fallback_to_other_share_channel(),
other => other?,
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Failed to start ffmpeg
- tesseract nao esta instalado
- yt-dlp not found — install it in Settings
- Path is not a file
- Path is not a file
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/8983a7f7577c6458.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/kdeconnect.rs:97
};
let devices = crate::core::process::command(&bin)
.args(["-l"])
.output()
.await
.map(|o| parse_devices(&String::from_utf8_lossy(&o.stdout)))
.unwrap_or_default();
KdeStatus {
installed: true,
path: Some(bin.to_string_lossy().to_string()),
devices,
install_hint: hint,
}
}
async fn run(args: &[&str]) -> anyhow::Result<String> {
let bin = locate()
.await
.ok_or_else(|| anyhow!("kdeconnect-cli nao encontrado"))?;
let out = crate::core::process::command(&bin)
.args(args)
.output()
.await?;
if !out.status.success() {
return Err(anyhow!(
"kdeconnect-cli falhou: {}",
String::from_utf8_lossy(&out.stderr).trim()
));
}
Ok(String::from_utf8_lossy(&out.stdout).trim().to_string())
}
pub async fn share_file(device: &str, path: &str) -> anyhow::Result<String> {
run(&["-d", device, "--share", path]).await
}
pub async fn share_url(device: &str, url: &str) -> anyhow::Result<String> {View on GitHub (pinned to 8600b91f42)