product:env

Generate or merge .env files for the active product (and optionally its features).

Table of contents

  1. Development environment
    1. Generate .env for the product
    2. Generate .env for product and all features
    3. Merge feature variables into product .env
  2. Production environment
    1. Generate .env for the product
    2. Generate .env for product and features
    3. Merge feature variables into the product .env
  3. Requirements

Development environment

Used during local development.

Generate .env for the product

splent product:env --generate --dev

Creates:

<product>/docker/.env

From:

  • .env.dev.example (preferred)
  • .env.example

Generate .env for product and all features

splent product:env --generate --all --dev

This:

  1. Generates the product .env
  2. Generates .env for every declared feature

Internally calls:

splent feature:env <feature> --generate --dev

Merge feature variables into product .env

splent product:env --merge --dev

This command:

  • Loads the product .env
  • Reads .env files from all features
  • Adds missing variables to the product .env

Product variables are never overridden.


Production environment

Used for deployment environments.

Generate .env for the product

splent product:env --generate --prod

Creates:

<product>/docker/.env

From:

  • .env.prod.example (preferred)
  • .env.example

Generate .env for product and features

splent product:env --generate --all --prod

Generates .env for:

  • the product
  • every declared feature

Merge feature variables into the product .env

splent product:env --merge --prod

The merge process:

  1. Uses the product .env as the base
  2. Reads .env files from features
  3. Adds missing keys to the product .env

Existing product variables remain unchanged.


Requirements

  • A product must be selected:
splent product:select <product>
  • The product must contain:
pyproject.toml
docker/