Configure Environment Files
Overview
CLI Python scripts for configuring environment files for a various software and web applications available on the PyPi repository.
configure-env reads a project's .env.example template and walks you through
an interactive wizard to create or update the matching .env file:
- Shows each field's description and section headers, taken straight from the template's own comments.
- Prefills from an existing
.env, if one is already there — press Enter to keep a value, or type a new one. - Offers to auto-generate a value for any field whose comment documents a
generation command (e.g.
secrets.token_hex(32)), instead of making you copy-paste a separate command. - Masks input for fields that look like secrets (name contains
KEY,SECRET,TOKEN, orPASSWORD). - Backs up an existing
.envto.env.bakbefore overwriting it, and preserves any keys already in.envthat aren't in.env.exampleinstead of silently dropping them.
Getting Started
Prerequisites
- Python 3.10+
Installation
From PyPI (once published):
pip install configure-env
From GitHub, before the first PyPI release:
pip install git+https://github.com/RichardMcQuiston01/configure-env-py.git
Usage
configure-env [directory]
directory defaults to the current directory. configure-env looks for
<directory>/.env.example there and writes/updates <directory>/.env.
Examples
Run from a project root that already contains .env.example:
$ configure-env
Application
-----------
APP_ENV [development]:
...
Security
--------
Generate a strong key: python -c "import secrets; print(secrets.token_hex(32))"
API_KEY - generate a secure random value automatically? [Y/n]:
generated API_KEY (shown once, also saved to .env): 3f1c9c...
...
wrote .env
Target a different directory:
configure-env ../some-other-project
Development
python -m venv .venv
.venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
pip install -e ".[dev]"
pytest
ruff check .
mypy src
License
Apache 2.0 — see LICENSE.
Support
If this library saved you some reverse-engineering, consider buying me a coffee. ☕
Donate via Stripe, or scan:
Copyright
(c) 2026 Richard McQuiston. Licensed under the Apache License, Version 2.0 — see COPYRIGHT.
Metadata
Release files for configure-env 0.1.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 | |
|---|---|---|---|
| configure_env-0.1.0.tar.gz | 14.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| configure_env-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.8 kB
Release files / configure_env-0.1.0.tar.gz
| Download URL | configure_env-0.1.0.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5904ea27c8710cf91d013fe6dcb42e63c9468c7443532b6a243e0d69f008589
|
|
BLAKE2b-256 checksum How to use checksums |
f09038b00396c454f25458dd98a0ebb94da70c5486cc31289fb61d5dd6e647ee
|
| 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 23, 2026.
Transparency logRelease files / configure_env-0.1.0-py3-none-any.whl
| Download URL | configure_env-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1a2aa8ae4c7236feb6b7962c1dad3a35d65a654bb1d65cfd521a0364629e815
|
|
BLAKE2b-256 checksum How to use checksums |
90f0a03a958962f5e0bd30615fe17f0cb626dd90f068b52a500c006f9d4588a6
|
| 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 23, 2026.
Transparency log