govm

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 13 Imported by: 0

README

logo

GoVM - Go Version Manager

GoVM is a modern tool for managing multiple Go versions on your system. It features both a clean Terminal UI (TUI) and a command-line interface for easy installation and switching between Go versions.

Features

  • Beautiful TUI built with Charm Bubbletea
  • Command-line interface for quick operations
  • Install any available Go version directly from go.dev
  • Switch between installed versions with a single command
  • Supports partial version numbers (e.g., 1.21 for latest 1.21.x)
  • Works on macOS and Linux. Looking for testing for Windows

Installation

Prerequisites
  • Go 1.18 or higher
Install
go install github.com/melkeydev/govm@latest

Then in a new terminal run:

govm

To launch the TUI

First-Time Setup

When you first run GoVM, it will guide you through adding the required directory to your PATH. This is a one-time setup that enables GoVM to manage your Go versions.

On Linux/macOS

Add this to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):

export PATH="$HOME/.govm/shim:$PATH"

Or run this command to add it automatically:

echo 'export PATH="$HOME/.govm/shim:$PATH"' >> ~/.bashrc  # or ~/.zshrc

Then reload your shell configuration:

source ~/.bashrc  # or whichever file you modified
On Windows

Add the shim directory to your PATH:

setx PATH "%USERPROFILE%\.govm\shim;%PATH%"

Then restart your terminal.

Usage

GoVM can be used in two ways: via the interactive TUI or through command-line commands.

Terminal User Interface (TUI)

Launch the interactive TUI by running govm without arguments:

govm
Navigation
  • Use the arrow keys to navigate through the list of versions
  • Press i to install the selected version
  • Press u to use/switch to the selected version
  • Press r to refresh the list of available versions
  • Press Tab to switch between "Available Versions" and "Installed Versions" views
  • Press q to quit
Command Line Interface
# Install a Go version (latest patch for the specified version)
govm install 1.21  # Installs the latest Go 1.21.x

# Switch to a Go version
govm use 1.20      # Switches to the latest installed Go 1.20.x

# List installed versions
govm list

# Show help
govm help

# Launch the TUI
govm

How It Works

GoVM downloads Go versions from the official go.dev website and installs them in ~/.govm/versions. It uses a "shim" approach:

  • It creates wrapper scripts in ~/.govm/shim that point to the selected Go version
  • When you run go or other Go commands, these wrappers execute the proper version
  • Switching versions simply updates these wrappers to point to a different installation

This ensures a seamless experience without needing to manually update environment variables or source scripts each time you switch versions.

Install from source
# Clone the repository
git clone https://github.com/melkeydev/govm.git
cd govm

# Build and install
go build -o govm

Then place the binary somewhere in your PATH.

Homebrew

Add Homebrew repository to the system:

brew tap melkeydev/tap

You can then install your package with:

brew install govm

Dependencies

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL