envman is a CLI tool for managing .env files when working with multiple environments, particularly useful in a monorepo. It allows you to hotswap between different environment configurations using symlinks.
- Manage multiple projects with different environment configurations
- Define multiple directories within a project for
.envfile synchronization - Quickly switch between environments using symlinks
- View current project status and active environment
Ensure you have Go installed (version 1.25.5 or later). Then run:
go install github.com/hisbaan/envman@latestClone the repository and build:
git clone https://github.com/hisbaan/envman.git
cd envman
go build -o envmanAdd your current directory or a specific path as a project:
envman proj add [project-dir]Remove a project from the configuration:
envman proj rm [project-dir]Add a subdirectory to the current project:
envman dir add [dir]Remove a directory from the current project:
envman dir rm [dir]Link an environment configuration to .env files across all project directories:
envman link [environment]Remove all .env symlinks:
envman unlinkView the current project status, directories, and active environment:
envman statusenvman stores its configuration in ~/.config/envman/config.toml. The configuration is managed automatically through the CLI commands.