| name | build-bd-static |
| description | Build a static `bd` binary when Homebrew is unavailable or its dynamically-linked package is not portable enough for the machine. |
| allowed-tools | Bash, Read |
Build bd Static
Use Homebrew as the default install path:
brew install beads
brew upgrade beads
Use this skill only when Homebrew is unavailable, or when the packaged bd is not enough because you need a self-contained binary that avoids shared-library issues (for example ICU version mismatches across machines).
bd upgrade is not the installer path here; it reviews version changes but does not replace the binary.
Usage
/build-bd-static
Steps
-
Check current version:
bd --version 2>/dev/null || echo "bd not installed"
-
Find the latest available version:
go list -m -json github.com/steveyegge/beads@latest 2>&1 | grep '"Version"'
-
If already on the latest version, report that and stop. Otherwise, proceed to build the static fallback binary.
-
Build the latest version statically with CGO disabled:
CGO_ENABLED=0 go install github.com/steveyegge/beads/cmd/bd@latest
@latest resolves at install time, so there's no need to pass the version from step 2 — that step is just for the "already on latest?" gate.
CGO_ENABLED=0 forces pure-Go alternatives for all dependencies (ICU regex, SQLite, etc.), producing a binary with zero shared library dependencies.
macOS warning: CGO_ENABLED=0 can cause crashes (e.g., during bd init) due to CGO/SQLite incompatibilities on macOS. macOS users should use CGO_ENABLED=1 instead — see upstream docs/INSTALLING.md for details.
-
Verify:
bd --version
ldd "$(which bd)" 2>&1
otool -L "$(which bd)"
Why static?
The bd binary uses go-icu-regex (CGo) which links against the system's ICU library. Different machines have different ICU versions (e.g., Homebrew's icu4c@77 vs system libicu76), causing runtime failures:
bd: error while loading shared libraries: libicui18n.so.77: cannot open shared object file
Static compilation eliminates this entirely.