โจ menv โจ
๐ช A cute & powerful Windows environment variable manager
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