Manage symlinks from a root file to multiple destinations.
Useful for monorepos that use a single .env
file as a source of truth for many child projects.
go install github.com/tyhopp/lenv/cmd/lenv@latest
to install the command line executablego get github.com/tyhopp/lenv
to install as a dependency in your Go project
To install the latest linux amd64 release from GitHub:
curl -L -o lenv https://github.com/tyhopp/lenv/releases/latest/download/lenv-linux-amd64
See Releases for all available binaries and versions.
In the root of your project:
- Create a
.env
(or other named) file you want to symlink - Create a
.lenv
file with the destination locations to symlink to, such as:
project/a/.env
project/b/.env
- Follow these usage instructions:
Usage: lenv [options] <subcommand>
Options:
-env string
name of the environment file (default ".env")
-help
display help information
Subcommands:
check - Check status of symlinks between source env file and destinations
link - Symlink source env file to destinations
unlink - Remove symlinks from destinations