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
# Adiciona apenas variáveis ausentes ao .env.example existente
envstencil generate --append
# Verifica se .env e .env.example têm as mesmas variáveis
envstencil check
# Mostra quais variáveis estão divergentes
envstencil check --diff
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.
Metadata
Release files for envstencil 0.3.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 | Provenance | Actions |
|---|---|---|---|---|
| envstencil-0.3.0.tar.gz | 13.1 kB | With provenance | Details for envstencil-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| envstencil-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for envstencil-0.3.0-py3-none-any.whl |
Total release size: 26.0 kB
Release files / envstencil-0.3.0.tar.gz
| Download URL | envstencil-0.3.0.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb7c8fd3edf23193e907f5cd9bd89b8efbb1317c6e789164c589ddf67bd6f7f9
|
|
BLAKE2b-256 checksum How to use checksums |
cbdbbd0d874d1f4c2fc00f9a686638f83c097df795488a2d6743978ab73cdb32
|
| 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 Sep 2, 2026.
Transparency logRelease files / envstencil-0.3.0-py3-none-any.whl
| Download URL | envstencil-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f62cb0bfe875efe6ae9559b5fdea8059b9db7704bd8a5f1d9931439d54f9699f
|
|
BLAKE2b-256 checksum How to use checksums |
82af7a0d982a651c820c837466b512e0cbd40c2572cd80d59752270188460bf9
|
| 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 Sep 2, 2026.
Transparency logSecurity for envstencil 0.3.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for envstencil-0.3.0.tar.gz
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 Sep 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.