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

https://github.com/nikgalushko/exec-env

Execute a command using an environment form .env file
https://github.com/nikgalushko/exec-env

cli cli-app command-line command-line-tool console console-application env environment environment-variables go golang utilities utility variables

Last synced: 5 months ago
JSON representation

Execute a command using an environment form .env file

Awesome Lists containing this project

README

          

# exec-env

Execute a command using an environment from .env file. `exec-env` also proxies all os signals to child process.

# Installation
### Github Release
Visit the [releases page](https://github.com/valenok-husky/exec-env/releases) to download one of the pre-built binaries.

### Go
As secondary option you can use `go install`:
```
go install github.com/valenok-husky/exec-env
```

# Basic Usage
`exec-env -f `

# Example
### Create the environment file `dev.env`
```
PORT=8080
LOG_LVL=debug
PREFIX="app prefix"
```
### Start `printenv` via `exec-env` with our dev.env file
`exec-env -f dev.env printenv`

Printenv is not a part of `exec-env`. Printenv is a unix command. Check the [man page](https://man7.org/linux/man-pages/man1/printenv.1.html).

The output is
```

...
PORT=8080
LOG_LVL=debug
PREFIX=app prefix
```
It's working 🎉