Skip to main content

EnvStencil

Gere um .env.example seguro a partir do seu .env, automaticamente.

📖 Documentação completa

EnvStencil

Documentation Status CI codecov

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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envstencil 0.1.0
File Size Uploaded
envstencil-0.1.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for envstencil 0.1.0
File Interpreter ABI Platform
envstencil-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / envstencil-0.1.0.tar.gz

Download URL envstencil-0.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f682e20ffd45ad3c52aad43d55d66f3526ae92c706516183eecc65469e1c2a82
BLAKE2b-256 checksum
How to use checksums
3110f7ffdedb9aa97b9452db22d8b15dc62066dce26c14dc2a6af43b0532c71e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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

Release files / envstencil-0.1.0-py3-none-any.whl

Download URL envstencil-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0856b16a6af135c5415e6415a3fd5fcfe8669e762733c140656691f309706f02
BLAKE2b-256 checksum
How to use checksums
35e9645647bc05c77e22cd65c6c8871631e7afb0fd3ec99ce4f92cd64888687c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page