π Bun Version Manager β manage multiple Bun versions easily
- Install any published Bun version (
bvm install 1.1.0,bvm install latest) - nvm-style default version: new shells and unpinned directories use it
- Per-project versions via an optional
.bvmrc(bvm use --save 1.4.0) - Works natively on Linux, macOS (Intel & Apple Silicon) and Windows
- Zero runtime dependencies β a single static binary
curl -s -S -L https://raw.githubusercontent.com/chathula/bvm/main/install.sh | bashOr if you are using zsh just change bash with zsh:
curl -s -S -L https://raw.githubusercontent.com/chathula/bvm/main/install.sh | zshUsing a different shell? No problem β the command above works in bash, zsh and fish as-is. The installer detects your login shell, updates the right profile (
.zshrc,.bashrcor fish'sconfig.fish), and prints the exact command to activate bvm in your current session when it finishes.
The installer puts the bvm binary in ~/.bvm/bin and adds it to your PATH.
bvm is not available in the current session yet β either open a new
terminal, or run the source ~/.zshrc / source ~/.bashrc command the
installer prints when it finishes.
Prefer not piping scripts into a shell? Two-step equivalent:
curl -fsSLO https://raw.githubusercontent.com/chathula/bvm/main/install.sh
less install.sh # inspect it first
bash install.sh && rm install.shpowershell -c "irm https://raw.githubusercontent.com/chathula/bvm/main/install.ps1 | iex"Installs to %USERPROFILE%\.bvm\bin and adds it to your user PATH β reopen
your terminal afterwards.
# If you have Go tooling installed:
go install github.com/chathula/bvm@latestOr download an archive for your platform from the
releases page, unzip it, and put
the bvm binary somewhere on your PATH.
command not found: bvmright after installing β your current shell hasn't re-read its profile. Open a new terminal, or runsource ~/.zshrc(zsh) /source ~/.bashrc(bash) /source ~/.config/fish/config.fish(fish).- Installer prints nothing / 404 β make sure the URL matches your branch
(
main) and that the repository is public; retry with-von curl. unzipmissing β the installer needs it; on Debian/Ubuntu runsudo apt-get install unzip, on Alpineapk add unzip.- Existing Bun installed another way β bvm activates versions through
~/.bun/bin/bun; if that path belongs to another install, remove it from your PATH or let bvm manage it going forward. Runbvm doctorany time to diagnose your setup.
bvm install [version] Install a bun version ('latest' allowed; defaults to .bvmrc)
bvm use [--save] [v] Show what applies here; '--save <v>' pins this project (.bvmrc)
bvm use default Remove this directory's pin (if any)
bvm use --reset Clear a session override ($BVM_VERSION)
bvm exec <v> [args] Run a one-off command with a specific version
bvm alias default <v> Set the version used outside pinned projects
bvm list List installed versions
bvm list-remote List all remote versions
bvm uninstall <version> Remove an installed version
bvm doctor Diagnose your bvm/bun setup
(No separate which command β bvm use with no argument shows which
version applies in the current directory and why.)
Examples:
bvm install latest # first install ever -> becomes the default
bvm install 1.1.0 # installs a specific version
bvm use # what version applies in this directory, and why
bvm use --save 1.1.0 # pins 1.1.0 to the current project (creates .bvmrc)
bvm use default # remove this project's pin
bvm ls # * marks the default, (this project) marks the pin
bvm doctor # verify shim, PATH, resolution, API reachabilityWindows note: Bun ships native Windows builds starting at v1.1.0; older versions cannot be installed on Windows.
bvm works like nvm's default alias, implemented through a shim: the
bun command on your PATH is bvm itself, and it resolves which real Bun
binary to run on every invocation.
$BVM_VERSIONif set β a temporary, session-only override (see below)- The nearest
.bvmrcwalking up from your current directory (project pin β always opt-in, created only bybvm use --save <version>or written by hand) - The default alias (
bvm alias default <version>) - Nothing β you get a helpful error instead of a mystery binary
Consequences (matching nvm's mental model):
- The first version you install becomes the default
- New shells and unpinned directories always run the default version
bvm usenever creates files β it reports what applies here; onlybvm use --save <version>writes a.bvmrc, and only when you ask.bvmrcis completely optional: commit it to share a project's Bun version, or skip it entirely and rely on the defaultbunworks everywhere: no shell hooks or PATH juggling per project
A .bvmrc follows the same rules everywhere: blank lines and # comments
are ignored, the first version line wins, and 1.4.0 / v1.4.0 are
equivalent. bvm install with no argument reads it too.
Like nvm use, you can switch versions for your current terminal session
only β files, other terminals and other projects are untouched:
bvm use 1.4.0 # this shell now runs 1.4.0 (sets $BVM_VERSION)
bvm use --reset # back to .bvmrc / default
bvm use default # clears the override AND removes this project's pinWhen you close the shell (or unset BVM_VERSION), the project's .bvmrc
β or the default β applies again, exactly like coming back to a project
under nvm.
For one-off commands without changing your session:
bvm exec 1.1.0 bun testThis works through the small
bvm()shell function the installer adds to your profile (bash/zsh/fish): the function runs inside your shell and sets$BVM_VERSION, which the shim checks first. Existing installs can re-run the installer to pick it up, or add the snippet to your profile manually.
bvm ls shows both roles:
v1.3.1 (this project)
* v1.4.0 (default)
bvm uninstall 1.3.1- Removing a regular version just deletes it
- Removing the default version promotes the highest remaining one β
bunkeeps working everywhere - Removing the last version also removes the shim and the default
alias;
bunprints a clear "not installed" message until you install again - If the current project's
.bvmrcpinned the removed version, bvm warns you to update it
Manual removal, nvm-style:
# 1. remove the installation directory (versions, shim, aliases)
bvm_dir="${BVM_DIR:-~/.bvm}"
rm -rf "$bvm_dir"
# 2. remove the shim bvm placed on your PATH
rm -f ~/.bun/bin/bun # unix (skip if you installed Bun independently)Then edit your shell profile (~/.zshrc, ~/.bashrc or fish's
config.fish) and delete the lines bvm added:
# bvm & bun
export BVM_DIR="$HOME/.bvm"
export PATH="$BVM_DIR/bin:$PATH"On Windows (PowerShell):
Remove-Item -Recurse -Force "$env:USERPROFILE\.bvm"
Remove-Item -Force "$env:USERPROFILE\.bun\bin\bun.exe"
# then remove "%USERPROFILE%\.bvm\bin" from your PATH (Settings > Environment Variables)Run bvm doctor before uninstalling if you want a report of everything
bvm currently manages.
Requires Go β₯ 1.21 β the exact toolchain (go1.27.0) is pinned in go.mod
and fetched automatically.
make build # build to bin/
make test # unit tests
make test-e2e # end-to-end tests (downloads real Bun releases)
make cover # coverage report + enforces a 90% floor (excluding main())
make fmt vet # formatting + static checksE2E tests run the compiled binary in an isolated environment against real Bun release archives, on every OS in CI (ubuntu / macos / windows).
Releases are cut by pushing a v* tag; GoReleaser builds and publishes
archives for all platforms, then smoke-tests both installer scripts against
the published release.
