A quick Go CLI for managing .env files in my projects
Find a file
2026-01-18 01:00:43 -05:00
.github feat(workflows): update completion file names to align with shell conventions 2026-01-17 20:36:44 -05:00
cmd feat: initial version of envman 2026-01-17 18:47:30 -05:00
config fix(config): fix potential race condition in config init 2026-01-18 01:00:43 -05:00
utils fix(confirm): ensure line endings from all systems are handled correctly 2026-01-18 01:00:30 -05:00
.gitignore feat: initial version of envman 2026-01-17 18:47:30 -05:00
go.mod feat: initial version of envman 2026-01-17 18:47:30 -05:00
go.sum feat: initial version of envman 2026-01-17 18:47:30 -05:00
LICENSE feat: initial version of envman 2026-01-17 18:47:30 -05:00
main.go feat: initial version of envman 2026-01-17 18:47:30 -05:00
README.md feat: add readme 2026-01-17 19:45:04 -05:00

envman

License: GPL v3 Go Version Go Report Card Release

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 configuration to .env files across all project directories:

envman link [environment]

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.