product:create

Create a new product inside the workspace with a complete scaffold.


Usage

splent product:create <product_name>

Example

splent product:create sample_splent_app

The product name must be unique inside the workspace and must be a valid Python identifier (lowercase, underscores).

If the CRC32-based port generation produces ports that collide with an existing product in the workspace, a warning is displayed. Review the generated Docker files and adjust ports if needed.


Description

Generates a fully scaffolded product from official Jinja templates. No manual setup is required.

The template context includes a network_name variable (default: splent_network) used in generated Compose files.

During creation, the command prompts you to select an SPL from the catalog. If the UVL model is not yet downloaded, it is fetched automatically from UVLHub.

After creation, the product has no features — configure them with product:configure, or add them individually with feature:attach or feature:add.


Generated structure

<workspace>/
└── <product_name>/
    ├── docker/
    │   ├── .env.dev.example
    │   ├── .env.prod.example
    │   ├── docker-compose.dev.yml
    │   ├── docker-compose.prod.yml
    │   ├── Dockerfile.<product_name>.dev
    │   └── Dockerfile.<product_name>.prod
    ├── entrypoints/
    │   ├── entrypoint.dev.sh
    │   └── entrypoint.prod.sh
    ├── scripts/
    │   ├── 00_core_requirements_dev.sh
    │   ├── 00_install_features.sh
    │   ├── 01_compile_assets.sh
    │   ├── 02_0_db_wait_connection.sh
    │   ├── 02_1_db_create_db_test.sh
    │   ├── 02_2_db_create_splent_migrations.sh
    │   ├── 03_initialize_migrations.sh
    │   ├── 04_handle_migrations.sh
    │   ├── 05_0_start_app_dev.sh
    │   └── 05_1_start_app_prod.sh
    ├── uvl/
    │   └── <product_name>.uvl          ← UVL variability model scaffold
    ├── src/
    │   └── <product_name>/
    │       ├── __init__.py
    │       ├── config.py
    │       ├── errors.py
    │       ├── logging.py
    │       ├── static/
    │       └── templates/
    ├── pyproject.toml
    ├── package.json
    ├── .gitignore
    ├── LICENSE
    └── README.md

Key generated files

pyproject.toml — product metadata

[project]
name = "<product_name>"
version = "0.0.1"
requires-python = ">=3.13"

[tool.splent]
spl = "<spl_name>"
features = []

The spl field references the SPL from the catalog. Features are populated via product:configure or manually with feature:attach / feature:add.

Startup scripts

The startup pipeline runs in numbered order:

Script Purpose
00_core_requirements_dev.sh Install core Python dependencies
00_install_features.sh Pip-install all declared features → state: installed
01_compile_assets.sh Build frontend assets (Webpack)
02_0_db_wait_connection.sh Wait for MariaDB to be ready
02_1_db_create_db_test.sh Create the test database
02_2_db_create_splent_migrations.sh Create the splent_migrations tracking table
03_initialize_migrations.sh Run splent db:migrate (generate migration files)
04_handle_migrations.sh Run splent db:upgrade → state: migrated
05_0_start_app_dev.sh Start Flask dev server → state: active

Requirements

  • A valid workspace must exist.
  • The command must be executed inside the SPLENT CLI environment.

Next steps after creation

splent product:select <product_name>
splent product:configure
splent product:derive --dev

See the Tutorials for the complete walkthrough.


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es