init

Create an Envfile from .env files and source code.

Usage

Create an Envfile from your .env files and source code. In an interactive terminal, select the files to include and whether to scan code for environment variable references.

$ dotenvx init
◈ created (Envfile)

Outside an interactive terminal, the command reads .env.example and .env when present. Use -f to select a single file. It records variable declarations without copying secret values and leaves an existing Envfile unchanged.

Review the generated declarations, then run dotenvx check to check your configuration against the Envfile. Validation requires an Envfile; .env.example alone is not used for validation.

Options