Repository navigation
v0.30.0
Added
ClaudeAgentSDK::CLIInstaller— vendor a pinnedclaudeCLI binary into your project (vendor/claude/by default) for hermetic deploys, instead of relying on whatevernpm install -glast put onPATH. Resolvesstable/latestdist-tags via the official release endpoints, verifies the platform's SHA-256 from the release manifest (download bounded by the manifest's declared size), and publishes atomically. Stdlib only — no new runtime dependency, no binary shipped inside the gem. macOS + Linux (glibc/musl, x86_64/arm64, Rosetta 2 aware). All failures raise the newCLIInstallError.- Idempotent & offline-friendly: repeat calls re-hash the vendored binary against the recorded checksum with zero network access (pinned versions).
- Concurrency-safe: an exclusive
flockcovers the whole install; parallel boots serialize, last resolver wins, and stale temp files from a killed install are swept. - A failed install never breaks a working one: metadata is recorded before the final atomic rename, so nothing can fail after the binary is published; readers always see an intact binary — discovery stays lock-free.
- CLI discovery now probes
CLAUDE_CLI_PATH, then the vendored binary (deliberately outrankingPATH— that's what makes a pinned install hermetic), then the existingwhich/common-location logic.
Usage
# bin/setup or a Dockerfile build step
ClaudeAgentSDK::CLIInstaller.install(version: '2.1.220')
# => "/app/vendor/claude/claude" — find_cli picks it up automaticallyWhat's changed
- #54 Add CLIInstaller for vendoring a pinned Claude Code CLI binary — @ya-luotao
Full Changelog: v0.29.0...v0.30.0
gem install claude-agent-sdk -v 0.30.0