CLI Overview
The Vizzly CLI runs a local HTTP server during test execution. Your tests send screenshots to this server, which either compares them locally (TDD mode) or uploads them to Vizzly’s cloud for team review.
Two Ways to Test
Local development (TDD mode):
vizzly tdd startnpm test --watchStart a local server with a dashboard at http://localhost:47392. Run tests in watch mode. Screenshots get compared against local baselines with a web UI showing diffs. No uploads, no waiting.
CI/CD (cloud mode):
vizzly run "npm test"Run your test command. The CLI starts a server, collects screenshots during test execution, then uploads them to Vizzly’s cloud. You get a build URL with comparisons for your team to review.
Installation
npm install -D @vizzly-testing/cliRequires Node.js 22 or newer.
Authentication
Local development:
vizzly loginOpens your browser for OAuth authentication. Stores a token that lasts 30 days.
CI/CD:
export VIZZLY_TOKEN=your-project-tokenSet the token in your CI provider’s secrets. The CLI reads it automatically.
Token priority: --token flag > VIZZLY_TOKEN env var > project mapping (vizzly project:select) > user token (vizzly login).
Commands
Test Integration
vizzly run- Run tests, upload screenshots to cloudvizzly tdd- Local testing with dashboard
Upload & Status
vizzly upload- Upload screenshots from a directoryvizzly status- Check build status and resultsvizzly finalize- Finalize parallel builds
Setup & Validation
vizzly init- Create config filevizzly doctor- Validate setup
Authentication & Projects
vizzly login- Authenticate with Vizzlyvizzly logout- Clear stored authvizzly whoami- Show current uservizzly project:*- Manage project tokens
Using the Client in Tests
Import the client in your test files:
import { vizzlyScreenshot } from '@vizzly-testing/cli/client';
test('homepage test', async ({ page }) => { await page.goto('/'); const screenshot = await page.screenshot();
await vizzlyScreenshot('homepage', screenshot, { browser: 'chrome', viewport: '1920x1080' });});The client sends screenshots to the local server via HTTP POST. Works with Playwright, Cypress, Puppeteer, or anything that captures screenshots.
You can pass a file path instead of a buffer:
await page.screenshot({ path: './screenshots/homepage.png' });await vizzlyScreenshot('homepage', './screenshots/homepage.png', { browser: 'chrome', viewport: '1920x1080'});Package Exports
The CLI package provides four entry points:
@vizzly-testing/cli/client (recommended for test runners):
import { vizzlyScreenshot } from '@vizzly-testing/cli/client';Lightweight client. Sends screenshots to the local server.
@vizzly-testing/cli/sdk (for custom integrations):
import { createVizzly } from '@vizzly-testing/cli/sdk';
const vizzly = await createVizzly({ apiKey: process.env.VIZZLY_TOKEN, server: { port: 3003 }});
await vizzly.start();await vizzly.screenshot('test', buffer);await vizzly.upload();await vizzly.stop();Full SDK with programmatic control over server lifecycle and uploads.
@vizzly-testing/cli/config (for config files):
import { defineConfig } from '@vizzly-testing/cli/config';
export default defineConfig({ threshold: 0.1, upload: { screenshotsDir: './screenshots' }});Config helper with type hints for vizzly.config.js.
@vizzly-testing/cli (main export):
import { vizzlyScreenshot, createVizzly } from '@vizzly-testing/cli';Convenience export that includes both client and SDK.
AI Integration
Vizzly includes built-in support for AI-powered development tools:
- Claude Code Integration - AI-assisted visual testing workflows with intelligent debugging, test coverage suggestions, and interactive setup
Get AI help with visual regressions, baseline management, and test coverage.
Next Steps
- Installation & Setup - Detailed installation guide
- Commands Reference - Complete command reference
- TDD Mode - Local visual testing workflow
- Configuration - Project configuration options
- AI Integrations - AI-powered workflows