pub async fn check_cli_version(
cli_path: &Path,
timeout: Option<Duration>,
) -> Result<String>Expand description
Run claude --version and parse the semver string from the output.
The CLI typically prints a line like claude v1.2.3 or just 1.2.3.
This function extracts the first semver-like substring (digits and dots).
If timeout is Some, the command is killed after the deadline expires.
ยงErrors
Error::Timeoutif the deadline expires.Error::SpawnFailedif the process cannot be launched.Error::ProcessExitedif the process exits with a non-zero code.Error::ControlProtocolif the output cannot be parsed as a version.