npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@compare-ui/cli

v0.1.0

Published

CLI helpers for design comparison workflows.

Downloads

85

Readme

@compare-ui/cli

Command-line tools for design-comparison workflows.

This package provides:

  • comparison runs for a reference image and an actual image
  • artifact-only render runs
  • utility commands for grid, overlay, join, and crop

Installation

pnpm add -D @compare-ui/cli @compare-ui/core

The CLI is intended to be installed in the consuming workspace as a development tool.

Commands

Main workflow commands:

  • design compare
  • design render

Utility commands:

  • design grid
  • design overlay
  • design join
  • design crop

Shared config

The CLI can read design-comparison.config.mts.

Example:

design compare ^
  --reference ./figma.png ^
  --actual ./actual.png ^
  --config ./design-comparison.config.mts

design compare

design compare runs the comparison step and then writes the configured artifacts and report.

Important options:

--reference
--actual
--config
--name
--output-folder
--min-similarity-percent
--max-diff-percent
--reference-crop-top
--reference-crop-right
--reference-crop-bottom
--reference-crop-left
--actual-crop-top
--actual-crop-right
--actual-crop-bottom
--actual-crop-left
--json

Example:

design compare ^
  --reference ./figma-screen.png ^
  --actual ./actual.png ^
  --name home-screen ^
  --output-folder ./design-tests ^
  --max-diff-percent 0.5 ^
  --reference-crop-bottom 20

The CLI accepts both:

  • --max-diff-percent
  • --min-similarity-percent

so existing workflows can use either threshold style from the command line.

design render

design render skips comparison and generates only the configured artifacts.

This is useful when you want:

  • overlays
  • grid images
  • joined review sheets

without calculating diff metrics.

Example:

design render ^
  --reference ./figma-screen.png ^
  --actual ./actual.png ^
  --config ./design-comparison.config.mts

design grid

Adds a grid to one image.

Example:

design grid ^
  --input ./image.png ^
  --output ./image-grid.png ^
  --size 16 ^
  --offset-x 0 ^
  --offset-y 0 ^
  --color 0,153,255 ^
  --alpha 0.28 ^
  --line-width 2

design overlay

Creates one overlay image from a reference image and an actual image.

Example:

design overlay ^
  --reference ./figma.png ^
  --actual ./actual.png ^
  --output ./overlay.png ^
  --overlay-alpha 0.5

design join

Joins multiple images into one output image.

Example:

design join ./reference-grid.png ./actual-grid.png ^
  --output ./joined.png ^
  --direction horizontal ^
  --gap 12

design crop

Crops one image by edge offsets.

Example:

design crop ^
  --input ./figma-screen.png ^
  --output ./figma-screen-cropped.png ^
  --bottom 20

Crop is lossless and uses only integer edge offsets.

Exit behavior

Exit codes:

  • 0 comparison passed, or render-only flow completed successfully
  • 1 comparison failed acceptance, or processing produced an error

Even on 1, the CLI still writes all available artifacts and comparison-report.json.

Terminal output

The CLI prints:

  • run status
  • similarity and diff summary when comparison is enabled
  • report path
  • artifact paths
  • errors, when present

Use --json if you want the full result as machine-readable JSON.