Installation
Create a new experiment
Run the create command with your project name:
npx create-experiment my-experimentThe CLI guides you through a series of prompts, then generates a complete project, installs dependencies, and optionally runs Playwright setup and a smoke test.
CLI prompts
| Prompt | Default | What it controls |
|---|---|---|
| Select boilerplate | minimal | Which template to use. minimal generates a button with no API integration. product-card includes Samsung product API helpers and a Preact card. |
| Number of variations | 1 | Generates src/js/v1/ through src/js/vN/. Pick 2 for A/B, 3 for A/B/C. |
| Window namespace | sgd | The IIFE output name on window (e.g. window.sgd). Must be a valid JS identifier. Keep the default unless it conflicts with another experiment on the same page. |
| Include emergency brake | true | Records includeEmergencyBrake in experiment.config.js. The current build/runtime does not consume this field, so verify the deployment integration before relying on it. |
| Enable E2E testing | false | Generates e2e/, playwright.config.js, and wires up pnpm test:e2e. Enable if you have a stable preview URL to test against. |
| Base URL (E2E only) | https://samsung.com | The root URL for Playwright tests. |
| Market (E2E only) | - | Selects which Samsung market(s) to parametrise tests against. See the Markets reference. |
| Run smoke test (E2E only) | false | Runs pnpm build and pnpm test:e2e immediately after setup. |
After scaffolding
The CLI prints the next steps. Start developing immediately:
cd my-experiment
# Watch variation 1 - rebuilds on save and copies IIFE to clipboard
pnpm start 0Open Adobe Target, navigate to your experiment's custom code editor, and paste. That's the full inner loop.
Optional: create AI documentation
Generated projects do not include AI instruction files automatically. From the project root, create the file used by your tooling:
pnpm init-claude
pnpm init-agentsThese commands create CLAUDE.md and AGENTS.md, respectively. They infer the experiment name, boilerplate type, and E2E setup from the scaffolded project.
Choosing a boilerplate
Use product-card when your experiment displays Samsung product data (image, price, CTA). Use minimal for layout tests, copy changes, or anything that doesn't need the Samsung product API.
Existing directories
If the destination directory already exists and is not empty, the CLI asks before continuing. It does not remove unrelated files from that directory.