Skip to content

Commit 0fd40d5

Browse files
feat: Add support to manage Experiments, Feature-Flags, Segments and Variations (Beta) (#1562)
* feat: Add support for Experiements, Feature-Flags, Segments and Variations (Beta) * Added docs and lint * Lint * docs update * Updated integration tests * lint * Updated integration test * Updated exp * Minor updates * Updated docs * feat: add status command for experiments and feature flags * feat: enhance segment rules and validation in CLI * refactor: remove debug option and simplify segment rules parsing --------- Co-authored-by: ramya18101 <anusriankisetty@gmail.com>
1 parent d6cbec7 commit 0fd40d5

54 files changed

Lines changed: 6995 additions & 3 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/auth0_experiments.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: default
3+
has_toc: false
4+
has_children: true
5+
---
6+
# auth0 experiments
7+
8+
Experiments run A/B tests by tying a feature flag, its variations, and traffic allocations together.
9+
10+
Typical workflow:
11+
1. Create a feature flag and its variations
12+
2. Optionally create segments for targeted allocation
13+
3. Create an experiment
14+
4. Validate it
15+
5. Start it
16+
17+
## Commands
18+
19+
- [auth0 experiments create](auth0_experiments_create.md) - Create a new experiment
20+
- [auth0 experiments delete](auth0_experiments_delete.md) - Delete an experiment
21+
- [auth0 experiments list](auth0_experiments_list.md) - List your experiments
22+
- [auth0 experiments show](auth0_experiments_show.md) - Show an experiment
23+
- [auth0 experiments status](auth0_experiments_status.md) - Change an experiment's status
24+
- [auth0 experiments update](auth0_experiments_update.md) - Update an experiment
25+
- [auth0 experiments validate](auth0_experiments_validate.md) - Validate an experiment
26+

docs/auth0_experiments_create.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
layout: default
3+
parent: auth0 experiments
4+
has_toc: false
5+
---
6+
# auth0 experiments create
7+
8+
Create a new experiment.
9+
10+
To create interactively, use `auth0 experiments create` with no flags.
11+
12+
To create non-interactively, supply all required flags.
13+
14+
## Usage
15+
```
16+
auth0 experiments create [flags]
17+
```
18+
19+
## Examples
20+
21+
```
22+
auth0 experiments create
23+
auth0 experiments create --name "button-color" --feature-flag-id ff_abc --authentication-flow login --allocation-strategy percentage --assignment-config '{"subject":"device"}' --allocations '[{"variation_id":"vid_1","weight":50,"is_control":true},{"variation_id":"vid_2","weight":50,"is_control":false}]'
24+
```
25+
26+
27+
## Flags
28+
29+
```
30+
-s, --allocation-strategy string Allocation strategy: percentage or segment.
31+
--allocations string JSON array of allocation items ({variation_id, weight, is_control} for percentage, where weight is an integer percentage from 1 to 100; {variation_id, segment_id, is_control} for segment).
32+
--assignment-config string JSON object configuring how users are assigned to variations (e.g. '{"subject":"device"}').
33+
-a, --authentication-flow string Authentication flow this experiment applies to (e.g. login, signup).
34+
-d, --description string Description of the experiment.
35+
-f, --feature-flag-id string ID of the feature flag to experiment on.
36+
--json Output in json format.
37+
--json-compact Output in compact json format.
38+
-n, --name string Name of the experiment.
39+
```
40+
41+
42+
## Inherited Flags
43+
44+
```
45+
--debug Enable debug mode.
46+
--no-color Disable colors.
47+
--no-input Disable interactivity.
48+
--tenant string Specific tenant to use.
49+
```
50+
51+
52+
## Related Commands
53+
54+
- [auth0 experiments create](auth0_experiments_create.md) - Create a new experiment
55+
- [auth0 experiments delete](auth0_experiments_delete.md) - Delete an experiment
56+
- [auth0 experiments list](auth0_experiments_list.md) - List your experiments
57+
- [auth0 experiments show](auth0_experiments_show.md) - Show an experiment
58+
- [auth0 experiments status](auth0_experiments_status.md) - Change an experiment's status
59+
- [auth0 experiments update](auth0_experiments_update.md) - Update an experiment
60+
- [auth0 experiments validate](auth0_experiments_validate.md) - Validate an experiment
61+
62+

docs/auth0_experiments_delete.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: default
3+
parent: auth0 experiments
4+
has_toc: false
5+
---
6+
# auth0 experiments delete
7+
8+
Delete an experiment.
9+
10+
Active experiments must be paused or completed before deleting.
11+
12+
To delete non-interactively, supply the experiment ID and use `--force` to skip confirmation.
13+
14+
## Usage
15+
```
16+
auth0 experiments delete [flags]
17+
```
18+
19+
## Examples
20+
21+
```
22+
auth0 experiments delete
23+
auth0 experiments delete <experiment-id>
24+
auth0 experiments delete <experiment-id> --force
25+
```
26+
27+
28+
## Flags
29+
30+
```
31+
--force Skip confirmation.
32+
```
33+
34+
35+
## Inherited Flags
36+
37+
```
38+
--debug Enable debug mode.
39+
--no-color Disable colors.
40+
--no-input Disable interactivity.
41+
--tenant string Specific tenant to use.
42+
```
43+
44+
45+
## Related Commands
46+
47+
- [auth0 experiments create](auth0_experiments_create.md) - Create a new experiment
48+
- [auth0 experiments delete](auth0_experiments_delete.md) - Delete an experiment
49+
- [auth0 experiments list](auth0_experiments_list.md) - List your experiments
50+
- [auth0 experiments show](auth0_experiments_show.md) - Show an experiment
51+
- [auth0 experiments status](auth0_experiments_status.md) - Change an experiment's status
52+
- [auth0 experiments update](auth0_experiments_update.md) - Update an experiment
53+
- [auth0 experiments validate](auth0_experiments_validate.md) - Validate an experiment
54+
55+

docs/auth0_experiments_list.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
layout: default
3+
parent: auth0 experiments
4+
has_toc: false
5+
---
6+
# auth0 experiments list
7+
8+
List all experiments. To create one, run: `auth0 experiments create`.
9+
10+
## Usage
11+
```
12+
auth0 experiments list [flags]
13+
```
14+
15+
## Examples
16+
17+
```
18+
auth0 experiments list
19+
auth0 experiments ls
20+
auth0 experiments list --json
21+
auth0 experiments list --status active
22+
auth0 experiments list --feature-flag-id <id>
23+
```
24+
25+
26+
## Flags
27+
28+
```
29+
--authentication-flow string Filter by authentication flow.
30+
--csv Output in csv format.
31+
--feature-flag-id string Filter by feature flag ID.
32+
--json Output in json format.
33+
--json-compact Output in compact json format.
34+
--status string Filter by status (draft, active, paused, completed, archived).
35+
```
36+
37+
38+
## Inherited Flags
39+
40+
```
41+
--debug Enable debug mode.
42+
--no-color Disable colors.
43+
--no-input Disable interactivity.
44+
--tenant string Specific tenant to use.
45+
```
46+
47+
48+
## Related Commands
49+
50+
- [auth0 experiments create](auth0_experiments_create.md) - Create a new experiment
51+
- [auth0 experiments delete](auth0_experiments_delete.md) - Delete an experiment
52+
- [auth0 experiments list](auth0_experiments_list.md) - List your experiments
53+
- [auth0 experiments show](auth0_experiments_show.md) - Show an experiment
54+
- [auth0 experiments status](auth0_experiments_status.md) - Change an experiment's status
55+
- [auth0 experiments update](auth0_experiments_update.md) - Update an experiment
56+
- [auth0 experiments validate](auth0_experiments_validate.md) - Validate an experiment
57+
58+

docs/auth0_experiments_show.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
layout: default
3+
parent: auth0 experiments
4+
has_toc: false
5+
---
6+
# auth0 experiments show
7+
8+
Display details about an experiment including its allocations and validation status.
9+
10+
## Usage
11+
```
12+
auth0 experiments show [flags]
13+
```
14+
15+
## Examples
16+
17+
```
18+
auth0 experiments show
19+
auth0 experiments show <experiment-id>
20+
auth0 experiments show <experiment-id> --json
21+
```
22+
23+
24+
## Flags
25+
26+
```
27+
--json Output in json format.
28+
--json-compact Output in compact json format.
29+
```
30+
31+
32+
## Inherited Flags
33+
34+
```
35+
--debug Enable debug mode.
36+
--no-color Disable colors.
37+
--no-input Disable interactivity.
38+
--tenant string Specific tenant to use.
39+
```
40+
41+
42+
## Related Commands
43+
44+
- [auth0 experiments create](auth0_experiments_create.md) - Create a new experiment
45+
- [auth0 experiments delete](auth0_experiments_delete.md) - Delete an experiment
46+
- [auth0 experiments list](auth0_experiments_list.md) - List your experiments
47+
- [auth0 experiments show](auth0_experiments_show.md) - Show an experiment
48+
- [auth0 experiments status](auth0_experiments_status.md) - Change an experiment's status
49+
- [auth0 experiments update](auth0_experiments_update.md) - Update an experiment
50+
- [auth0 experiments validate](auth0_experiments_validate.md) - Validate an experiment
51+
52+

docs/auth0_experiments_status.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
layout: default
3+
parent: auth0 experiments
4+
has_toc: false
5+
---
6+
# auth0 experiments status
7+
8+
Transition an experiment to a new lifecycle status: active, paused, completed, or archived.
9+
10+
• active — start (or resume) the experiment; runs full validation before activating
11+
• paused — pause a running experiment; it can be resumed by setting it active again
12+
• completed — mark the experiment as finished; it can then be archived
13+
• archived — archive a completed experiment
14+
15+
To set the status interactively, run `auth0 experiments status` with no arguments.
16+
17+
## Usage
18+
```
19+
auth0 experiments status [flags]
20+
```
21+
22+
## Examples
23+
24+
```
25+
auth0 experiments status
26+
auth0 experiments status <experiment-id>
27+
auth0 experiments status <experiment-id> active
28+
auth0 experiments status <experiment-id> paused
29+
```
30+
31+
32+
## Flags
33+
34+
```
35+
--json Output in json format.
36+
--json-compact Output in compact json format.
37+
```
38+
39+
40+
## Inherited Flags
41+
42+
```
43+
--debug Enable debug mode.
44+
--no-color Disable colors.
45+
--no-input Disable interactivity.
46+
--tenant string Specific tenant to use.
47+
```
48+
49+
50+
## Related Commands
51+
52+
- [auth0 experiments create](auth0_experiments_create.md) - Create a new experiment
53+
- [auth0 experiments delete](auth0_experiments_delete.md) - Delete an experiment
54+
- [auth0 experiments list](auth0_experiments_list.md) - List your experiments
55+
- [auth0 experiments show](auth0_experiments_show.md) - Show an experiment
56+
- [auth0 experiments status](auth0_experiments_status.md) - Change an experiment's status
57+
- [auth0 experiments update](auth0_experiments_update.md) - Update an experiment
58+
- [auth0 experiments validate](auth0_experiments_validate.md) - Validate an experiment
59+
60+

docs/auth0_experiments_update.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
layout: default
3+
parent: auth0 experiments
4+
has_toc: false
5+
---
6+
# auth0 experiments update
7+
8+
Update an experiment.
9+
10+
Note: feature flag, authentication flow, and allocation strategy cannot be changed after creation. To change an experiment's status, use `auth0 experiments status`.
11+
12+
To update interactively, use `auth0 experiments update` with no arguments.
13+
14+
## Usage
15+
```
16+
auth0 experiments update [flags]
17+
```
18+
19+
## Examples
20+
21+
```
22+
auth0 experiments update
23+
auth0 experiments update <experiment-id>
24+
auth0 experiments update <experiment-id> --name "new-name"
25+
auth0 experiments update <experiment-id> --assignment-config '{"subject":"device"}'
26+
auth0 experiments update <experiment-id> --allocations '[{"variation_id":"vid","weight":100,"is_control":true}]'
27+
```
28+
29+
30+
## Flags
31+
32+
```
33+
--allocations string JSON array of allocation items ({variation_id, weight, is_control} for percentage, where weight is an integer percentage from 1 to 100; {variation_id, segment_id, is_control} for segment).
34+
--assignment-config string JSON object configuring how users are assigned to variations (e.g. '{"subject":"device"}').
35+
-d, --description string Description of the experiment.
36+
--json Output in json format.
37+
--json-compact Output in compact json format.
38+
-n, --name string Name of the experiment.
39+
```
40+
41+
42+
## Inherited Flags
43+
44+
```
45+
--debug Enable debug mode.
46+
--no-color Disable colors.
47+
--no-input Disable interactivity.
48+
--tenant string Specific tenant to use.
49+
```
50+
51+
52+
## Related Commands
53+
54+
- [auth0 experiments create](auth0_experiments_create.md) - Create a new experiment
55+
- [auth0 experiments delete](auth0_experiments_delete.md) - Delete an experiment
56+
- [auth0 experiments list](auth0_experiments_list.md) - List your experiments
57+
- [auth0 experiments show](auth0_experiments_show.md) - Show an experiment
58+
- [auth0 experiments status](auth0_experiments_status.md) - Change an experiment's status
59+
- [auth0 experiments update](auth0_experiments_update.md) - Update an experiment
60+
- [auth0 experiments validate](auth0_experiments_validate.md) - Validate an experiment
61+
62+

0 commit comments

Comments
 (0)