openpencil/tools/visual-oracles/src/cli.ts
Danila Poyarkov 38bee364e8
refactor(tools): organize internal CLI workflows (#600)
* refactor(tools): organize internal CLI workflows

- Group visual-oracle commands behind a Citty CLI and domain folders\n- Add imported-document visual comparison manifests and pixel-diff outputs\n- Consolidate package-quality checks behind stable check, smoke, and verify commands\n- Remove obsolete visual root aliases and compatibility scripts

* fix(tools): validate visual oracle target scope

- Validate manifest records, required strings, and optional field types\n- Reject explicit OpenPencil nodes outside the configured page

* fix(tools): validate packaged runtime exports
2026-08-29 14:42:44 +03:00

32 lines
980 B
TypeScript

import { defineCommand, runMain } from 'citty'
import { operationCommand } from './commands/operation'
const main = defineCommand({
meta: {
name: 'visual-oracles',
description: 'Figma and OpenPencil visual comparison tools'
},
subCommands: {
compare: () => import('./commands/compare').then((module) => module.default),
bisect: operationCommand(
'bisect',
'Bisect page children to isolate visual differences',
'tools/visual-oracles/src/operations/bisect.ts'
),
'export-fixtures': operationCommand(
'export-fixtures',
'Export configured OpenPencil fixture images',
'tools/visual-oracles/src/operations/export-fixtures.ts'
),
analyze: () => import('./commands/analyze').then((module) => module.default),
'update-report': operationCommand(
'update-report',
'Update the visual comparison report',
'tools/visual-oracles/src/operations/update-report.ts'
)
}
})
await runMain(main)