Featurevisor

Tools

CLI

Use the Featurevisor CLI to set up a project, validate definitions, build datafiles and investigate evaluation results.

Commands below use the buyButton feature with its label variable and variations, and the supportEmail global variable, both from the Variables guide. Substitute keys and context from your project when using these commands elsewhere.

Command overview

TaskCommandPurpose
Set upinitCreate a project in an empty directory.
Set upconfigPrint the resolved project configuration.
Set uphelpShow commands and their options.
Set upversionPrint CLI and package versions.
ValidatelintCheck definitions and test specifications.
ValidatefmtFormat definitions and test specs in one house style.
ValidatetestRun feature, segment, variable and scenario tests.
BuildbuildGenerate JSON datafiles for targets and environments.
Buildgenerate-codeGenerate typed TypeScript APIs from definitions.
InspectcatalogBrowse locally, export or serve a Catalog.
InspectlistList definitions, datafiles and tests.
InspectinfoSummarize project counts and selected datafile sizes.
Inspectfind-duplicate-segmentsFind segments with identical conditions.
Inspectfind-usageTrace references and find unused definitions.
EvaluateevaluateEvaluate a feature or variable for a context.
EvaluatebenchmarkMeasure local evaluation performance.
Evaluateassess-distributionSimulate rollout and variation distribution.
ComparediffCompare definitions between Git references or the working tree.
PromotepromotePreview or apply definition changes between sets.
ConvertconvertChange a project between environments, sets and neither.
UpgrademigrateRewrite a v3 project's definitions for v4.

Commands

assess-distribution

Simulate many users with a supplied context to inspect a feature's rollout and variation distribution:

Command
npx featurevisor assess-distribution \
--feature=buyButton \
--context='{"country": "nl"}' \
--populate-uuid=userId \
--n=1000

For 1,000 Dutch users, buyButton comes out close to its 50/50 split:

Output, trimmed
Flag evaluations
• enabled: 1,000 100.00%
• disabled: 0 0.00%
Variation evaluations
• treatment: 504 50.40%
• control: 496 49.60%

Each run draws new IDs, so the counts vary a little. Use it to check a split before an experiment starts, or after changing its weights.

Set --n to the number of iterations. Use --populate-uuid to simulate a different user in each iteration.

The iteration count must be a positive integer, and --context must contain a JSON object.

Options: