CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

chromaui/chromatic-cli

Scanned commit 9e2606a2db dated 2026-10-02 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/chromaui/chromatic-cli ↗ · 647 files · 1.9 MB

Chromatic CLI Publishes your Storybook to Chromatic and kicks off tests if they're enabled.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (503s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

Chromatic CLI builds or accepts prebuilt Storybooks, uploads their artifacts to Chromatic, and reports hosted visual-test results to developers and CI. The same TypeScript pipeline serves command-line aliases, a GitHub Action, and a Node API, with additional paths for test archives, React Native artifacts, and temporary Storybook sharing. Distinctive mechanisms include content-hash upload deduplication, Git-based TurboSnap selection, and a newer hash-manifest collection path that still defers story selection to TurboSnap v1 at this commit.

System map

The product is primarily a Node client for hosted Chromatic services; its Storybook and Vite configuration renders the CLI's own presentation examples. CLI, Action, and programmatic callers converge on a shared context and an explicitly ordered pipeline. Local artifacts and diagnostic files complement remote build state, while transport, task logic, and rendering occupy separate modules. Packaging and release configuration describe CommonJS npm bundles and a separately bundled GitHub Action.

Feature catalog

Publishing supports locally built web Storybooks and prebuilt output, with hosted verification and visual-result reporting. Users can constrain stories, apply branch policies, initialize archive integrations, or build React Native artifacts. Auxiliary commands expose dependency tracing and manifest inspection, while Node consumers can reserve temporary share URLs. Diagnostics, metadata, and JUnit output provide operational visibility alongside terminal messages and Action outputs.

Data flow

Inputs enter through argv, Action fields, Node options, configuration, and selected process environment variables. A shared Context accumulates normalized metadata and task outputs, while extract/apply adapters mediate most state changes. Artifact paths and hashes become upload descriptors, remote publication becomes build-result state, and result counts leave through the Node return object or Action outputs. Diagnostics and TurboSnap manifests form additional persistence and upload channels.

Behavior traces

Source walks followed startup, normal publishing, sharing, and patch-workspace restoration through their concrete function calls. The publishing sequence has early-stop branches for skipped commits and fully TurboSnapped builds, plus self-skips for dry-run stages. Sharing reserves its URL before uploading and reports a terminal status afterward. Post-pipeline diagnostics and metadata handling occur after build teardown, with persistence controlled separately from artifact publication.

Testing signals

Tests and CI were inspected, not executed; their existence establishes intended checks, not passing results. Vitest covers task logic, orchestration, renderer semantics, and deterministic hashing through extensive mocks and fixtures. CI also defines packed-package smoke runs and hosted visual checks, which exercise different boundaries from unit tests. This is a bounded inspection, and configured coverage excludes the Action adapter and several presentation/fixture categories.

Risk map

These are source observations and explicitly labeled hypotheses, not confirmed vulnerabilities. Sensitive boundaries include credential exchange, shell command construction, repository mutation, filesystem traversal, and diagnostic uploads. Compatibility hotspots include shared Context access and persistent hash contracts across CLI versions. Mock-based tests provide useful behavioral specifications but do not validate these boundaries against a live service or real user workspace in this investigation.

Extension points

Extension points are explicit TypeScript tables, interfaces, adapters, and task seams. CLI commands use a dispatch table, configuration uses a strict schema, and renderers consume a common lifecycle interface. Programmatic callbacks expose task progress and cancellation without a separate plugin loader in the inspected flow. TurboSnap's filesystem abstraction and manifest serialization provide particularly clear seams for deterministic implementation and testing.

Contributor handoff

Begin with the shared pipeline and its adapters before editing individual tasks. Preserve task-result semantics, input precedence, Action synchronization, and the distinction between v1 selection and v2 hash collection. Tests and CI were inspected, not executed, and this bounded brief cannot establish passing checks or comprehensive coverage. Any later executable validation needs separate authorization because setup, publishing, initialization, and patch builds have material side effects.

Languages

LanguageFilesShare of source
TypeScript54194%
JSON35docs/config
JavaScript326%
YAML19docs/config
Markdown9docs/config
HTML3docs/config
CSS1docs/config

Start reading here

Probable source entrypoint: node-src/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

node-src/ (561 files) bin-src/ (21 files) smoke-tests/ (13 files)

Source layout — node-src/

PathFiles
node-src/__mocks__/19
node-src/ui/245

Repository structure

Top-level pathFiles
node-src/561
bin-src/21
.github/16
smoke-tests/13
action-src/4
.storybook/4
scripts/3
static/1

Docs found: README.mddocs/DEVELOPMENT.md

Package

package.json — chromatic v18.10.2, 80 declared dependencies.

@actions/core@actions/github@antfu/ni@auto-it/slack@chromatic-com/cypress@chromatic-com/playwright@chromatic-com/vitest@clack/prompts@discoveryjs/json-ext@eslint-community/eslint-plugin-eslint-comments@expo/config-plugins@expo/config-types

CI & config entrypoints

Structural health signals

Average score 8.5/10 across 96 analyzed source files; 1 hotspot surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history