Appearance
CLI & Headless
Watchlight supports headless commands for CI/CD and scripted validation.
Commands
The CLI shape is:
bash
watchlight run [--scene <name>] [--all] [--strict] [--format text|json] <project_path>
watchlight re-analyze [--scene <name>] [--all] [--strict] [--format text|json] <project_path>
watchlight mcprun: takes new snapshots and then analyzesre-analyze: analyzes existing snapshots without taking new onesmcp: starts a stdio MCP server for AI assistant integration (see MCP Server)
MCP mode
watchlight mcp runs a long-lived MCP server over stdin/stdout. Your editor or AI tool starts this automatically when configured — see MCP Server for setup instructions.
The server exposes the same run and re_analyze actions as the CLI, plus agent-focused tools to inspect projects, create/update scenes, validate launch hooks, manage baselines, and fetch artifacts.
Options
--scene <name>: run only a specific scene by name--all: report all results instead of only the latest relevant result--strict: return a non-zero exit code when visual diffs fail, not just when execution errors occur--format text|json:text: human-friendly outputjson: structured output for CI/CD
Examples
Analyze all scenes and emit JSON for CI:
bash
watchlight run --format json ./my-project.watchlight.jsonAnalyze only one scene:
bash
watchlight run --scene "Main Menu" ./my-project.watchlight.jsonRe-analyze without new snapshots:
bash
watchlight re-analyze --all ./my-project.watchlight.jsonFail CI immediately when visual diffs exceed threshold:
bash
watchlight re-analyze --strict --format json ./my-project.watchlight.jsonCI recommendations
- Use
--format jsonand parse summary status/counts in pipeline steps - Prefer
--strictwhen CI should fail on visual mismatches - Persist project file + snapshots as CI artifacts on failures
- Run with deterministic app arguments to reduce flaky diffs
- Keep scene names stable;
--scenematching is name-based
Exit behavior
- Successful runs exit
0 - Errors during scene processing return a non-zero exit
- Visual diffs can exceed threshold while still exiting
0by default - Use
--strictto treat visual failures as process failures
Baseline behavior
Watchlight analyzes each non-baseline snapshot against the scene's effective baseline:
- if a scene has an explicit baseline snapshot, that file is the comparison source
- otherwise the first snapshot by name order is treated as the baseline
Use Integration Guide for scene architecture and launch argument strategy.