Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Generating .env.example file from a .env file #354

Open
ShivKJ opened this issue Aug 31, 2021 · 4 comments · May be fixed by #362
Open

Feature Request: Generating .env.example file from a .env file #354

ShivKJ opened this issue Aug 31, 2021 · 4 comments · May be fixed by #362

Comments

@ShivKJ
Copy link

ShivKJ commented Aug 31, 2021

Hi,

Sometimes we can not share .env file. However it would be useful if we could generate a .env.example from it which contains all the comments and keys name in it. For example, suppose .env has the following content,

# this is comment
API_SECRET_KEY=some-value

Then generated .env.example file has the following content,

# this is comment
API_SECRET_KEY=

It would be useful if a CLI command is provided for it.

Thanks

@ethsanders
Copy link

I'll work on this soon.

@ethsanders
Copy link

I just made a function that does this, but I still have to incorporate it into the cli. Will do it tonight.

@ethsanders ethsanders linked a pull request Nov 10, 2021 that will close this issue
@Thebaldguy15
Copy link

this is comment

API_SECRET_KEY=some-value

@frou
Copy link

frou commented Jul 2, 2022

Something cool about an .env.example file is that it can not only be used for human reference purposes, but also to facilitate an opt-in programmatic safety feature. The example file can be shipped with an application, then read at runtime and used to establish a list of the names of variables that must be defined. See the dotenv module in Deno's standard library: https://deno.land/[email protected]/dotenv#safe-mode


Update: Deno removed that feature :( denoland/std#5450

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants