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#
| Task | Command | Purpose |
|---|---|---|
| Set up | init | Create a project in an empty directory. |
| Set up | config | Print the resolved project configuration. |
| Set up | help | Show commands and their options. |
| Set up | version | Print CLI and package versions. |
| Validate | lint | Check definitions and test specifications. |
| Validate | fmt | Format definitions and test specs in one house style. |
| Validate | test | Run feature, segment, variable and scenario tests. |
| Build | build | Generate JSON datafiles for targets and environments. |
| Build | generate-code | Generate typed TypeScript APIs from definitions. |
| Inspect | catalog | Browse locally, export or serve a Catalog. |
| Inspect | list | List definitions, datafiles and tests. |
| Inspect | info | Summarize project counts and selected datafile sizes. |
| Inspect | find-duplicate-segments | Find segments with identical conditions. |
| Inspect | find-usage | Trace references and find unused definitions. |
| Evaluate | evaluate | Evaluate a feature or variable for a context. |
| Evaluate | benchmark | Measure local evaluation performance. |
| Evaluate | assess-distribution | Simulate rollout and variation distribution. |
| Compare | diff | Compare definitions between Git references or the working tree. |
| Promote | promote | Preview or apply definition changes between sets. |
| Convert | convert | Change a project between environments, sets and neither. |
| Upgrade | migrate | Rewrite 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:
npx featurevisor assess-distribution \ --feature=buyButton \ --context='{"country": "nl"}' \ --populate-uuid=userId \ --n=1000For 1,000 Dutch users, buyButton comes out close to its 50/50 split:
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:

