growthbook
v1.0.0
Published
Command-line interface for the GrowthBook REST API
Readme
growthbook (npm)
npm wrapper for the GrowthBook CLI. Preserves the familiar global install:
npm i -g growthbook
growthbook --helpHow it works
This package ships no binary itself. On install, install.js (postinstall):
- Resolves the asset for your platform/arch (
growthbook_<Os>_<arch>.<ext>), matching the GoReleaser archive naming. - Downloads it from the matching GitHub release (
v<package version>). - Verifies the archive's SHA-256 against the release
checksums.txt. - Extracts the binary into
vendor/using the systemtar.
bin/growthbook.js then execs that vendored binary, forwarding args and exit code.
The npm version must match a published GitHub release tag — release automation
should set them together.
Environment
GROWTHBOOK_CLI_SKIP_DOWNLOAD=1— skip the postinstall download (air-gapped/CI setups that vendor the binary another way).
Notes / future hardening
Prebuilt binaries are provided for linux, darwin, and windows on x64/arm64. Other
platforms should go install github.com/growthbook/cli/cmd/growthbook@latest.
A future option is the per-platform optionalDependencies pattern (à la esbuild):
publish @growthbook/cli-<os>-<arch> packages carrying the raw binary so npm
selects the right one with no postinstall download (works with --ignore-scripts).
The postinstall-download approach here is simpler to ship and is the first cut.
