Skip to content

Quickstart

Follow these steps to set up Cappa inside an existing frontend project.

Cappa is distributed as a set of packages. Install the CLI alongside the core runtime with your preferred package manager:

Terminal window
pnpm add -D @cappa/cli @cappa/core

Cappa delegates browser automation to Playwright. Install the Playwright browsers if your project has not already done so:

Terminal window
npx playwright install --with-deps

Create a cappa.config.ts file in the root of your project and define where screenshots should be saved:

import { defineConfig } from '@cappa/core';
export default defineConfig({
outputDir: 'screenshots'
});

Configuration objects can include additional options like custom commands, plugin settings, and CI integration hooks. Explore the Configuration guide for a deeper tour.

With the configuration in place you can run the standard workflow:

Terminal window
# capture screenshots with Playwright
cappa capture
# review diffs in an interactive UI
cappa review
# approve changes and update baselines
cappa approve

The CLI keeps track of the working directory so you can review screenshots locally or as part of a continuous integration job.