Add your description here
Project description
generate-env-sample
A simple CLI tool to generate .env.sample files from existing .env files. This tool reads your .env file, preserves comments and empty lines, and creates a sample file with keys but without values.
Features
- Preserves comments and empty lines from the original
.envfile. - Generates a clean
.env.samplewith keys set to empty values. - Built with Python and Typer.
Installation
Prerequisites
- Python 3.11 or higher
Install from Source
-
Clone the repository:
git clone https://github.com/heshinth/generate-env-sample.git cd generate-env-sample
-
Install dependencies using
uv(recommended):uv syncOr using pip:
pip install -e .
Usage
Run the tool from the command line:
generate-env-sample
Options
--file-name: Specify the.envfile to read from (default:.env)--sample-name: Specify the output.env.samplefile (default:.env.sample)
Examples
-
Generate
.env.samplefrom the default.env:generate-env-sample
-
Use a custom
.envfile:generate-env-sample --file-name myenv.env --sample-name myenv.sample
-
Get help:
generate-env-sample --help
Example Input/Output
Given a .env file like:
# Database configuration
DB_HOST=localhost
DB_PORT=5432
# API keys
API_KEY=your_secret_key
The generated .env.sample will be:
# Database configuration
DB_HOST=
DB_PORT=
# API keys
API_KEY=
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file generate_env_sample-0.0.1.tar.gz.
File metadata
- Download URL: generate_env_sample-0.0.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
882f2238383845c0d70c5aefd9d619f6d8e23c086e681ea4574e37bf76f537ca
|
|
| MD5 |
4c0e949e1ac2bd24207abc32892c9495
|
|
| BLAKE2b-256 |
cb9188a9570a26a5f41cc7fa2be1b39c260e964b99c35aeedb7dad53c53a7dd8
|
File details
Details for the file generate_env_sample-0.0.1-py3-none-any.whl.
File metadata
- Download URL: generate_env_sample-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49d30ba916e07be59bcff2e50fae152e7d6bd3e99525ada096135cea75826e3b
|
|
| MD5 |
d8085b443f0015e7d6868e5aec4c5cb6
|
|
| BLAKE2b-256 |
a8d0423c0ecdfab3acd5f97642de0c6b777988219302d20dafb400a691c1d60c
|