feature:add
Add a local (non-versioned) editable feature from the workspace root to the active product.
Usage
splent feature:add <namespace>/<feature_name> [--dev | --prod]
| Option | Description |
|---|---|
--dev |
Add to features_dev (development only). |
--prod |
Add to features_prod (production only). |
If neither --dev nor --prod is given, the command auto-detects the scope from the feature’s contract. When [tool.splent.contract].env is set in the feature’s pyproject.toml (e.g. env = "dev"), the feature is automatically added to the corresponding features_dev or features_prod list. If no contract env is declared, the feature is added to features (all environments).
Examples
Add a feature to all environments:
splent feature:add splent-io/splent_feature_auth
Explicitly add to dev only:
splent feature:add splent-io/splent_feature_admin --dev
Auto-detection from contract (feature declares env = "dev"):
$ splent feature:add splent-io/splent_feature_admin
scope contract declares env=dev → features_dev
admin added to features_dev (dev only)
done.
Description
This command:
- Validates the
<namespace>/<feature_name>format. - Checks that the feature exists at the workspace root (
/workspace/<feature_name>/). - Auto-detects the environment scope from
[tool.splent.contract].envin the feature’spyproject.toml(unless--devor--prodis explicitly passed). - Adds the feature to the appropriate list (
features,features_dev, orfeatures_prod) in the product’spyproject.toml. - Creates a symlink at
<product>/features/<namespace>/<feature_name>pointing to the workspace root. - Records the feature in
splent.manifest.jsonwith statedeclaredand modeeditable. - Reinstalls the feature via
pip install -ein the web container and triggers Flask reload.
The running application picks up the new feature automatically — no restart or product:derive needed.
Requirements
- A product must be selected (
splent product:select). - The feature must already exist at the workspace root. Use
splent feature:createfirst if needed. SPLENT_APPmust be set.
Result
<product>/features/<namespace>/<feature_name> → ../../../<feature_name> (workspace root)
State in splent.manifest.json: declared, mode: editable
See also
feature:attach— add a versioned (pinned) release insteadfeature:remove— undo this operationfeature:status— verify the feature stateproduct:resolve— re-sync all symlinks