Coder Social home page Coder Social logo

gvcgo / version-manager Goto Github PK

View Code? Open in Web Editor NEW
674.0 3.0 25.0 478 KB

🔥 A general version manager for 70+ SDKs with TUI inspired by lazygit. No need to remember any commands. Less bugs.

Home Page: https://vdocs.vmr.us.kg

License: MIT License

Go 93.86% Shell 3.59% PowerShell 2.55%
go golang version-management version-manager cross-platform languages linux macos programming windows versions vm vmr sdk lazygit asdf-vm fnm nvm vfox

version-manager's Introduction

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-designed version manager for multiple sdks and tools. It is totally created for general purpose.

Maybe you've already heard of fnm, 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 annoyingly makes things look complicated. Therefore, VMR comes.

See docs for details


Features

  • Cross-platform, supports Windows, Linux, MacOS.
  • Supports multiple languages and tools.
  • Nicer TUI, inpsired by lazygit, more intuitive, no need to remember any commands.
  • Supports locking SDK version for each project.
  • Supports Reverse Proxy/Local Proxy, improves your download experience.
  • Well-designed, faster response and higher stability.
  • No plugins needed, just out of the box.
  • Installs SDKs in local disk instead of docker containers.
  • High extendability, even for thousands of applications(through conda).

Installation

  • MacOS/Linux
curl --proto '=https' --tlsv1.2 -sSf https://scripts.vmr.us.kg | sh
  • Windows
powershell -c "irm https://scripts.vmr.us.kg/windows | iex"

Note: Please remember to read the docs, as the problems you encounter may be caused by your improper usage.


What's supported?

bun, clang, clojure, codon, crystal, deno, dlang, dotnet, elixir, erlang, flutter, gcc, gleam, go, groovy, jdk, julia, kotlin, lfortran, lua, nim, node, odin, perl, php, pypy, python, r, ruby, rust, scala, typst, v, zig, and more...


Contributors

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


Leave a star

If this project helped, just generously leave a 🌟.


Thanks to

version-manager's People

Contributors

dependabot[bot] avatar eryajf avatar moqsien avatar zzhaolei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

version-manager's Issues

无法正常安装

执行:

vm is 

提示:

'get-vm' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

node安装失败

之前还可以安装了一个20版本的node,今天安装一个14版本的就不行了:
image

vmr 0.6.1 预发布版,首次使用提示“no sdk found!”

首次运行vmr,如果连不上代理,sdk_list内容为空,则提示代理连接失败的信息以及“no sdk found!”,但是后续重新执行一直只提示“no sdk found!”,无法重新获取sdk列表,手动删除sdk_list后才能重新获取

[bug] install 404

PS D:\work> 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')"

Downloading files...
Invoke-RestMethod : 远程服务器返回错误: (404) 未找到。
所在位置 行:40 字符: 1

  • Invoke-RestMethod -Uri $url -OutFile $filename
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod],WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
    
    
    

可以在浏览器上打开代理站。多次重试了,网络无问题,查看脚本下载地址是:
https://gvc.1710717.xyz/proxy/https://github.com/gvcgo/version-manager/releases/download/v0.1.3/vm_windows-.zip

vm_windows-.zip 应该是 vm_windows-amd64.zip

PS D:\work> systeminfo

主机名:           WIN-N9RB7945R37
...
系统型号:         82R4
系统类型:         x64-based PC
...

中文未匹配,或使用默认值

vmr-update 更新会丢失 vmr 可执行文件

os:debian12
vmr:v0.6.1
使用vmr-update更新后,vmr可执行文件丢失。
再次更新依旧不会有vmr可执行文件,在不删除 .vm 文件的前提下使用安装命令依旧不行

vmr操作太过繁琐

建议使用list之后然后直接回车可以直接执行search操作,然后在search之后执行回车可以直接执行install操作。

VMR failed to install Flutter

(base) root@Jengro:/home/jengro/dev# vmr
 WARNING  Content-Length is not supported.


 | - Downloading flutter_linux_3.22.1-stable.tar.xz...


  INFO    Extracting files, please wait...
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
  ERROR   Extract file failed: xz: file format not recognized.
(base) root@Jengro:/home/jengro/dev#

os: debian12
vmr:v0.6.2(a737e53)

没有卸载命令

可能是我一开始安装了老版本,一路升级上来的原因。当前我的版本是:

$ vmr version
v0.1.8(4af72c3)

我单独执行vmr命令,不会进入到tui界面,所以打算卸载重新安装,此时执行:

$ vmr-uninstall
zsh: command not found: vmr-uninstall

这种情况下,如何完全卸载并重新安装呢。

在 list 子命令中使用 search 子命令

目前在 list 中只能搜索语言,回车后是复制了vmr search go的搜索命令。

但是在 list 中回车会给人一个很大的期望,就是回车能搜索版本,这存在了一些干扰。

希望在 list 中选定语言后,回车可以直接搜索。(备用方案是:回车后直接在下一个命令行上写入vmr search go的内容,不需要用户再粘帖)

卸载

希望尽快出一个一键卸载功能

[warn] operate commands in win11

powershell已经占用了vm

PS D:\work> vm list
Get-VM: Hyper-V 找不到名称为“list”的虚拟机

命令提示符正常

D:\work>vm list

