UI Inspect
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

FlagTypeDefaultDescription
--provider <name>stringCI provider: github, gitlab, circle
--forcebooleanfalseOverwrite existing workflow file

Supported providers

GitHub Actions

npx ui-inspect ci-setup --provider github

Creates .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 gitlab

Outputs a template for .gitlab-ci.yml.

CircleCI

npx ui-inspect ci-setup --provider circle

Outputs a template for .circleci/config.yml.

After setup

  1. Add your UI_INSPECT_TOKEN as a secret in your CI provider
  2. Commit the generated workflow file
  3. Open a PR to trigger your first automated visual test

On this page