While Lmod's module save feature is useful, it has several limitations in modern High-Performance Computing (HPC) workflows:
- Portability limitations across different clusters.
- Relies on obscure or hidden file formats instead of clear, human-readable definitions.
- Misses the ability to seamlessly store specific environment variables alongside module loads.
- Lacks a native way to quickly audit your environment or seamlessly auto-load modules when entering a specific project directory.
menv solves this by providing reproducible, human-readable environments designed for researchers and developers.
- Atomic Snapshots (YAML-based): State-of-the-art environment definitions stored in transparent, versionable YAML files.
- Automatic Hook (Auto-load on
cd): Generate shell wrappers that automatically load the environments when entering your project folders. - Doctor Command: Easily perform portability checks of your environments when jumping between different HPC clusters.
- Zero Overhead: Written in Go, it runs natively with lightning-fast performance and no measurable overhead.
You can install menv globally on your HPC account via our robust installation script:
curl -sSL https://raw.githubusercontent.com/Thedtk24/menv/main/install.sh | bashNote: The script will automatically fetch the correct binary for your OS and architecture via the GitHub API and install it in
~/.local/bin.
Save your current module configuration:
menv save my-projectLoad your saved environment seamlessly:
menv load my-projectAdd the zero-overhead auto-loader to your shell:
# Add this to your ~/.zshrc or ~/.bashrc
menv hook >> ~/.bashrc(Every time you cd into a directory containing a .menv.lock file, your environment is automatically loaded!)
Under the hood, menv is distributed as a single static Go binary. It evaluates the active loaded modules by communicating with Lmod strictly through environment variables. For loading, it outputs pure shell instructions (module purge, module load ...) to ensure complete compatibility across any shell wrapper.
Example of an menv YAML save file (~/.menv/my-project.yaml):
name: my-project
created: 2026-03-27T12:00:00Z
modules:
- gcc/11.3.0
- openmpi/4.1.4
- cuda/11.8
env_vars: {}This transparent architecture means you are always in control of your stack.
menv is designed to be the perfect middle-ground:
- Rock-solid Security: Operates completely in userspace—no root, no daemons. Keeps your SysAdmins happy!
- Native Performance: ZERO virtualization layers, allowing full and direct access to InfiniBand fabrics, NVLink, and specialized cluster hardware.
- Cluster Friendly: Perfect synergy with the cluster's existing Lmod software stack engineered by your HPC admins.
We welcome contributions to make menv the standard for HPC environment management! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License. See the LICENSE file for more details.