CLI

Variants

Run A/B experiments on a string key from the CLI: create an experiment, set variant texts, split traffic, start/stop, and promote a winner into the base string.

The variants command family manages an experiment attached to one string key. An experiment holds a text value per variant plus a traffic allocation across variants. When a variant is selected it overrides the base value for that key; everywhere else the base value is served unchanged. See String Variants for how selection, bucketing, exposure, and signing work.

airstrings variants <create|set|allocation|start|stop|rm|rm-variant|status|promote> <key> [args]

Mutations edit the draft experiment. Nothing reaches the CDN until you publish. A normal flow is createset texts → allocationstartairstrings publish.

Commands

CommandEffect
variants create <key>Create an experiment on the key. Starts with control at 100%.
variants set <key> <variant> <locale>=<value>...Set a variant's text for one or more locales. Text only. A new variant is added to the allocation at 0%.
variants allocation <key> <variant>=<pct>...Set the traffic split. Weights are non-negative integers that must sum to 100.
variants start <key>Start the experiment.
variants stop <key>Stop the experiment. The CDN is unchanged until the next publish.
variants status <key>Show the experiment. A missing experiment exits 4.
variants rm <key>Delete the experiment.
variants rm-variant <key> <variant>Remove one non-control variant. Its allocation is redistributed across the remaining arms.
variants promote <key> <variant>Promote a variant's value into the base string and republish.

Example

Run a 50/50 experiment on checkout.cta, then check it:

airstrings variants create checkout.cta
airstrings variants set checkout.cta variant_a en="Buy now" de="Jetzt kaufen"
airstrings variants allocation checkout.cta control=50 variant_a=50
airstrings variants start checkout.cta
airstrings publish
airstrings variants status checkout.cta

create seeds control at 100%. set adds variant_a at 0%, so allocation is what splits the traffic. start marks the experiment live, and publish signs and ships it to the CDN. Until you publish, every step above only touches the draft.

variants promote is not airstrings promote

Two promote verbs, two different scopes. airstrings variants promote <key> <variant> bakes a winning variant's value into the base string for that key and republishes — you use it to end an experiment on the winner. airstrings promote promotes strings between environments (e.g. staging → production) and has nothing to do with experiments.

Rules

Enforced server-side when you define an experiment:

  • Variant names match ^[a-z0-9_]{1,64}$. control is reserved.
  • At most 10 variants per experiment.
  • Values are text onlyicu is rejected — and at most 10000 characters.

Protection

A variants operation against a sealed or protected production experiment returns 403 and exits 3 (auth), consistent with publish and import protection. Run it against an unsealed environment, or unseal from the dashboard first.

Exit codes

Branch on the exit code, not on message text (see the full table):

  • 3 — auth: the operation hit a sealed or protected production experiment.
  • 4 — not found: status on a key with no experiment.

SDKs

SDKs read the selected variant automatically once an assignment id is set — no code change per experiment. Selection is deterministic, stateless, and byte-identical across platforms.

On this page