tidepool-gvm
A command-line interface for Go version management, providing an intuitive and user-friendly way to install, switch, and manage Go versions across platforms.
Overview
tidepool-gvm is the CLI component of the Tidepool project that provides the gvm command. It's built on top of the tidepool-version-manager core library and offers a modern, package manager-style interface for Go version management.
Installation
Via Cargo
This installs the binary as gvm command.
From Source
The binary will be available at target/release/gvm (or gvm.exe on Windows).
Usage
Basic Commands
# Install a Go version
# Switch to a Go version
# List installed versions
# List available versions for download
# Show current status
# Show version information
# Uninstall a version
# Update available versions cache
# Show configuration
# Show help
Advanced Options
# Force installation (overwrite existing)
# Global setting (persistent across terminals)
# Custom installation directory
# Verbose output
Features
- π Version Management: Install, switch, and uninstall Go versions
- π Fast Operations: Asynchronous downloads with progress display
- π‘οΈ Safety: Protection against accidental deletion of active versions
- π Cross-Platform: Works on Windows, macOS, and Linux
- π¨ Modern UI: Colorful terminal output and progress indicators
- βοΈ Environment Management: Automatic GOROOT, GOPATH, and PATH configuration
Configuration
GVM stores configuration in platform-specific directories:
- Windows:
%APPDATA%\gvm\config.toml - macOS/Linux:
~/.config/gvm/config.toml
Example Configuration
[]
= "/usr/local/go-versions"
= "/tmp/gvm-downloads"
= "official"
= true
= 4
Environment Variables
After switching to a Go version, GVM automatically configures:
GOROOT="/usr/local/go-versions/1.21.3"
GOPATH="/go" # if not already set
PATH="/bin:/bin:"
Development
This CLI tool is built using:
- clap: Command-line argument parsing
- tokio: Async runtime
- indicatif: Progress bars
- console: Terminal styling
- tidepool-version-manager: Core functionality
Project Structure
cli/tidepool-gvm/
βββ Cargo.toml # Package configuration
βββ src/
β βββ main.rs # Main entry point
β βββ lib.rs # Library interface
β βββ cli.rs # Command-line parsing
β βββ commands.rs # Command implementations
β βββ config.rs # Configuration management
β βββ ui.rs # User interface helpers
βββ examples/ # Usage examples
βββ tests/ # Integration tests
Building
# Development build
# Release build
# Run tests
# Run with debug logging
RUST_LOG=debug
Architecture
The CLI follows a clean architecture pattern:
- CLI Layer (
cli.rs): Parses command-line arguments using clap - Command Layer (
commands.rs): Implements business logic for each command - UI Layer (
ui.rs): Handles user interface and terminal output - Config Layer (
config.rs): Manages application configuration - Core Layer: Uses
tidepool-version-managerfor actual version management
Error Handling
The CLI provides user-friendly error messages and suggestions:
License
This project is licensed under the MIT License. See LICENSE for details.
Contributing
Contributions are welcome! Please see the main project's Contributing Guide for details.