bvm - Binary Version Manager
A version manager for all binaries.
Why?
I couldn't find a solution like this that also worked on Windows. Do you know something? If so, please stop me so I don't waste my time.
Setup
It's not recommended to try this out yet as there are no public binary manifest files, but if you want to:
- For now, install
bvm
via cargo—cargo install bvm
. - Manually add the binary folder as the first item on the path:
- Windows:
C:\Users\<user-name>\AppData\Local\bvm\bvm\bin
- Mac/Linux:
~/.local/share/bvm/bin
- Windows:
- Add a .bvmrc.json file to your project and specify the paths to the binary manifest files.
{ "binaries": [ // these don't exist anywhere at the moment except on my machine (again, proof of concept) "http://localhost:8000/deno-1.3.1.json", "http://localhost:8000/dprint-0.9.0.json" ] }
- Run
bvm install
Commands
bvm install
Adds the binaries in the current configuration file to the path then downloads & installs them.
bvm install <url>
Installs a binary at the specified manifest file.
bvm use [binary name] [version]
Uses the specified binary name and version globally.
The binary and version must have been previously installed.
bvm resolve [binary name]
Resolves the executable path of the specified binary using the provided arguments based on the current working directory.
This command is used by the created shell/batch files to tell how to resolve the file.
bvm uninstall [binary name] [version]
Uninstalls the specified binary name and version.
Binary manifest file
At the moment, it looks like this:
Future improvements
High priority:
- Improve user story for different binaries with the same name (
bvm use denoland/deno 1.3.1
orbvm use name-stealer/deno 1.2.0
) - Ability to easily switch back to using a binary on the path without bvm (
bvm use deno path
?).- Do this without removing the shim (so use the second result of
whereis -b deno
/where deno
)
- Do this without removing the shim (so use the second result of
Others:
- Ability to specify a range of supported versions in .bvmrc.json to reduce the number of downloaded binaries:
{ "binaries": [ // I don't know... maybe something like this { "manifest": "http://localhost:8000/deno-1.3.1.json", "version": "^1.3.0" } ] }
- Support for file paths everywhere in addition to urls.
- Something similar to
npm run <script-name>
? Or is that out of scope? - Ability to specify pre & post install commands in the configuration file (ties into #4 maybe... might be better to make it separate though)
- Ability to purge any binaries that haven't been run for X days.
- Some way for binaries to specify all their version numbers and the ability to get their latest. I'm thinking each binary manifest file may have a url to a global binary manifest file where all that data is stored.
- Checksums on paths to ensure downstream binaries stay constant.
bvm list
- Lists the installed binaries.bvm upgrade <binary name>
- Upgrade to the latest version (requires binary manifest file to specify a global manifest file)- Support downstream binary dependencies.
- Ability to get a specific version of a binary when using
bvm resolve
(ex.bvm resolve deno 1.3.1
) - Ability to easily create and remove aliases (ex.
deno2
)- These should be associated with the binary they alias so when you uninstall the binary it deletes the alias.
- Require
--force
onbvm install <url>
if already installed. bvm clear-url-cache
- Clear the url caches, but not the binary caches.- Ability to execute a specific version of an executable one time.
bvm exec deno 1.2.0 -V
or perhaps at the shim leveldeno -V --bvm-use-version 1.2.0
... or maybe this should usebvm resolve
somehow.
Probably unnecessary complexity:
bvm use <url>
- To use a specific version of a binary globally via a url.
Goals
- Seamless version selection.
- Replace binary specific version manager tools.
- No centralization—all urls and paths.
- Allows for easily distributing approved binaries within an organization.
- Easy for binary authors to distribute their applications.
- Support different binaries with the same name.
- Backwards compatibility (once hitting 1.0)