@juxtapose/cli

中文文档
0.31.0发布于 2026/11/01MITTypeScriptES Module构建来源已验证

jux — visual regression testing CLI for Storybook, Ladle and friends.

原始使用文档

@juxtapose/cli

Visual regression testing for pages by URL, Storybook and Ladle. Capture the pages or stories you need, compare them with approved baselines, and inspect screenshots and recorded DOM changes.

Requires Node.js 22.2 or later. Local testing needs no hosted account: the repo holds configuration, hashes and structure; images stay in a local cache. Hosted uploads and review are optional and have separate review decisions.

pnpm add -D @juxtapose/cli
npx -p @juxtapose/cli jux browser install   # once, ~100 MB
npx storybook build --quiet --disable-telemetry --loglevel error  # or: npx ladle build
npx -p @juxtapose/cli jux init              # writes config, captures and approves initial baselines
git add juxtapose.config.json juxtapose.manifest.json juxtapose.structures/ .gitignore

Review the initial captures before treating them as your reference. Subsequent jux run captures all stories by default. Use --since <ref> to select affected stories when the dependency graph is usable; uncertain selection falls back to a full run.

commandwhat it does
jux runcapture stories and compare to baselines
jux approve --story <id>confirm captures and update local baselines
jux checkexit non-zero if anything still needs review — for CI
jux handoff <id>print a prompt to investigate one failing story
jux browserinstall, status, path, start or stop
jux mcpMCP server on stdio for coding agents; docs

Commands with structured results support --json; jux handoff produces text. MCP tools use structured results where available, and run defaults to a bounded summary rather than the full CLI run report. See MCP output modes.

The browser is chrome-headless-shell 151.0.7922.34, installed once by jux browser install (an existing Playwright cache of the same build is reused; JUX_CHROME=<path> or --chrome <path> uses your own). Mask and --wait-for selectors are CSS.

Outside CI, jux snap, jux run and jux init keep one browser warm in the background between invocations (idle exit after 10 minutes). Reuse avoids browser launches; it does not make changing content deterministic. --no-daemon or JUX_NO_DAEMON=1 turns it off for a command; it is also off in CI and on Windows. jux browser start|stop|status manage it, and JUX_STATE_DIR moves its socket and state apart from JUX_CACHE_DIR. The warm browser keeps the system fonts and time zone it started with, so after you install fonts or change the system time zone, run jux browser stop. See the browser guide for details.

To review diffs inside Storybook, add @juxtapose/storybook.

Full documentation: juxtapose on GitHub

MIT © Magic Factory LLC

版本与发布记录

@juxtapose/cli 共发布 50 个版本,首次发布于 2026/07/29;过去 12 个月发布了 50 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.31.0latest2026/11/011 天前
0.30.02026/11/012 天前
0.29.02026/11/012 天前
0.28.32026/10/312 天前
0.28.22026/10/313 天前
0.28.12026/10/313 天前

关于 @juxtapose/cli 的常见问题

@juxtapose/cli 是什么?

六视觉回归测试CLI为Storybook, Ladle和朋友。

如何安装 @juxtapose/cli?

在项目目录运行 npm install @juxtapose/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 jux,可以用 npx jux 直接运行。

@juxtapose/cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@juxtapose/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@juxtapose/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.2.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@juxtapose/cli 可以商用吗?

@juxtapose/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@juxtapose/cli 还在维护吗?

最新版本 0.31.0 发布于 2026/11/01(1 天前);至今共发布 50 个版本,其中过去 12 个月发布了 50 个;首次发布于 2026/07/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。