Developer

Experiment lifecycle commands

Create, list, inspect, read results, start, pause, complete, and delete Apex experiments from the CLI.

The experiments group covers experiment CRUD and lifecycle actions. Use IDs or slugs for reads and lifecycle commands. The alias apex exp is available for the group, and apex experiments list also has the ls alias.

List and inspect

bash
apex experiments list --status draft --limit 20
apex experiments get homepage-hero-test
apex experiments results homepage-hero-test --currency EUR
CommandArgumentsFlagsNotes
apex experiments listNone--status <status>, --limit <n>Status filter accepts draft, running, paused, or completed values.
apex experiments get<id-or-slug>None beyond global flagsA plain slug and slug:<slug> both resolve by slug.
apex experiments results<id-or-slug>--currency <code>Returns experiment totals, arms, decision, metrics, series, and warnings when the API provides them.

Use JSON mode for scripts:

bash
apex experiments results homepage-hero-test --currency EUR --json

Create a draft

bash
apex experiments create \
  --name "Homepage hero trust copy" \
  --slug homepage-hero-trust-copy \
  --description "Tests clearer proof copy in the homepage hero." \
  --traffic 25
FlagRequiredBehavior
--name <name>YesExperiment display name.
--slug <slug>NoURL-safe slug for GitOps and slug-based lookup.
--description <desc>NoDraft description.
--traffic <pct>NoPercentage input converted to API traffic allocation. Defaults to 100.

The command creates the experiment through the API. Configure variations, metrics, targeting, and QA before starting traffic.

Lifecycle verbs

bash
apex experiments start homepage-hero-trust-copy
apex experiments pause homepage-hero-trust-copy
apex experiments complete homepage-hero-trust-copy
CommandArgumentsBehavior
apex experiments start<id-or-slug>Requests the API to move the experiment to running.
apex experiments pause<id-or-slug>Requests the API to pause a running experiment.
apex experiments complete<id-or-slug>Requests the API to complete or stop the experiment.

Lifecycle validation is owned by Apex. If the API rejects a state transition, the CLI reports the API error and exits non-zero.

Delete

bash
apex experiments delete homepage-hero-trust-copy
apex experiments delete homepage-hero-trust-copy --force --json

apex experiments delete prompts before deleting in an interactive terminal. In non-TTY mode, deletion returns confirmation-required exit code 4 unless you pass --force.

What the CLI does not launch

The CLI can request lifecycle transitions exposed by the API, but the Apex launch workflow still relies on dashboard-owned approval and readiness gates. Do not use CLI lifecycle commands to bypass QA or business approval.

Troubleshooting

  • Experiment not found: check whether you passed an ID, slug, or slug:<slug>.
  • Lifecycle action rejected: inspect the API error in JSON mode for readiness, status, or permission details.
  • Delete fails in automation: rerun with --force only after confirming the target experiment.