Skip to content

Conversation

@ashwin-ant
Copy link
Collaborator

@ashwin-ant ashwin-ant commented Oct 23, 2025

Bundle platform-specific Claude Code CLI binaries directly in the Python package, eliminating the need for separate CLI installation.

Changes

Build System

  • Created scripts/download_cli.py to fetch CLI during build
  • Created scripts/build_wheel.py for building platform-specific wheels
  • Created scripts/update_cli_version.py to track bundled CLI version
  • Updated pyproject.toml to properly bundle CLI without duplicate file warnings
  • Made twine check non-blocking (License-File warnings are false positives)

Runtime

  • Modified subprocess_cli.py to check for bundled CLI first
  • Added _cli_version.py to track which CLI version is bundled
  • SDK automatically uses bundled CLI, falling back to system installation if not found
  • Users can still override with cli_path option

Release Workflow

  • Updated GitHub workflow to build separate wheels per platform (macOS, Linux, Windows)
  • Workflow now accepts two inputs:
    • version: Package version to publish (e.g., 0.1.5)
    • claude_code_version: CLI version to bundle (e.g., 2.0.0 or latest)
  • Workflow builds platform-specific wheels with bundled CLI
  • Creates release PR that updates:
    • pyproject.toml version
    • src/claude_agent_sdk/_version.py
    • src/claude_agent_sdk/_cli_version.py with bundled CLI version
    • CHANGELOG.md with auto-generated release notes

Documentation

  • Updated README to reflect bundled CLI (removed Node.js requirement)
  • Added release workflow documentation
  • Added local wheel building instructions

Benefits

  • Zero external dependencies: No need for Node.js or npm
  • Easier installation: Single pip install gets everything
  • Version control: Track exactly which CLI version is bundled
  • Flexible releases: Can release new package versions with updated CLI without code changes
  • Better user experience: Works out of the box with no setup

Platform-specific wheels are automatically selected by pip during installation based on the user's OS and architecture.

🤖 Generated with Claude Code

@ashwin-ant ashwin-ant force-pushed the ashwin/bundle branch 2 times, most recently from 29df0ac to 4060af9 Compare November 18, 2025 16:03
@ashwin-ant ashwin-ant marked this pull request as ready for review November 18, 2025 16:35
@ashwin-ant ashwin-ant requested review from a team and dltn November 18, 2025 16:35
Bundle platform-specific Claude Code CLI binaries directly in the Python
package, eliminating the need for separate CLI installation.

Changes:
- Created download_cli.py script to fetch CLI during build
- Created build_wheel.py script for building platform-specific wheels
- Modified subprocess_cli.py to check for bundled CLI first
- Updated GitHub workflow to build separate wheels per platform
- Updated pyproject.toml to include _bundled directory in wheels
- Updated README to reflect bundled CLI (removed Node.js requirement)

The SDK now automatically uses the bundled CLI, falling back to system
installation if not found. Users can still override with cli_path option.

Platform-specific wheels are built for macOS, Linux, and Windows, and pip
automatically selects the correct one during installation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@ashwin-ant ashwin-ant merged commit ce99e9d into main Nov 19, 2025
49 of 52 checks passed
@ashwin-ant ashwin-ant deleted the ashwin/bundle branch November 19, 2025 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants