https://github.com/hendriknielaender/zvm
⚡ Fast and simple zig version manager (zvm)
https://github.com/hendriknielaender/zvm
version version-manager zig ziglang zvm
Last synced: 2 months ago
JSON representation
⚡ Fast and simple zig version manager (zvm)
- Host: GitHub
- URL: https://github.com/hendriknielaender/zvm
- Owner: hendriknielaender
- License: mit
- Created: 2023-08-28T21:33:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T16:51:14.000Z (2 months ago)
- Last Synced: 2025-03-14T17:34:00.737Z (2 months ago)
- Topics: version, version-manager, zig, ziglang, zvm
- Language: Zig
- Homepage:
- Size: 1.99 MB
- Stars: 30
- Watchers: 3
- Forks: 4
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![]()
⚡ Zig Version Manager (zvm
)⚡ Fast and simple zig version manager
zvm is a command-line tool that allows you to easily install, manage, and switch between multiple versions of Zig.## Features
- List available Zig/zls versions (both remote and local).
- Install specific Zig or zls versions.
- Switch between installed Zig or zls versions.
- Remove installed Zig or zls versions.
- Display the current zvm version and helpful usage information.## Install
To install zvm with Homebrew, aka. `brew`, run the following commands:
```bash
brew tap hendriknielaender/zvm
brew install zvm
```Now add this line to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file.
```bash
export PATH="$HOME/.zm/current/zig:$PATH"
```### Windows
#### PowerShell
```ps1
irm https://raw.githubusercontent.com/hendriknielaender/zvm/master/install.ps1 | iex
```#### Command Prompt
```cmd
powershell -c "irm https://raw.githubusercontent.com/hendriknielaender/zvm/master/install.ps1 | iex"
```## Shell Completions
`zvm` provides built-in shell completion scripts for both Zsh and Bash. This enhances the command-line experience by allowing tab-completion of subcommands, flags, etc.
### Zsh
**Generate** the Zsh completion script:
```bash
zvm completions zsh > _zvm
```
**Move** `_zvm` into a directory that Zsh checks for autoloaded completion scripts. For example:
```bash
mkdir -p ~/.zsh/completions
mv _zvm ~/.zsh/completions
```
**Add** this to your `~/.zshrc`:
```bash
fpath+=(~/.zsh/completions)
autoload -U compinit && compinit
```
**Reload** your shell:
```bash
source ~/.zshrc
```### Bash
**Generate** the Bash completion script:
```bash
zvm completions bash > zvm.bash
```
**Source** it in your `~/.bashrc` (or `~/.bash_profile`):
```bash
echo "source $(pwd)/zvm.bash" >> ~/.bashrc
source ~/.bashrc
```## Usage
**General Syntax:**
```bash
zvm [arguments]
```**Available Commands:**
- `zvm ls` or `zvm list`
Lists all available versions of Zig or zls remotely by default.
Use `--system` to list only locally installed versions.
```bash
zvm ls
zvm ls --system
zvm ls zls --system
```- `zvm i` or `zvm install`
Installs the specified version of Zig or zls.
```bash
zvm install # Installs Zig and zls for the specified version
zvm install zig # Installs only Zig for the specified version
zvm install zls # Installs only zls for the specified version
```- `zvm use`
Switches to using the specified installed version of Zig or zls.
```bash
zvm use # Use this version of Zig and zls if installed
zvm use zig # Use this version of Zig only
zvm use zls # Use this version of zls only
```- `zvm remove`
Removes the specified installed version of Zig or ZLS.
```bash
zvm remove # Removes this version of Zig and/or zls if installed
zvm remove zig # Removes only the specified Zig version
zvm remove zls # Removes only the specified zls version
```
- `zvm clean`
Remove old download artifacts.- `zvm --version`
Displays the current version of zvm.- `zvm --help`
Displays detailed usage information.**Examples:**
```bash
# List all available remote Zig versions
zvm ls# List all installed local Zig versions
zvm ls --system# List all installed local zls versions
zvm ls zls --system# Install Zig version 0.12.0
zvm install 0.12.0# Use Zig version 0.12.0
zvm use zig 0.12.0# Remove Zig version 0.12.0
zvm remove zig 0.12.0# Remove old download artifacts.
zvm clean
```### Compatibility Notes
Zig is in active development and the APIs can change frequently, making it challenging to support every dev build. This project currently aims to be compatible with stable, non-development builds to provide a consistent experience for the users.***Supported Version***: As of now, zvm is tested and supported on Zig version ***0.14.0***.
### Contributing
Contributions, issues, and feature requests are welcome!### Clarification
Please note that our project is **not** affiliated with [ZVM](https://github.com/tristanisham/zvm) maintained by @tristanisham. Both projects operate independently, and any similarities are coincidental.