FabricFabricExperiments
Reference

CLI reference

Common fx commands for local and hosted workflows.

The fx CLI is published as @fabricorg/experiments.

Install globally:

npm install -g @fabricorg/experiments
fx --version

Use it directly:

fx --help
fx validate experiments/
fx dev
fx plan experiments/
fx apply experiments/
fx push experiments/ --api-url https://api.example.com --api-key fx_key_... --tenant <orgId>
fx report homepage-cta
fx kill homepage-cta --reason "Web Vitals regression"

If you cannot install globally, run the same commands with npx @fabricorg/experiments.

Local workflow

Local mode uses .fx/ in your workspace:

fx validate experiments/
fx plan experiments/
fx apply experiments/
fx dev
  • fx plan compares YAML to .fx/store.json.
  • fx apply invokes local domain actions and writes .fx/manifest.json.
  • fx dev serves the local manifest and local exposure/conversion ingest endpoints.

Hosted push

Use fx push to reconcile local YAML into a hosted API organization:

fx push experiments/ \
  --api-url https://api.example.com \
  --api-key fx_key_... \
  --tenant <orgId>

fx push:

  1. validates local YAML using the shared @fabricorg/experiments-yaml parser,
  2. fetches hosted experiments for the target org,
  3. prints the same Terraform-style plan as local fx plan,
  4. invokes hosted domain actions,
  5. publishes the hosted manifest unless --no-publish is set.

Useful flags:

fx push experiments/ --dry-run
fx push experiments/ --allow-deletes
fx push experiments/ --no-publish

Environment variable equivalents:

export FX_API_URL=https://api.example.com
export FX_API_KEY=fx_key_...
export FX_ORG_ID=<orgId>
fx push experiments/

Create API keys in Studio at /app/{orgSlug}/settings.

Mojito-parity commands

# Migrate a directory of Mojito waves to Fabric YAML.
fx import-mojito ./waves --out ./experiments

# Mint a signed preview link for a variant. Local mode (default) signs with a
# per-workspace secret in .fx/preview-secret; pass --api-url + --api-key to
# sign via the hosted /v1/preview/sign endpoint instead.
fx preview hero-cta-color --variant green-action \
  --origin https://staging.example.com \
  --ttl 600

Preview tokens are bearer credentials in URLs. Default TTL is 900s; the server clamps to [60, 3600]. Pages that may receive preview links should set Referrer-Policy: no-referrer to prevent token leakage via the Referer header. See Migrating from Mojito for the end-to-end workflow.

On this page