document360-capture
v0.2.8
Published
CLI that captures product screenshots from Playwright specs. Login once, capture many. Companion to document360-writer.
Maintainers
Readme
document360-capture
CLI that captures product screenshots from Playwright specs. Login once, capture many. Companion to document360-writer.
Why
Doc-screenshot pipelines hit two walls in practice:
- MFA + per-run login. Spinning up Chromium for every capture and asking the human to log in each time burns time and rules out repeatable runs.
- Annotation by hand. Adding arrows, numbered callouts, and redactions in an image editor is the slowest part of doc maintenance.
This CLI solves both: d360-capture auth opens Chromium once, the human logs in (MFA at their own pace), and a Playwright storageState is saved. Every d360-capture capture after that reuses the session. Specs declare what to highlight/redact/annotate; the CLI composites SVG overlays via sharp after the raw capture lands.
Install
npm install -g document360-capturePostinstall downloads the Chromium binary via npx playwright install chromium.
Quick start
cd <your-repo>
d360-capture init # one-time per project — writes .d360-capture.json
d360-capture auth --env staging # one-time per machine — log in, press Enter when done
d360-capture capture # run every spec in captureDir
d360-capture capture <spec-id> # run one specCommands
| Command | Description |
|---|---|
| d360-capture init | Interactive setup. Writes .d360-capture.json at repo root. |
| d360-capture auth [--env <name>] | Open Chromium; log in at your own pace; press Enter to save session. |
| d360-capture capture [<spec-id>] [--env <name>] [--no-annotate] | Run one or all specs. Default-on annotation overlay. |
| d360-capture list | List discovered specs and last-capture times. |
| d360-capture doctor | Validate config, auth-state, browser, and capture dir. |
| d360-capture status | Print resolved config (secrets redacted). |
Spec helpers
Specs in your captureDir import three helpers:
import { test } from '@playwright/test';
import { waitPastLogin, dumpAnnotations, type Placeholder } from 'document360-capture/helpers';
const PLACEHOLDER: Placeholder = {
id: 'settings-variables-add-modal',
saveTo: 'user-docs/_screenshots/settings-variables-add-modal.raw.png',
highlight: ['button:has-text("+ Add")'],
annotations: [{ target: 'input[name="key"]', label: '1', text: 'Use proj.* prefix' }],
redact: ['[data-testid="topbar-user-email"]'],
};
test(PLACEHOLDER.id, async ({ page }) => {
await page.goto(process.env.CAPTURE_START_URL!);
await waitPastLogin(page, new RegExp(process.env.CAPTURE_AUTH_BOUNDARY!));
await page.click('[aria-label="Open Settings"]');
await page.click('a:has-text("Variables")');
await page.click('button:has-text("+ Add")');
await page.waitForSelector('[role="dialog"]', { state: 'visible' });
await page.locator('[role="dialog"]').first().screenshot({ path: PLACEHOLDER.saveTo });
await dumpAnnotations(page, PLACEHOLDER);
});Config files
<repo>/.d360-capture.json(committed): paths, viewport, environments (startUrl + authBoundaryUrlPattern per env), annotation toggle.~/.document360-capture/auth-states/<projectId>/<env>.json(per-machine, never commit): PlaywrightstorageState.
License
Proprietary — © 2026 Kovai.co. All rights reserved. See LICENSE.
