Browse topics
Commands
Reference for running genesis-env from your project root (current working directory). After a global install, use genv for every command below.
Quick workflow
npm i -g genesis-env
genv init
# edit .env.template
genv
genv validateDefault: interactive generate
Running genv with no subcommand is the same as generate: it finds a template, prompts once per variable, then writes .env.
Template discovery, prompts, defaults, and overwrite rules are covered in Templates & .env.
generate (explicit)
Same behavior as the default command:
genv generateOverwrite an existing .env instead of exiting with an error:
genv --forceYou can also pass the short flag:
genv -finit
Scaffold missing files and keep .gitignore safe:
genv initCreates .env.template when needed, and ensures .env is listed in .gitignore (no duplicate lines). It does not write your local .env; run genv after init to generate that file.
Typical output on a fresh repo:
$ genv init
✔ .env.template created
✔ .gitignore created
✔ .env added to .gitignore.gitignore behavior
init handles three cases. You can run it on an existing repo without duplicating entries:
| Scenario | What happens |
|---|---|
No .gitignore exists | Creates .gitignore with .env |
.gitignore exists, .env not in it | Appends .env |
.env already ignored | Prints that it is already ignored; no duplicate line added |
validate
Check that your local .env matches the committed template (keys and shape):
genv validateRun this after genv whenever you change the template or want to confirm a teammate's setup before shipping.
Security
genesis-env writes a plain .env file on your local filesystem. It is not a secrets manager. Your .env is unencrypted plaintext — genesis-env helps reduce the risk of committing it via .gitignore setup, but makes no encryption or security guarantees beyond that.
Options / flags
| Flag | Effect |
|---|---|
--force / -f | Overwrite an existing .env instead of exiting with an error (with generate or the default command). |
Help
genv --helpSample workflow
genv init(optional): scaffold.env.template, update.gitignoreif needed.- Edit
.env.templateor.env.examplewith your variable names and optional defaults. genv: answer prompts to generate.env.genv validate: confirm.envmatches the template.- Run your app with the new
.env.
For template file rules and examples, see Templates & .env.