AppName Homepage
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
agg https://github.com/asciinema/agg
bun https://bun.sh
cmdtools https://developer.android.google.cn/tools/releases/cmdline-tools
coursier https://get-coursier.io/
cygwin https://www.cygwin.com/
deno https://deno.com/
dotnet https://dotnet.microsoft.com/
fd https://github.com/sharkdp/fd
flutter https://flutter.dev/
fzf https://github.com/junegunn/fzf
git https://gitforwindows.org/
gleam https://gleam.run/
glow https://github.com/charmbracelet/glow
go https://go.dev/
gradle https://gradle.org/

Press "↑/k" to move up, "↓/j" to move down, "q" to quit.

no sdk found

➜ ~ vmr
WARNING no sdk found!
➜ ~ vmr version
v0.6.2(5d39224)

just drive me crazy...

vm_env 脚本支持 fishshell

目前在 fish 中 vm_env.sh 依然是 zsh 的脚本,其中包含 zsh 版本的 cdhook,可以调整为 fish 的脚本。

完整的脚本示例

vm_env.fish:

function _vmr_cdhook --on-variable PWD --description "version manager cd hook"
    vmr use -E
end

fish_add_path --prepend $HOME/.vm $HOME/.vm/bin

~/.config/fish/config.fish:

# ...
. ~/.vm/vm_env.fish

或者使用更 fish 的用法,~/.config/fish/conf.d/vmr.fish:

function _vmr_cdhook --on-variable PWD --description "version manager cd hook"
    vmr use -E
end

fish_add_path --global $HOME/.vm $HOME/.vm/bin

cd 命令与原来的行为不一致

平时用命令 会直接 cd 来回到家目录,不带任何参数
但是最近发现直接 cd 没用了,不回家了,但是cd到别的目录是可以的

  1. 查看cd命令是不是被篡改了, which cd 发现cd 是正确的, alias cd ,哎呦 果然被改了,但是还不知道是被哪个软件改的
  2. 继续排查,是在哪个文件中被修改的,查看了 /etc/bashrc 和 ~/.bashrc ,发现都没有被篡改,继续排查 bash -x 以debug方式进入一个新的shell,然后果然发现了问题
    image
  3. 进入这个文件查看
    image
  4. 问题就比较清楚了,如果 $1 不是一个存在目录,那么就什么都不做,所以我直接cd,那根本就没有$1,肯定不存在,因此什么都不做~
  5. 如何修改,这样改就好了 , vim ~/.vm/vm_env.sh
# cd hook start
cdalias=`alias|grep cdhook`
if [ -z "$cdalias" ]; then
	cdhook() {
		if [ $# -eq 0 ]; then
			\cd
		else
			\cd "$@" && vmr use -E
		fi
	}
	alias cd='cdhook'
fi
# cd hook end

[vmr search jdk]列表中未找到Java1.8

  1. 使用vmr search jdk后,通过"↑/k","↓/j"并未在列表中找到Java1.8
  2. 之前有通过brew安装过gradle6.x(在.zprofile文件中export PATH="/opt/homebrew/Cellar/gradle), 现在通过vmr安装gradle8.x,请问该如何在这两个版本之间做切换呢(是通过env吗)?没太明白vmr env 的用法,能否给个具体例子。

谢谢🙏

关于给每个项目独立设置nodejs版本问题

您好,想请教下,version-manager是否可以像vfox那样单独给每一个项目设置对应的nodejs版本?如果可以,需要如何设置呢?在命令帮助里没有看到,希望指导一下,谢谢

升级版本之后切换 nodejs 报 Cannot find version

我本地是很早就安装了vm,之后通过readme的升级命令进行了升级,现在情况如下:

$ vmr version
v0.1.6(c5e3c3b)  # 是最新的commit id

$ node -v
v14.21.3

$ vmr use [email protected]
 SUCCESS  Switched to 16.20.1

$ node -v
v16.20.1

$ vmr use [email protected]
  ERROR   Cannot find version: 14.21.3

$ node -v
v14.21.3

神奇的是,我把最新源码拉下来,直接执行是没有这个错误的:

$ go run cmd/vmr/manager.go u [email protected]
 SUCCESS  Switched to 14.21.3

目前还没定位到为什么我更新了二进制之后切到14会报一个找不到,但实际有正常切过去了,这里记录一下现象。

安装node失败

root@Jengro:~# vmr
 WARNING  Content-Length is not supported.


 - - Downloading node-v14.19.3-linux-x64.tar.gz...


  INFO    Extracting files, please wait...

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
  ERROR   Extract file failed: opening tar archive for reading: wrapping file reader: gzip: invalid header.
root@Jengro:~# 

安装node失败(安装pyton 、v 、go、rust 都正常)

mac在安装后没有自动添加环境变量

执行
curl --proto '=https' --tlsv1.2 -sSf https://gvc.1710717.xyz/proxy/https://raw.githubusercontent.com/gvcgo/version-manager/main/scripts/install.sh | sh
后环境变量没有添加到系统中,需要手动添加

为啥必须要使用cd命令后才会切换版本呢

这个直接打开是不行的,必须cd命令进来才会切换
image

nvmd可以在打开终端就是切换版本了:
https://github.com/1111mp/nvm-desktop/releases

大佬可否参考一下这个的设计,以及出个图形化管理的客户端呢,命令行有时候方便但对于新手GUI更友好。
文档使用方法建议详细一点,图文并茂举一个使用例子(例如,node,java等)最好(特别是针对项目锁定版本),不然很劝退新手。
我只是提个建议哈,好东西要更多人用起来嘛!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.