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 --versionUse 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 devfx plancompares YAML to.fx/store.json.fx applyinvokes local domain actions and writes.fx/manifest.json.fx devserves 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:
- validates local YAML using the shared
@fabricorg/experiments-yamlparser, - fetches hosted experiments for the target org,
- prints the same Terraform-style plan as local
fx plan, - invokes hosted domain actions,
- publishes the hosted manifest unless
--no-publishis set.
Useful flags:
fx push experiments/ --dry-run
fx push experiments/ --allow-deletes
fx push experiments/ --no-publishEnvironment 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 600Preview 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.