colorsmine CLI & GitHub Action — a color grade as a build gate
The same engine that grades palettes on this site, in your pipeline. It reads the design tokens already in your repository and exits non-zero when contrast regresses, so an inaccessible palette can block a merge instead of surfacing in review.
npx colorsmine check --min B --wcag
What it reads
- CSS custom properties —
:root { --primary: #2563eb } - Tailwind v4
@themeblocks, andtailwind.config.{js,cjs,mjs,ts} - shadcn/ui bare HSL —
--background: 0 0% 100% - Declared dark themes —
.dark { … }, graded as their own mode - DTCG design tokens and nested or flat JSON
Exit codes
- 0 — every gate met.
- 1 — below
--min, or--wcagfound a failure. This is the one that blocks a merge. - 2 — could not run: no tokens found, a file would not parse, or bad arguments.
As a GitHub Action
kscarfi/colorsmine-cli@v1 writes a grade table to the job summary, annotates each failing gate, and exposes six outputs: passed, grade, score, dark-grade, dark-score and badge. Free and MIT licensed, on npm as colorsmine.