menv

command module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

README ยถ

menv logo

โœจ menv โœจ

๐ŸชŸ A cute & powerful Windows environment variable manager

CI Go Report Card License Release

English โ€ข ็ฎ€ไฝ“ไธญๆ–‡ โ€ข ็น้ซ”ไธญๆ–‡ โ€ข ํ•œ๊ตญ์–ด โ€ข ๆ—ฅๆœฌ่ชž


๐Ÿš€ Features

  • ๐Ÿ“‹ List & Search - View and search environment variables with ease
  • โœ๏ธ Set & Delete - Manage environment variables from the command line
  • ๐Ÿ“ PATH Management - Add, remove, and clean PATH entries
  • ๐Ÿ” Health Check - Find and fix invalid paths automatically
  • ๐Ÿ’พ Backup & Restore - Never lose your environment settings
  • ๐Ÿ›ก๏ธ System & User - Support for both user and system variables

๐Ÿ“ฆ Installation

Download the latest binary from GitHub Releases and add it to your PATH.

Or install via Go:

go install github.com/doraemonkeys/menv@latest

Or clone and install locally:

git clone https://github.com/doraemonkeys/menv.git
cd menv
go install

๐ŸŽฏ Quick Start

๐Ÿ‘€ View Environment Variables

menv -list                  # List all user environment variables
menv -get JAVA_HOME         # Get the value of a specific variable
menv -search java           # Search for variables containing "java"

โœ๏ธ Set/Delete Environment Variables

menv GOPATH C:\Go           # Set a user environment variable
menv -d GOPATH              # Delete a user environment variable

๐Ÿ“ PATH Management

menv -path                  # View PATH (one path per line)
menv -add "C:\bin"          # Add a path to PATH
menv -rm "C:\bin"           # Remove a path from PATH
menv -clean                 # Clean PATH (deduplicate + remove invalid paths)
menv -search java -path     # Search for paths containing "java" in PATH

๐Ÿ” Check Invalid Paths

menv -check                 # Check for invalid directories in PATH
menv -check -fix            # Automatically remove invalid paths
menv -check -fix -y         # Remove without confirmation

๐Ÿ’พ Backup and Restore

menv -backup backup.json    # Backup environment variables
menv -restore backup.json   # Restore environment variables
menv -export env.sh         # Export as shell script

๐Ÿ›ก๏ธ System Environment Variables

The above commands operate on user environment variables by default. Add -sys to operate on system environment variables (requires administrator privileges):

menv -list -sys             # List system environment variables
menv -path -sys             # View system PATH
menv -add "C:\bin" -sys     # Add to system PATH
menv -clean -sys            # Clean system PATH

๐Ÿ“– Common Scenarios

Scenario Command
๐Ÿ‘๏ธ View a specific variable menv -get JAVA_HOME
โž• Add a directory to PATH menv -add "C:\tools\bin"
๐Ÿงน Clean duplicate and invalid paths menv -clean
๐Ÿ’พ Backup current environment variables menv -backup my-env.json
๐Ÿ”Ž Find Java-related paths menv -search java -path

๐Ÿ“„ License

LICENSE

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis

Jump to

Keyboard shortcuts

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