Gere um .env.example seguro a partir do seu .env, automaticamente.
📖 Documentação completa · Changelog
EnvStencil
Sempre quando estamos desenvolvendo, é comum a gente criar um arquivo .env com as variáveis de ambiente necessárias e depois ter de gerar um arquivo .env.example para que outros desenvolvedores possam criar o seu próprio .env a partir dele.
O problema é que essa é uma tarefa muito chata e repetitiva, então o envstencil foi criado para automatizar esse processo.
Caso o arquivo .env contenha variáveis que não precisam ser sobrescritas no .env.example, você pode adicionar o comentário # envstencil:keep na linha da variável que deseja manter ou na linha anterior.
Instalação
pip — do PyPI ou direto do git:
pip install envstencil
pip install git+https://github.com/kylefelipe/env-stencil.git
Poetry — adiciona envstencil como dependência do seu projeto:
poetry add envstencil
poetry add git+https://github.com/kylefelipe/env-stencil.git
Com o repositório já clonado: pip install . (ou poetry install).
Uso
# Gera .env.example a partir de .env no diretório atual
envstencil generate
# Especificar arquivo de origem e destino
envstencil generate .env.production -o .env.production.example
# Ou, gerando a partir do .env padrão
envstencil generate -o .env.production.example
# Placeholder customizado
envstencil generate --placeholder "CHANGE_ME"
# Sobrescrever arquivo existente
envstencil generate --force
Exemplo
Entrada (.env):
# Banco de dados
DATABASE_URL=postgres://user:pass@localhost:5432/mydb
STRIPE_SECRET_KEY=sk_live_abc123
Saída (.env.example):
# Banco de dados
DATABASE_URL=your_value_here
STRIPE_SECRET_KEY=your_value_here
Desenvolvimento
Requer Poetry 2.0+. Os grupos dev e doc são opcionais — poetry install
sozinho instala só o runtime:
poetry install --with dev,doc
Tarefas, convenções e fluxo de PR: Contribuindo.
Release files for envstencil 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| envstencil-0.2.0.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envstencil-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.9 kB
Release files / envstencil-0.2.0.tar.gz
| Download URL | envstencil-0.2.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e99dba67d46db35f572ce2efc4aafc4a8318ece03c61c002e0819e3f53e731c4
|
|
BLAKE2b-256 checksum How to use checksums |
aecad32fe448dae0a9d4ce304b6e0949402d3f6b09d75fba01d8e235a4e45f87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / envstencil-0.2.0-py3-none-any.whl
| Download URL | envstencil-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b81d66d7b67414cf87a4210cafaeb506356cbde1e1ecdef6e148ab0213cf9cd
|
|
BLAKE2b-256 checksum How to use checksums |
4cb02bb9c1f855ed082450ee6a1fde750ea9d0d34004992a1f0fde1fcce47c63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency log