Skip to content

Feature Request: generate a template from an env file #618

@griou

Description

@griou

Hello,

Similar to the template support provided by dotenv in Ruby, it would be very helpful to have a CLI command that can generate an environment template file directly from an existing .env.

The goal is to make it easier to keep an environment template file up to date automatically.

For example:

# .env
S3_BUCKET=YOURS3BUCKET
SECRET_KEY=YOURSECRETKEYGOESHERE

Could generate:

# .env.template
S3_BUCKET=S3_BUCKET
SECRET_KEY=SECRET_KEY

This command could be integrated into a pre-commit hook to ensure the template always reflects the current set of environment variables.

Additionally, it would be helpful to support a configuration option to preserve selected variables as-is or to exclude them from the generated template.

Thank you for considering this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions