Skip to content

Generated project commands ​

Run these commands from the root of a generated project after pnpm install.

Development ​

CommandWhat it does
pnpm start 0Watch variation 1 (src/js/v1/). Rebuilds on save and copies IIFE bundle to clipboard.
pnpm start 1Watch variation 2 (src/js/v2/). Clipboard copy enabled.
pnpm start NWatch the variation at zero-based discovered order. Numeric vN folders come first, then named folders such as control.
pnpm devWatch all variations simultaneously. No clipboard copy.

Build ​

CommandWhat it does
pnpm buildProduction build. Runs Biome lint first. Builds all variations to dist/. Aborts on lint errors.
pnpm liveOpens targetUrl, watches the selected bundle, and injects it into the page.
pnpm new-variation NCreates src/js/vN/index.jsx from v1.
pnpm new-variation controlCreates src/js/control/index.jsx from v1.

To generate an impression-only control at project creation time, pass --control to the package CLI:

bash
npx @sogody/experiment-framework my-experiment --control

Unlike pnpm new-variation control, the generator flag creates an entry that observes the native page and does not copy the variant UI.

The build writes:

dist/
├── v1-index.jsx   ← IIFE bundle for variation 1
├── v2-index.jsx   ← IIFE bundle for variation 2
├── vN-index.jsx
└── control-index.jsx

Linting ​

CommandWhat it does
pnpm lintRuns biome check src. Reports violations without writing files.
pnpm formatRuns biome check --write src. Formats files and applies safe fixes.

Live injection options ​

bash
pnpm live -- --variation v2
pnpm live -- --variation control
pnpm live -- --url https://www.samsung.com/de/
pnpm live -- --overlay hidden
pnpm live -- --profile shared

CLI flags override the matching values in experiment.config.js. --variation accepts a zero-based index or a discovered folder name such as v2 or control.

Testing ​

CommandWhat it doesAvailable
pnpm test:e2eRuns Playwright tests in e2e/.Only when E2E was enabled at scaffold time

AI project support ​

New projects already contain tracked AGENTS.md and CLAUDE.md files. After upgrading an older project to 2.2.0, create or refresh them with the package binaries:

bash
pnpm exec exp-init-agents
pnpm exec exp-init-claude

exp-init-agents updates only the framework-managed block when it finds valid markers. Add --force to replace an unmarked file intentionally. exp-init-claude still refuses an existing file unless you pass --force.

See AI Project Support for the version-matched documentation flow.

Notes ​

  • pnpm build aborts on lint errors.
  • Watch commands block an invalid bundle but keep the watcher running for the next save.
  • All commands require Node 20.19+ and pnpm >=10.26.0. Run nvm use first so the generated .nvmrc selects the project Node version. pnpm 11 requires Node 22 or newer.

Internal tool - Samsung / Sogody experimentation team

Help improve the frameworkShare an idea or friction you encountered.Share framework feedback(opens in a new tab)