Simplify Your Life: Manage Multiple SDK Versions Across All Platforms

8 min read Original article ↗

Aooohan

Developers often face the challenge of managing different versions of multiple languages or tools for various projects. This can involve using different version management tools like NVM for Node, FVM for Flutter, SDKMAN for Java, etc., each with its own unique usage method. The installation and management of these tools can be tedious and time-consuming. Additionally, cross-platform compatibility is often an issue, requiring different tools for different environments.

Press enter or click to view image in full size

In daily development, using multiple languages or tools like Golang, Java, Node, Flutter, or Maven often requires managing different versions for different projects. For example, switching between JDK8 for one project and JDK17 for another. This could mean installing and learning multiple version management tools like NVM for Node, FVM for Flutter, SDKMAN for Java, etc. This process can be tedious, time-consuming, and complicated by cross-platform compatibility issues.

VersionFox, a new cross-platform version management tool, simplifies this process. It manages versions of multiple languages or tools through installable plugins like Java, Node, Flutter, etc. This makes managing different versions for different projects more efficient and less complex.

Introduction

https://github.com/version-fox/vfox

VersionFox is a cross-platform tool for managing SDK versions. It allows you to quickly install and switch between different versions of SDKs using the command line. SDKs are provided as plugins in the form of Lua scripts. This means you can implement your own SDK sources or use plugins shared by others to install SDKs. It all depends on your imagination. ;)

Installation

macOS

On macOS, you can use Homebrew to quickly install vfox:

brew tap version-fox/tap
brew install vfox

If Homebrew is not installed, you can download the binary directly:

curl -sSL https://raw.githubusercontent.com/version-fox/vfox/main/install.sh | bash

Press enter or click to view image in full size

Install with binary directly

Linux

Install with APT

 echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | sudo tee /etc/apt/sources.list.d/versionfox.list
sudo apt-get update
sudo apt-get install vfox

Install with YUM

 echo '[vfox]
name=VersionFox Repo
baseurl=https://yum.fury.io/versionfox/
enabled=1
gpgcheck=0' | sudo tee /etc/yum.repos.d/trzsz.repo

sudo yum install vfox

others, you can download the binary directly:

curl -sSL https://raw.githubusercontent.com/version-fox/vfox/main/install.sh | bash

Windows

For Windows users, you can go directly to the release page and download the setup installer to install it.

Press enter or click to view image in full size

Installers for different architectures

Usage

So far, we have installed VersionFox. Now, if we need to manage versions for Node, Golang, and Flutter simultaneously, do we still need to install corresponding version management tools?

No, VersionFox has got us covered. All we need to do is install the corresponding plugins. Let’s proceed with that.

View Available Plugins

Command: vfox available [<category>]

For new users may not know how to install the required SDK plug-in name is, then you can use this command to see the corresponding plug-in name for installation.

Press enter or click to view image in full size

View Available Plugins

Install Plugin

Command: vfox add <plugin-name>

Press enter or click to view image in full size

Add Node Plugin

Press enter or click to view image in full size

Add Golang Plugin

Press enter or click to view image in full size

Add Flutter Plugin

You will look some info about plugin if you install it successfully. And you can use vfox ls command to see how many plugins you have installed.

Press enter or click to view image in full size

Install Targeted Version

Command: vfox install/i <sdk-name>[@<version>]

Assuming we now need Node 20.10.0 and 18.12.0, Golang 1.21.5 and 1.18.8, Flutter 3.16.5 and 3.10.2, here’s how we can install them using VersionFox:

VersionFox offers two methods for installation:

  1. If you don’t know the exact version number, you can use the search feature provided by VersionFox. For instance, you can type vfox search <sdk-name>, select the version you need from the provided list, and hit enter to install.
  2. If you know the exact version number, you can directly input the corresponding command in the terminal. For example, you can type vfox install <sdk-name>@<version> and hit enter to install.

Install Node 20.10.0 and 18.12.0

Command: vfox search node

Press enter or click to view image in full size

Command: vfox install node@18.12.0

Press enter or click to view image in full size

Install Golang 1.21.5 and 1.18.8

Command: vfox search golang

Press enter or click to view image in full size

Command: vfox install golang@1.18.8

Press enter or click to view image in full size

Install Flutter 3.16.5 and 3.10.2

Command: vfox search flutter

Press enter or click to view image in full size

Command: vfox install flutter@3.10.2

Press enter or click to view image in full size

