CLI Reference
ci-setup
Generate CI/CD workflow files for automated visual regression testing.
The ci-setup command generates workflow configuration files for popular CI/CD providers.
Usage
npx ui-inspect ci-setup [options]Options
| Flag | Type | Default | Description |
|---|---|---|---|
--provider <name> | string | — | CI provider: github, gitlab, circle |
--force | boolean | false | Overwrite existing workflow file |
Supported providers
GitHub Actions
npx ui-inspect ci-setup --provider githubCreates .github/workflows/visual-regression.yml:
name: Visual Regression Tests
on: [pull_request]
jobs:
visual-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: pnpm install
- run: pnpm build
- run: pnpm start &
- name: Run visual tests
run: npx ui-inspect build --fail-on-diff --report --pr ${{ github.event.pull_request.number }}
env:
UI_INSPECT_TOKEN: ${{ secrets.UI_INSPECT_TOKEN }}GitLab CI
npx ui-inspect ci-setup --provider gitlabOutputs a template for .gitlab-ci.yml.
CircleCI
npx ui-inspect ci-setup --provider circleOutputs a template for .circleci/config.yml.
After setup
- Add your
UI_INSPECT_TOKENas a secret in your CI provider - Commit the generated workflow file
- Open a PR to trigger your first automated visual test