envman

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.
Features
- Manage multiple projects with different environment configurations
- Define multiple directories within a project for
.env file synchronization
- Quickly switch between environments using symlinks
- View current project status and active environment
Installation
Go
Ensure you have Go installed (version 1.25.5 or later). Then run:
go install github.com/hisbaan/envman@latest
Build from Source
Clone the repository and build:
git clone https://github.com/hisbaan/envman.git
cd envman
go build -o envman
Usage
Add a Project
Add your current directory or a specific path as a project:
envman proj add [project-dir]
Remove a Project
Remove a project from the configuration:
envman proj rm [project-dir]
Add a Directory
Add a subdirectory to the current project:
envman dir add [dir]
Remove a Directory
Remove a directory from the current project:
envman dir rm [dir]
Link an Environment
Link an environment configuration to .env files across all project directories:
envman link [environment]
Unlink
Remove all .env symlinks:
envman unlink
Status
View the current project status, directories, and active environment:
envman status
Configuration
envman stores its configuration in ~/.config/envman/config.toml. The configuration is managed automatically through the CLI commands.