A version manager for vcluster CLI, similar to tfenv and pyenv.
Manage multiple versions of the vcluster CLI and switch between them seamlessly.
Latest release: v1.0.0 (tag: v1.0.0).
| Platform | Asset | Download |
|---|---|---|
| macOS (Intel) | vc-env-darwin-amd64 |
Download |
| macOS (Apple Silicon) | vc-env-darwin-arm64 |
Download |
| Linux (x86_64) | vc-env-linux-amd64 |
Download |
| Linux (ARM64) | vc-env-linux-arm64 |
Download |
- Install and manage multiple vcluster CLI versions
- Automatic version switching based on project directory (
.vcluster-version) - Shell-level, local (directory), and global version configuration
- Version priority: shell > local > global
- Auto-detection of OS and architecture for binary downloads
- Shim-based transparent proxying of
vclustercommands
git clone https://github.com/mmpyro/vc-env.git
cd vc-env
make buildThe binary will be at build/vc-env. Move it to a directory in your PATH:
sudo mv build/vc-env /usr/local/bin/make build-allThis produces binaries for:
linux/amd64linux/arm64darwin/amd64darwin/arm64
Add to your ~/.bashrc or ~/.zshrc:
export VCENV_ROOT="$HOME/.vcenv"Reload your shell:
source ~/.bashrc # or source ~/.zshrcAdd the following to your ~/.bashrc or ~/.zshrc (after the VCENV_ROOT export):
eval "$(vc-env init)"This sets up:
- A
vc-envshell function forvc-env shellsupport - PATH prepend for the vcluster shim
# Install a specific version
vc-env install 0.21.1
# Install the latest stable version
vc-env install# Set global default
vc-env global 0.21.1
# Set for current directory (creates .vcluster-version)
vc-env local 0.21.1
# Set for current shell session
vc-env shell 0.21.1vcluster versionThe shim automatically resolves and uses the correct version.
Full reference: docs/cli-reference.md
| Command | Description |
|---|---|
vc-env help |
Display help and all available commands |
vc-env list |
List all installed versions |
vc-env list-remote |
List all available vcluster versions from GitHub |
vc-env list-remote --prerelease |
Include pre-release vcluster versions |
vc-env latest |
Print the latest available version of vcluster from GitHub |
vc-env init |
Initialize vc-env setup |
vc-env status |
Show current environment status |
vc-env install [VERSION] |
Install a specific version (or latest) |
vc-env uninstall VERSION |
Uninstall a specific version |
vc-env exec VERSION CMD |
Run a command using a specific vcluster version |
vc-env shell [VERSION] |
Set/show shell version (VCENV_VERSION) |
vc-env local [VERSION] |
Set/show local version (.vcluster-version) |
vc-env global [VERSION] |
Set/show global version ($VCENV_ROOT/version) |
vc-env which |
Print path to active vcluster binary |
vc-env version |
Print vc-env version |
vc-env upgrade |
Download the latest stable release of vc-env from GitHub and replace the current binary in-place |
ev-env autocompletion |
Generate a Bash autocompletion script for a smoother CLI experience |
When vcluster is invoked, the version is resolved in this order:
- Shell —
VCENV_VERSIONenvironment variable (set viavc-env shell) - Local —
.vcluster-versionfile in the current or parent directories (set viavc-env local) - Global —
$VCENV_ROOT/versionfile (set viavc-env global)
If no version is configured at any level, the command fails with an informative error.
Add the following to your ~/.bashrc:
# vc-env setup
export VCENV_ROOT="$HOME/.vcenv"
eval "$(vc-env init)"
source <(vc-env autocompletion)Add the following to your ~/.zshrc:
# vc-env setup
export VCENV_ROOT="$HOME/.vcenv"
eval "$(vc-env init)"
source <(vc-env autocompletion)vc-env uses a three-layer caching strategy to keep list-remote and latest fast and reliable. For more details on how it works and how to configure it, see docs/caching.md.
$VCENV_ROOT/
├── versions/ # Installed vcluster versions
│ ├── 0.21.1/
│ │ └── vcluster # vcluster binary
│ └── 0.22.0/
│ └── vcluster
├── shims/
│ └── vcluster # Shim script (auto-generated)
└── version # Global version file
make testmake test-dockermake build # Current platform
make build-all # All platformsSee LICENSE for details.