spl:add-feature
Add a feature to an SPL with auto-detected dependency constraints.
Usage
splent spl:add-feature <spl_name> <feature_package> [--org ORG]
Requires detached mode (no product selected).
Options
| Option | Default | Description |
|---|---|---|
--org |
splent-io |
Feature organization |
How it works
- Scans the feature’s source code for dependencies:
- Foreign keys:
db.ForeignKey("user.id")→ looks up which feature owns theusertable - Python imports:
from splent_io.splent_feature_auth import ... - Template references:
url_for('auth.login')in.htmlfiles
- Foreign keys:
-
Shows detected constraints and asks for confirmation.
- Writes to the UVL file:
- Adds the feature declaration with
{org, package}attributes - Adds detected constraints (e.g.,
notes => auth)
- Adds the feature declaration with
Example
$ splent spl:add-feature sample_splent_spl splent_feature_notes
Adding notes to sample_splent_spl
Scanning for dependencies...
Detected dependencies:
notes => auth
Add 'notes' to sample_splent_spl? [Y/n]: y
✅ Feature 'notes' added to sample_splent_spl.
Constraints: notes => auth
See also
- spl:add-constraints — add missing constraints between features already in the SPL
- spl:features — list all features in the SPL
- spl:deps — show feature dependencies