envrun command allows running any command with default environment
variables taken from a file, copying its standard error and standard output to
its own standard error and standard output.
Variables already present in the environment override the one in the file.
The command may have arguments, and it will be looked up in the
$PATH if its
name does not contain a
Install from source, using a Go SDK:
go install github.com/fgm/[email protected]
envrun foo: run
foowith the environment defaults loaded from
.envif it exists, or fail if it cannot be read.
envrun -f .env.demo env: run the
envcommand with the environment defaults loaded from
.env.demoor fail if it cannot be read
- If the command exits,
envrunwill return its exit status
- If the command is killed,
envrunwill return exit status 1
Many programs support reading their environment from a
.env file, and many IDEs
support that feature in run configurations.
This command is provided for situations outside an IDE (e.g. CI/CD) and where the program to be run does not include this feature.
- Non-security questions: use Github issues
- Security questions or direct support: use https://osinet.fr/contact