Use Targeted Version

Command: vfox use/u <sdk-name>[@<version>]

By now, you’ve installed the versions you wanted. Next, we’ll cover the most frequently used feature: switching versions. For convenience, VersionFox provides two methods for this:

  1. If you don’t know the exact version number, you can use vfox use <sdk-name>command. It will list all installed versions, and you can select the one you want to use and hit enter.
  2. If you know the exact version number, you can use vfox use <sdk-name>@<version> command.

For an even quicker method, you can use vfox u <sdk-name>orvfox u <sdk-name>@<version>commands.

These methods make switching between different versions a breeze. Whether you know the exact version you want to switch to or you’re exploring different versions, VersionFox makes the process simple and efficient.

Press enter or click to view image in full size

Switch Node Version

Press enter or click to view image in full size

Switch Golang Version

Press enter or click to view image in full size

S witch Flutter Version

View current version

Command: vfox current/c [<sdk-name>]

Sometimes, you might need to check the current version number you’re using. In such cases, you can use vfox currentcommand. This command will tell you the current version numbers for all the SDKs.

Alternatively, if you want to know the current version of a specific SDK, you can use vfox current <sdk-name>command. This command will tell you the current version number of the target SDK.

These commands make it easy to keep track of the versions you’re using, adding to the convenience and efficiency that VersionFox brings to your development process.

Press enter or click to view image in full size

View Current Version

Uninstall Targeted Version

Command: vfox uninstall/un <sdk-name>@<version>

If you no longer want to use a certain version, for example, Node 18.12.0, you can use vfox unintall <sdk-name>@<version>command. For instance, you can type vfox unintall node@18.12.0and hit enter to remove the corresponding version.

VersionFox will automatically detect the version you’re currently using. If the version you’re deleting is the one currently in use, VersionFox will automatically switch to another installed version.

Press enter or click to view image in full size

Uninstall Node 18.12.0

Remove Plugin

Command: vfox remove <sdk-name>

Sometimes, you might need to use an SDK temporarily. For instance, if you only need to use Golang temporarily and want to remove it after use, it would be tedious to uninstall each version one by one.

In such cases, you can use vfox remove <sdk-name>command. This command will clear all versions of the SDK and remove the corresponding plugin. For example, you can type vfox remove golang. VersionFox will ask for confirmation to prevent accidental deletion. Simply type ‘y’ or ‘Y’ and hit enter to remove the Golang plugin and all its installed versions.

Press enter or click to view image in full size

Remove Golang Plugin

Command Overview

vfox - VersionFox, a tool for sdk version management
vfox available [<category>] List all available plugins
vfox add [--alias <sdk-name> --source <url/path> ] <plugin-name> Add a plugin from offical repository or custom source
vfox remove <sdk-name> Remove a plugin
vfox update <sdk-name> Update a plugin
vfox info <sdk-name> Show plugin info
vfox search <sdk-name> Search available versions of a SDK
vfox install <sdk-name>@<version> Install the specified version of SDK
vfox uninstall <sdk-name>@<version> Uninstall the specified version of SDK
vfox use <sdk-name>@<version> Use the specified version of SDK
vfox use <sdk-name> Select the version to use
vfox list <sdk-name> List all installed versions of SDK
vfox list List all installed versions of all SDKs
vfox current <sdk-name> Show the current version of SDK
vfox current Show the current version of all SDKs
vfox help Show this help message

Plug-in Repository

Currently, VersionFox provides more than just Node, Golang, and Flutter plugins. You can visit the version-fox-plugins repository to find the plugin you need.

As of now, the supported SDKs or tools include:

  1. Node
  2. Golang
  3. Flutter
  4. Zig
  5. Java
  6. Maven

Of course, VersionFox allows for custom plugin development. For more details, please refer to the ‘Plugin System’ section in the README.

This flexibility makes VersionFox a versatile tool for version management, capable of supporting a wide range of SDKs and tools. Whether you’re using one of the supported SDKs or developing your own plugin, VersionFox has got you covered.

End

We hope you found this guide helpful in managing multiple SDK versions across all platforms. If you did, please consider giving us a star on our repository. Your support helps us continue to improve and expand VersionFox.

Moreover, VersionFox is an open-source project and we welcome contributions from the community. If you’re interested in contributing, whether it’s by adding new features, fixing bugs, or improving documentation, we’d love to have you join us. Together, we can make VersionFox even better. Thank you for your support!