Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tyhopp/lenv

Manage symlinks from a root file to multiple destinations
https://github.com/tyhopp/lenv

cli env environment-variables go golang monorepo wasi wasm zero-dependency

Last synced: about 5 hours ago
JSON representation

Manage symlinks from a root file to multiple destinations

Awesome Lists containing this project

README

        

# lenv

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.

## Installation

Download precompiled binaries from [Releases](https://github.com/tyhopp/lenv/releases).

Ports for various programming languages are available in [lenv-ports](https://github.com/tyhopp/lenv-ports):

- [JavaScript](https://github.com/tyhopp/lenv-ports/tree/main/js/README.md), published to [npm](https://www.npmjs.com/package/lenv-js)
- [Python](https://github.com/tyhopp/lenv-ports/tree/main/py/README.md), published to [PyPI](https://pypi.org/project/lenv-py)
- [Rust](https://github.com/tyhopp/lenv-ports/tree/main/rs/README.md), published to [crates.io](https://crates.io/crates/lenv-rs)

## Usage

In the root of your project:

1. Create a `.env` (or other named) file you want to symlink
2. Create a `.lenv` file with the destination locations to symlink to, such as:

```
project/a/.env
project/b/.env
```

3. Execute `lenv link` to create symlinks

Use the `-help` flag to see all usage instructions.

### WASI binary execution

The [WebAssembly System Interface (WASI)](https://wasi.dev/) binary can be executed with the [Wasmtime](https://wasmtime.dev/) runtime CLI with this command structure:

```
wasmtime --wasi cli --dir /absolute/path/to/project lenv-wasip1.wasm
```