Skip to main content

check_cli_version

Function check_cli_version 

Source
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