ClaudeAgentSDK.CLI (claude_agent_sdk v0.6.9)
View SourceCentralized Claude CLI discovery and version tracking.
This module consolidates executable lookup logic and provides helpers for checking installation status, parsing the installed version, and warning when the detected version is below the supported minimum.
Summary
Functions
Attempts to find the Claude CLI executable.
Like find_executable/0 but raises when the CLI is not available.
Returns true if the Claude CLI is installed and discoverable.
Returns the minimum supported Claude CLI version.
Returns the recommended Claude CLI version for this SDK release.
Returns the installed Claude CLI version as a string.
True if the installed version meets or exceeds the minimum.
Emits a warning when the installed CLI is below the supported minimum or unknown.
Functions
@spec find_executable() :: {:ok, String.t()} | {:error, :not_found}
Attempts to find the Claude CLI executable.
Tries candidates in order (claude-code, then claude) and returns
{:ok, path} when found or {:error, :not_found} otherwise.
@spec find_executable!() :: String.t()
Like find_executable/0 but raises when the CLI is not available.
@spec installed?() :: boolean()
Returns true if the Claude CLI is installed and discoverable.
@spec minimum_version() :: String.t()
Returns the minimum supported Claude CLI version.
@spec recommended_version() :: String.t()
Returns the recommended Claude CLI version for this SDK release.
This version is tested and known to work with all SDK features including file checkpointing, streaming control protocol, and partial messages.
Returns the installed Claude CLI version as a string.
@spec version_supported?() :: boolean()
True if the installed version meets or exceeds the minimum.
@spec warn_if_outdated() :: :ok
Emits a warning when the installed CLI is below the supported minimum or unknown.