1 Star 4 Fork 0

moqsien / version-manager

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Logo

Go Report Card GitHub License GitHub Release PRs Card Issues Card Versions Repo Card

中文 | En


version-manager(vmr)

vmr is a simple, cross-platform, and well-tested version manager for programming languages and tools. It is totally created for general purpose. You don't need any plugins, but just vm. Then everything can be managed.

Maybe you've already heard of fnm, sdkman, gvm, nvm, pyenv, phpenv, etc. However, none of them can manage multiple programming languages. Managers like asdf-vm support multiple languages, but only works on unix-like systems, and makes things look complicated. Therefore, vmr comes.

youtube video demo


features

  • Installs or uninstalls versions of sdk.
  • Swithes between versions of sdk.
  • Using a version only in current terminal session is supported. See with command vmr use -h.
  • Lock sdk version for a project with command like vmr use -l go@1.22.2, and autoswithes sdk to the locked version while using command cdr .
  • Handles envs.
  • Friendly to VSCoders or Neovimers.
  • Downloads files blazingly fast🚀🚀🚀 with multi-threads. See with command vmr use -h.
  • Auto-completions for shells. See with command vmr completion -h.
  • Generates command "vmr use sdk-name@version" automatically using selected item from version list, and add the command to clipboard for later usage.
  • Android development with Flutter and VSCode. No Android Studio is needed.
  • No plugins needed.
  • More stable.

Note: cdr is a hook for command cd from shell or powershell. It's registered by vmr automatically. When you're changing directories using cdr, the locked version of sdk will be detected.


vmr versus vfox

sdk vmr vfox
java(jdk) ✅︎ ✅︎
maven ✅︎ ✅︎
gradle ✅︎ ✅︎
kotlin ✅︎ ✅︎
scala ✅︎ ✅︎
groovy ✅︎ ✅︎
python ✅︎ ✅︎
pypy ✅︎ ❌︎
miniconda ✅︎ ❌︎
go ✅︎ ✅︎
node ✅︎ ✅︎
deno ✅︎ ✅︎
bun ✅︎ ❌︎
flutter(dart) ✅︎ ✅︎
.net ✅︎ ✅︎
zig ✅︎ ✅︎
zls ✅︎ ❌︎
php ✅︎ ✅︎
rust ✅︎ ❌︎
cmdline-tool(android) ✅︎ ❌︎
android SDKs ✅︎ ❌︎
vlang ✅︎ ❌︎
v-analyzer ✅︎ ❌︎
cygwin-installer ✅︎ ❌︎
msys2-installer ✅︎ ❌︎
julia ✅︎ ❌︎
odin ✅︎ ❌︎
typst ✅︎ ❌︎
typst-lsp ✅︎ ❌︎
typst-preview ✅︎ ❌︎
gleam ✅︎ ❌︎
git-for-windows ✅︎ ❌︎
neovim ✅︎ ❌︎
vscode ✅︎ ❌︎
protobuf(protoc) ✅︎ ❌︎
lazygit ✅︎ ❌︎
kubectl ✅︎ ❌︎
upx ✅︎ ❌︎
acast(asciinema) ✅︎ ❌︎
erlang(need compilation) ❌︎ ✅︎
elixir(need compilation) ❌︎ ✅︎

Installation/Update

  • for MacOS/Linux(run the command below in terminal)
curl --proto '=https' --tlsv1.2 -sSf https://gvc.1710717.xyz/proxy/https://raw.githubusercontent.com/gvcgo/version-manager/main/scripts/install.sh | sh
  • for Windows(run the command below in powershell) (See tips in For Windows)
powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('https://gvc.1710717.xyz/proxy/https://raw.githubusercontent.com/gvcgo/version-manager/main/scripts/install.ps1')"
  • Manual installation
1. Download zip file from release.
2. Unzip it, run command "your/full/path/to/vmr install-self".
  • If you're a gopher, you can also complie the project by yourself. The main func is in ./cmd/vmr

  • update

vmr-update

Note: If you are installing vmr for the first time, please use source .zshrc or source .bashrc to refresh your envs. For windows users, just open a new powershell terminal, then vmr will be available.


How to set a proxy?

Choose either proxy or reverse-proxy.

  • proxy
vmr set-proxy <http://localhost:port or socks5://localhost:port>
  • reverse-proxy
# reverse proxy <https://gvc.1710717.xyz/proxy/> is available for free.
vmr set-reverse-proxy https://gvc.1710717.xyz/proxy/
  • enable downloading from mirror sites in China.
vmr use -mirror-in-china go@1.22.1

Subcommands

subcommand args desc
list - Shows what's supported.
search sdk-name Shows available versions for a sdk.
use sdk-name@version Installs/Swithes to the specific version of a sdk.
local sdk-name Shows installed versions of a sdk.
uninstall sdk-name@version or sdk-name@all Uninstalls versions for a sdk.
clear-cache sdk-name Clears the cached files for a sdk.
set-reverse-proxy https://gvc.1710717.xyz/proxy/ Sets a reverse-proxy for vm.
set-proxy http or socks5( scheme://host:port ) Sets a local proxy for vm.
env --remove=false/true Sets/Removes env manually.
install-self - Installs vm.
version - Shows version info of vm.
completion - Generate the autocompletion script for for the specified shell.(bash, zsh, fish, or powershell)

demo for MacOS

demo

demo for Windows

demo

demo for linux

demo


Related dirs

  • vmr installation dir
$HOME/.vm/
  • application installation dir

Specified during installation of vmr. Use "$HOME/.vm" by default. installation


For Windows

Note: If you are using vmr on Windows11, you need to enable the Developer Mode as vmr requires to create symbolic links. If you're on Windows10, and any creating-symbolic-links-failure occurrs, you can try vmr with Admin Privilege. To get envs take effect for windows, you may need to close the current powershell terminal and open a new one. Note that extFAT and FAT32 are not supported.

sudo command on Windows: gsudo. You can use vmr search gsudo to see what's available.

🛎️🚨 Virus Positive?: It's definitely a false positive. See here. If this occurrs, you can install vmr manually, and add vmr to be trusted.

  • How can I add vmr to windows 'Virus & threat protection Exclusions?'
Windows Security>> Virus & threat protection>> Virus & threat protection settings>> Exclusions

Contributors

Thanks to the following people who have contributed to this project.


Supplementary

vmr is created to be a cross-platform command line tool. We will not try to include everything just like asdf-vm or its imitator vfox did, as that will greatly increase the complexity and also reduce the possibility of cross-platform. And most of the time, frequently used SDKs and tools have already been covered by vmr. vmr will not try to include SDKs that need to be compiled under a certain platform. Because each developer's development environment is different, it is impossible to ensure the completion of a compilation. So vmr will only use pre-built binaries for installations. If you have any SDKs or tools to recommand for version management, please raise an issue in Issues.

So, vmr is going to keep as lightweight, stable, and user-friendly as possible.


Todo-List

  • To manage package repo mirror sites in China.
MIT License Copyright (c) 2024 gvcgo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一款通用的跨平台版本管理器,支持Java, Go, .Net, Python, Node.js, Deno, Bun, PHP, Rust, Julia, Flutter等40多种语言和工具。 一键安装,删除,版本切换,环境变量管理等等。同时支持设置本地代理或者反向代理、多线程下载,大大提高国内用户下载体验。主打轻量、稳定、高效、用户友好。 展开 收起
Go 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/moqsien/version-manager.git
git@gitee.com:moqsien/version-manager.git
moqsien
version-manager
version-manager
main

搜索帮助