---
title: "Discussion on \"Stop Committing Secrets: Automatically Generate .env.example with gen-envex\" | Hashnode"
description: "Discussion on \"Stop Committing Secrets: Automatically Generate .env.example with gen-envex\". Automatically generate a clean .env.example from your .env file using gen-envex. Remove secret values, preserve comments, and keep your project secure"
url: "https://hashnode.com/posts/stop-committing-secrets-automatically-generate-env-example-with-gen-envex/6a57cd832a25ace6dd6c4bfa"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Stop Committing Secrets: Automatically Generate .env.example with gen-envex](https://blog.aniketdey.in/stop-committing-secrets-automatically-generate-env-example-with-gen-envex?utm_source=hashnode&utm_medium=feed)

Automatically generate a clean .env.example from your .env file using gen-envex. Remove secret values, preserve comments, and keep your project secure

Jul 15 · 3 min read · blog.aniketdey.in  
Read the article

-   [#env](https://hashnode.com/tag/env)
-   [#environment-variables](https://hashnode.com/tag/environment-variables)
-   [#cli](https://hashnode.com/tag/cli)
-   [#dev](https://hashnode.com/tag/dev)
-   [#devtools](https://hashnode.com/tag/devtools)
-   [#npm](https://hashnode.com/tag/npm)
-   [#opensource](https://hashnode.com/tag/opensource)

## Written by

[Aniket Dey](https://hashnode.com/@AniketDey)

@AniketDey · Kolkata

  
[View profile](https://hashnode.com/@AniketDey)

## Responses 3

Markdown supported · ⌘↵ to post

[Mayank Bansal](https://hashnode.com/@monk1)

[Jul 16](https://hashnode.com/posts/stop-committing-secrets-automatically-generate-env-example-with-gen-envex/6a57cd832a25ace6dd6c4bfa/comment/6a585802635bba76b8fbd2ed)

This is exactly the kind of thing runtime guardrails are for. I'm making Failproof AI, use policies to block access to sensitive files like .env before the agent ever gets to execute the read. It's completely open source just check out the repo of Failproof AI. Hit the star also if helpful :)
