Expand description
CLI tool detection for cli-tool nodes.
The Node Hub asks “is the binary this cli-tool node needs installed, and
is it at least the minimum version the entry declares?”. This module answers
the first half - it probes the machine by running <name> <version_command>
(default --version) and parsing a version token out of the output. The
minimum-version verdict is computed by the caller (the frontend) so the
probe stays a pure “what’s installed?” query and the command is reusable.
Spawning mirrors the adapters’ tokio::process::Command::new(CLI) pattern,
so no extra Tauri plugin or shell capability is required.
Structs§
- CliTool
Status - Outcome of probing the machine for one CLI tool.
founddistinguishes “binary missing from PATH” from “present but version unparseable”. Never surfaced as anErrso the Hub renders a badge instead of failing.
Functions§
- detect_
cli_ tool - Probe for
name <version_command>. Returnsfound: false(never anErr) when the binary can’t be spawned or the name is rejected. - parse_
version - Extract the first dotted numeric version token (
\d+(\.\d+)+) fromtext. Bare integers and dash-separated dates (2024-01-02) are skipped so a build date or revision number isn’t mistaken for a version.