motionpr init

Create motionpr.config.ts (and optionally a GitHub Actions workflow) with a guided setup.

On this page
  1. Examples
Shell
npx motionpr init [options]

Creates a commented motionpr.config.ts (.mjs in projects without TypeScript) and .motionpr/.gitignore. It detects the framework, the dev command, the package manager and the animation engines in package.json. What it detects and writes is described in Project initialization.

OptionDescription
-y, --yesUse the detected defaults without prompting
--forceReplace an existing config
--base-url <url>URL of the app under test
--command <cmd> / --no-commandCommand that starts the app / configure no web server
--githubAlso write .github/workflows/motionpr.yml (actions pinned to commit SHAs)
--no-exampleDo not add an example scenario

Existing files are never overwritten without confirmation (or --force).

Examples

Shell
npx motionpr init                                         # guided
npx motionpr init --yes --github                          # defaults + CI workflow
npx motionpr init --base-url http://localhost:8080 --command "npm start"

The workflow --github writes is shown in GitHub Actions.