product:env
Generate or merge .env files for the active product (and optionally its features).
Table of contents
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:
- Generates the product
.env - Generates
.envfor 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 - Forces
SPLENT_ENVto match the target environment (devorprod) - Reads
.envfiles from all features - Resolves
__FEATURE_HOST_DIR__placeholders in each feature’s.envfile to the real host path (so Docker Compose bind mounts work correctly) - Adds missing variables to the product
.env - Resolves
__PRODUCT__placeholders in the merged output to the actual product name
Product variables (other than SPLENT_ENV) 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:
- Uses the product
.envas the base - Forces
SPLENT_ENV=prodin the merged output - Reads
.envfiles from features - Resolves
__FEATURE_HOST_DIR__in each feature’s.envto the real host path - Adds missing keys to the product
.env - Resolves
__PRODUCT__placeholders to the actual product name - Adjusts feature port variables to avoid collisions (see below)
Existing product variables (other than SPLENT_ENV) remain unchanged.
Port offset (automatic port adjustment)
When merging feature .env files, SPLENT adds a product-specific offset to port variables to prevent collisions between multiple products running on the same host.
For full details, examples, and rules for feature authors, see Port offset.
Requirements
- A product must be selected:
splent product:select <product>
- The product must contain:
pyproject.toml
docker/