Skip to content

v0.30.0

Choose a tag to compare

@ya-luotao ya-luotao released this 09 Aug 09:42
· 545 commits to main since this release

Added

  • ClaudeAgentSDK::CLIInstaller — vendor a pinned claude CLI binary into your project (vendor/claude/ by default) for hermetic deploys, instead of relying on whatever npm install -g last put on PATH. Resolves stable/latest dist-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 new CLIInstallError.
    • Idempotent & offline-friendly: repeat calls re-hash the vendored binary against the recorded checksum with zero network access (pinned versions).
    • Concurrency-safe: an exclusive flock covers 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 outranking PATH — that's what makes a pinned install hermetic), then the existing which/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 automatically

What'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