CLI
npx hoverlab
Install
There is nothing to install. npx fetches the current version each time, which is what you want for a tool you run a handful of times per project.
npx hoverlab helpIf you reach for it often enough to mind the fetch, npm i -g hoverlab works too.
Commands
| Command | What it does |
|---|---|
add <id…> | Write an effect, block or page into your project |
init [template] [dir] | Scaffold a template into a new directory. With no template, lists what is available. |
search <words…> | Search every tier at once |
show <id…> | Print an artifact's code without writing anything |
categories | List the categories, per tier |
outdated | List installed artifacts the catalog has changed since. Reads only. |
diff <id…> | Show what changed between your copy and the current one |
mcp | Run the MCP server over stdio, for editor agents |
audit-url <url> | Audit a deployed page in a real browser: contrast, design drift, right-to-left breakage |
Adding things
# a single block
npx hoverlab add pricing-tiers
# several at once
npx hoverlab add pricing-tiers faq-accordion footer-mega
# a page — writes the page and every block it imports
npx hoverlab add checkout-page
# an effect, tweaked on the way in
npx hoverlab add btn-gradient --hue 40 --speed 1.5Where files land. Effects go into a hoverlab/ folder inside your components or styles directory. Blocks and pages keep their own paths — components/pricing-tiers.tsx, app/checkout/page.tsx — rooted at your project, or at src/ if you use one. That is not a preference: page sources import their blocks by those paths, so moving them breaks the imports. --dir overrides it if you know what you are doing.
--force. Run with --dry-run first to see the exact file list.Keeping up to date
Hoverlab installs source you own, which is the point — and the reason a fix to a block could never reach you once it was in your repo. add now records what it wrote in a hoverlab.lock.json beside your package.json, and outdated compares that against the catalog.
# what has moved on since you installed it
npx hoverlab outdated
# what actually changed in one of them
npx hoverlab diff pricing-tiers
# machine-readable, for CI
npx hoverlab outdated --jsonNeither command writes. There is deliberately no --fix. The file is yours and you have probably edited it; a command that overwrote local changes on the strength of a hash comparison would be the most destructive thing this CLI could do. diff shows you what changed and the merge is your call.
outdated fetches every fingerprint and compares locally, so the request does not reveal which artifacts you have installed.Scaffolding a template
A template is a whole project — routes, pages, blocks and config. init writes it into a new directory.
# see what is available
npx hoverlab init
# scaffold one
npx hoverlab init storefront ./shop
cd shop && npm install && npm run devSearching
Search covers all four tiers at once and ranks them together, which matters when a word like “pricing” names a block, a page and thirty effects.
npx hoverlab search checkout
npx hoverlab search "pulsing teal button" --level effect
npx hoverlab search pricing --level block --featured
npx hoverlab show pricing-tiers --deepAuditing a deployed page
review reads your source. audit-url loads the running site in a real browser and reports what only exists once a page is rendered: the contrast ratio of text against the background actually underneath it, spacing and colour that drift from the site's own scale, and what breaks when the page is laid out right-to-left. Each finding names the closest tool, primitive or command in the catalog.
npx hoverlab audit-url https://staging.example.com
# also load it with dir=rtl and report what breaks
npx hoverlab audit-url http://localhost:3000 --dir rtl
# a phone-sized viewport, dark scheme, and more pages on the same origin
npx hoverlab audit-url https://example.com --viewport mobile --dark --pages /pricing,/docs
# machine-readable, or a pull-request comment body
npx hoverlab audit-url https://example.com --json
npx hoverlab audit-url https://example.com --format markdownTokens are inferred, not assumed. Nothing here compares your site to Hoverlab's design. It reads the computed values your page painted, works out the scale they follow (a 4px spacing grid, a handful of radii and type sizes) and reports the values that break it: a 13px padding on a 4px grid, a 7px radius among 8px ones, a near-duplicate grey. Only rare values close to a dominant one are reported, and every finding carries its counts so you can overrule it.
| Flag | Effect |
|---|---|
--viewport <v> | WIDTHxHEIGHT, or mobile | tablet | desktop. Default 1280x800 |
--dir rtl | Load the page a second time with dir=rtl injected before any script, and compare |
--dark | Emulate prefers-color-scheme: dark |
--pages <a,b> | Extra paths on the same origin, at most ten. Other origins are refused |
--format <f> | terminal (default) | markdown | json. --json is the same as --format json |
--strict | Advisories fail the run as well |
--no-axe | Skip axe-core even when it is installed |
It needs Playwright. The CLI itself has no dependencies, so the browser driver is not installed with it. Add it to the project you run the command from:
npm i -D playwright && npx playwright install chromiumWithout it the command prints that line and exits with code 2. If Playwright's Chromium is missing but Chrome or Edge is installed, that is used instead. axe-core is optional: when it can be found its contrast results are merged in, and the built-in measurement works without it.
0 nothing that fails the run, 1 at least one violation (contrast, or right-to-left content cut off or overflowing), 2 the audit could not run. Advisories never fail a run unless you pass --strict. Nothing is uploaded: the page is loaded by a browser on your machine.It reports what it measured and says what it did not: text over images and gradients, hover and focus states, pages behind a login, and real Arabic or Hebrew copy are outside what one rendering can show.
Options
| Option | Effect |
|---|---|
-l, --level <tier> | effect | block | page | template — restrict search and categories |
-f, --framework <t> | Effects only. Blocks and above ship as React — see rendered HTML if you are not using it. Auto-detected from your project when omitted. |
-d, --dir <path> | Destination directory |
--force | Overwrite existing files, or scaffold into a non-empty directory |
--dry-run | Print what would be written, write nothing |
--category <c> | Restrict a search to one category |
--featured | Only curated, hand-written entries |
--limit <n> | Maximum results per tier (default 20) |
--deep | With show: include the blocks a page is built from |
--json | Machine-readable output |
--hue --sat --scale --speed | Effects only — the same customization knobs the detail page has |
Editor agents
The CLI doubles as an MCP server so your editor's agent can search and install from the catalog directly. See the MCP docs.
Something wrong or missing here? Browse the catalog — every page in it links back to the source it documents.