Make @mux/cli installable without requiring Bun, Node.js, or any runtime — just a standalone binary.
| Method | Command | Requires |
|---|---|---|
| Homebrew | brew install muxinc/tap/mux |
Homebrew |
| Shell script | curl -fsSL https://raw.githubusercontent.com/muxinc/cli/main/install.sh | bash |
curl (we can put this behind a vanity cli.mux.dev/install.sh URL) |
| npm | npm install -g @mux/cli |
Node.js |
| npx | npx @mux/cli@latest |
Node.js |
| Manual | Download from GitHub Releases | — |
Bun compiles the entire CLI — TypeScript source, dependencies, and runtime — into a single self-contained binary. No runtime needed on the user's machine.
We cross-compile for 4 targets:
darwin-arm64(macOS Apple Silicon)darwin-x64(macOS Intel)linux-x64linux-arm64
This is the same approach used by Biome, esbuild, Turbo, and Bun for distributing native binaries via npm.
The main @mux/cli package contains a tiny Node.js shim (bin/mux) that detects the user's platform and delegates to the correct platform-specific package. npm's optionalDependencies with os/cpu fields ensures only the matching binary is downloaded.
@mux/cli ← main package (shim only, ~2KB)
├── @mux/cli-darwin-arm64 ← macOS ARM binary (~66MB)
├── @mux/cli-darwin-x64 ← macOS Intel binary
├── @mux/cli-linux-x64 ← Linux x64 binary
└── @mux/cli-linux-arm64 ← Linux ARM binary
Users only download one binary — npm filters out the rest automatically.
A custom Homebrew tap (muxinc/tap) with a formula that downloads the prebuilt binary from GitHub Releases. The formula uses on_macos/on_linux and on_arm/on_intel blocks to select the correct binary for each platform.
Requires a separate muxinc/tap repo containing a single Formula/mux.rb file. The release workflow automatically updates the formula's version and sha256 hashes after publishing new binaries.
A simple shell script that:
- Detects OS and architecture
- Fetches the latest release from GitHub
- Downloads the correct binary
- Installs to
~/.mux/bin/
Supports MUX_VERSION and MUX_INSTALL_DIR env vars for customization.
On git tag v1.x.x && git push --tags:
- CI builds 4 platform binaries
- Publishes each platform binary as its own npm package (
@mux/cli-{os}-{arch}) - Publishes the main
@mux/clipackage (with the shim) - Creates a GitHub Release with the binaries attached
- Updates the Homebrew formula in
muxinc/tapwith new version and sha256 hashes
All 5 npm packages share the same version number.
bin/mux ← Node.js shim (checked in)
install.sh ← Shell installer (checked in)
packages/@mux/cli-darwin-arm64/ ← Platform package.json only (binary added at publish time)
packages/@mux/cli-darwin-x64/
packages/@mux/cli-linux-x64/
packages/@mux/cli-linux-arm64/
NPM_TOKENsecret in GitHub repo settings for npm publishing- npm org access to publish
@mux/cli-*packages muxinc/taprepo created on GitHubHOMEBREW_TAP_TOKENsecret (a PAT with repo access tomuxinc/tap) for automated formula updates