assetopt

Guide

assetopt vs Squoosh CLI

assetopt and the Squoosh CLI compared: a maintained multi-asset optimizer with smart routing, cache and a CI gate, versus Google's WASM-codec image CLI. Honest, up to date, MIT.

The Squoosh CLI (@squoosh/cli) is the command-line companion to Google’s squoosh.app, built on WebAssembly image codecs. assetopt is a CLI that optimizes images plus CSS, JS and SVG, with format routing, an incremental cache and a CI quality gate.

One thing to know up front: @squoosh/cli has had no npm release since January 2023, and the Squoosh repository is archived. It still works for many, but it isn’t actively maintained and has known compatibility friction on recent Node versions. That’s the main reason to weigh a maintained alternative.

TL;DR

assetopt Squoosh CLI
Maintained Yes (active) Archived, last release Jan 2023
Asset types Images, CSS, JS, SVG Images only
Image engine sharp (native libvips) WASM codecs (MozJPEG, OxiPNG, WebP, AVIF…)
Native deps Yes (sharp prebuilt binaries) None (pure WASM)
Format routing Presets + formatMatrix Per-codec flags
Transparency-aware routing Yes No
Incremental cache Yes No
CI quality gate Yes (--min-savings) No
Resize / rotate No (optimization-focused) Yes
License MIT Apache-2.0

Where they differ

Maintenance

This is the headline difference. Squoosh is a fantastic project, but the CLI has been frozen since early 2023 and the repo is archived — no fixes for new Node releases, codec updates, or bugs. assetopt is under active development (latest release is recent) and tracks its underlying libraries.

If you’re picking a tool to put in a build that has to keep working, maintenance status is a real selection criterion, not a footnote.

Scope: images-only vs every static asset

Squoosh is exclusively an image tool — JPEG, PNG, WebP, AVIF, JPEG XL, WebP2. It does not touch CSS, JS or SVG.

assetopt covers four asset families in one command (sharp for images, lightningcss for CSS, esbuild for JS, svgo for SVG):

assetopt optimize ./public   # images + css + js + svg

Engine: WASM codecs vs native libvips

Squoosh’s WASM codecs are a genuine strength: zero native dependencies, identical output on every platform, and very granular per-codec controls. If you optimize inside a locked-down or exotic environment where installing native binaries is painful, that portability is valuable.

assetopt uses sharp (native libvips bindings) — the fastest, most stable image path in the Node ecosystem — installed as prebuilt binaries for common platforms. Faster on large batches, at the cost of a native dependency.

Routing and re-runs

Squoosh converts per your explicit codec flags. assetopt adds content-aware routing (transparency-aware PNG → AVIF/WebP via the web-perf preset) and an incremental cache so repeat runs only reprocess changed files:

assetopt optimize ./public   # 1st run — full
assetopt optimize ./public   # 2nd run — cached, near-instant

CI: a built-in gate

assetopt can fail a build when savings drop below a floor:

assetopt optimize dist --min-savings 15   # exit 1 if total savings < 15%

Squoosh has no equivalent — you’d script the check around it.

When Squoosh is the better pick

  • You need resize, rotate or quantize as part of the job. Squoosh does image geometry and quantization; assetopt is optimization-focused and doesn’t resize.
  • You must avoid native dependencies entirely (restricted CI images, unusual architectures) and want deterministic WASM output.
  • You want hands-on, per-codec control (advanced MozJPEG/AVIF encoder knobs) and are comfortable with an unmaintained tool.

For an interactive, one-off tweak, squoosh.app in the browser is still excellent — the maintenance caveat is about the CLI/library in an automated pipeline.

Trying assetopt

npm install -g @assetopt/cli
assetopt analyze ./public        # dry-run: see savings, writes nothing
assetopt optimize ./public

See the feature catalog for the full feature set, or the convert to AVIF guide for a focused walkthrough.

Get the CLI

$ npm install -g @assetopt/cli

Open source, MIT. See the docs orstar it on GitHub.