- Hook system for customization - Documentation and installation scripts - Multi-platform support via GitHub releases - Binaries available for Windows, Linux (x64/ARM64), macOS (Intel/Apple Silicon) Generated with Claude Code via Happy
2.4 KiB
Multi-Platform Build Guide
This project now supports building binaries for multiple platforms using Bun's cross-compilation capabilities.
Supported Platforms
- Windows x64:
claude-mem.exe - Linux x64:
claude-mem-linux - Linux ARM64:
claude-mem-linux-arm64 - macOS ARM64:
claude-mem-macos-arm64 - macOS x64:
claude-mem-macos-x64
Building
Build All Platforms
To build binaries for all supported platforms:
npm run build:multiplatform
This will create binaries in the releases/binaries/ directory.
Build for NPM Package
To build a complete npm package with all platform binaries:
npm run publish
This creates a package in releases/npm-package/ that includes:
- Platform detection wrapper script
- All platform-specific binaries
- Hooks and configuration files
How Platform Detection Works
The npm package includes a Node.js wrapper script (claude-mem) that:
- Detects the current platform using
process.platformandprocess.arch - Maps the platform to the appropriate binary filename
- Executes the correct binary with all command-line arguments
Platform Mapping
| Platform | Architecture | Binary Filename |
|---|---|---|
| Windows | x64 | claude-mem.exe |
| Linux | x64 | claude-mem-linux |
| Linux | arm64/aarch64 | claude-mem-linux-arm64 |
| macOS | arm64 | claude-mem-macos-arm64 |
| macOS | x64 | claude-mem-macos-x64 |
Usage
After installation via npm, users can run:
npx claude-mem --help
The wrapper will automatically select and execute the correct binary for their platform.
Troubleshooting
Unsupported Platform Error
If you see an "Unsupported platform" error, check that your platform/architecture combination is in the supported list above.
Binary Not Found Error
This indicates the platform detection worked, but the expected binary file is missing from the package. This shouldn't happen with properly built packages.
Development
Adding New Platforms
To add support for new platforms:
- Add the platform to the
PLATFORMSarray inscripts/build-multiplatform.sh - Update the platform detection logic in
scripts/claude-mem-wrapper.js - Update this documentation
Testing Binaries
Test that a specific binary works:
# Test Linux binary
./releases/binaries/claude-mem-linux --help
# Test Windows binary (on Windows or with Wine)
./releases/binaries/claude-mem.exe --help