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
- Host: GitHub
- URL: https://github.com/nikgalushko/exec-env
- Owner: nikgalushko
- License: mit
- Created: 2020-11-23T17:19:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-29T10:50:19.000Z (over 5 years ago)
- Last Synced: 2026-01-15T03:36:48.154Z (5 months ago)
- Topics: cli, cli-app, command-line, command-line-tool, console, console-application, env, environment, environment-variables, go, golang, utilities, utility, variables
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 🎉