Skip to main content

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 .env file.
  • Generates a clean .env.sample with keys set to empty values.
  • Built with Python and Typer.

Installation

Prerequisites

  • Python 3.11 or higher

Install from Source

  1. Clone the repository:

    git clone https://github.com/heshinth/generate-env-sample.git
    cd generate-env-sample
    
  2. Install dependencies using uv (recommended):

    uv sync
    

    Or using pip:

    pip install -e .
    

Usage

Run the tool from the command line:

generate-env-sample

Options

  • --file-name: Specify the .env file to read from (default: .env)
  • --sample-name: Specify the output .env.sample file (default: .env.sample)

Examples

  1. Generate .env.sample from the default .env:

    generate-env-sample
    
  2. Use a custom .env file:

    generate-env-sample --file-name myenv.env --sample-name myenv.sample
    
  3. 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

generate_env_sample-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

generate_env_sample-0.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

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

Hashes for generate_env_sample-0.0.1.tar.gz
Algorithm Hash digest
SHA256 882f2238383845c0d70c5aefd9d619f6d8e23c086e681ea4574e37bf76f537ca
MD5 4c0e949e1ac2bd24207abc32892c9495
BLAKE2b-256 cb9188a9570a26a5f41cc7fa2be1b39c260e964b99c35aeedb7dad53c53a7dd8

See more details on using hashes here.

File details

Details for the file generate_env_sample-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for generate_env_sample-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49d30ba916e07be59bcff2e50fae152e7d6bd3e99525ada096135cea75826e3b
MD5 d8085b443f0015e7d6868e5aec4c5cb6
BLAKE2b-256 a8d0423c0ecdfab3acd5f97642de0c6b777988219302d20dafb400a691c1d60c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page