Could be using a `.env.dist` template be better in mkdotenv

Recently I submitted into alpine linux oficial repositories a FOSS tool named mkdotenv. But some comments implied that may be too complicated and offers no value.

Therefore I refocused on the goal: Having a tool that retrieves secrets from secret managers and populates upon a `.env` file.

So I am redesigning it comletely as I (currently self) discuss upon https://github.com/pc-magas/mkdotenv/issues/18

The idea is to use comments in a specific format in order to define upon each environment where values should be retrieved from. The comments though should have the following format:

“`

<h1>mkdotenv(<sup>environment<sup>)::value_resolver(<sup>arguments<sup>).<sup>item^</sup></sup></sup></sup></sup></h1>

“`

An example is:

“`

<h1>mkdotenv("prod")::aws_ssm(arn="arn:aws:ssm:eu-west-1:111122223333:parameter/config/service-a/timeout")</h1>

<h1>mkdotenv("staging")::aws_ssm(arn="arn:aws:ssm:eu-west-1:111122223333:parameter/config/service-a/timeout")</h1>

DB_PASSWORD=XXX
“`

And user would provide the cli argument in a variable such as:


mkdotenv --env=prod

I would ditch piping output and output towards stdout all outputs would be upon a file. What is your take on this desighn?

Leave a Reply