# Behavior traces — chromaui/chromatic-cli

> Canonical page: https://codevetter.com/unpack/chromatic-cli/behavior-traces

# Behavior traces — chromaui/chromatic-cli

Scanned commit 9e2606a2dbc11bcd07e7e451431432e32de0224b (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

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.
- Startup: register.js dispatches by process.argv[2] or falls back to main; main calls run, which parses arguments, checks Node compatibility, discovers package.json, constructs InitialContext, and calls runAll. — [bin-src/register.js#L5-L19](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/bin-src/register.js#L5-L19) [bin-src/main.ts#L13-L23](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/bin-src/main.ts#L13-L23) [node-src/index.ts#L133-L167](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L133-L167)
- Context setup: runAll calls setupContext, getPartialOptions, the credential-free branch-skip preflight, and getOptions; it seeds Runtime.forceRebuild and launches runBuild alongside checkForUpdates. — [node-src/index.ts#L188-L234](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L188-L234) [node-src/index.ts#L299-L322](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L299-L322) [node-src/context.ts#L18-L32](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/context.ts#L18-L32)
- Publish preparation: renderAuth runs runAuth; runBuild then calls renderGitInfo, renderStorybookInfo, and renderInitialize, whose initialize function gathers environment/runtime metadata, calls announceBuild, and optionally sets component owners. — [node-src/renderer/auth.ts#L13-L24](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/renderer/auth.ts#L13-L24) [node-src/index.ts#L362-L365](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L362-L365) [node-src/tasks/initialize/index.ts#L32-L53](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/initialize/index.ts#L32-L53)
- Artifact preparation: buildProject selects native or web handling; the web path resolves sourceDir, setBuildCommand, and buildStorybook unless prebuilt, then prepareProject validates files and Android artifacts, traces changes, and calculates hashes. — [node-src/tasks/build/index.ts#L70-L117](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/build/index.ts#L70-L117) [node-src/tasks/build/index.ts#L130-L136](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/build/index.ts#L130-L136) [node-src/tasks/prepare/index.ts#L32-L57](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/prepare/index.ts#L32-L57)
- Upload and completion: uploadProject calls uploadBuild and waits for deduplicated sentinels, retrying without hashes on failure; a server SKIPPED result returns partial and halts downstream tasks, otherwise verifyProject publishes/verifies and snapshotProject waits for completion and maps status to an exit code. — [node-src/tasks/upload.ts#L73-L113](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/upload.ts#L73-L113) [node-src/tasks/upload.ts#L124-L149](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/upload.ts#L124-L149) [node-src/tasks/verify/index.ts#L36-L65](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/verify/index.ts#L36-L65) [node-src/tasks/snapshot.ts#L132-L218](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/snapshot.ts#L132-L218)
- Sharing: share calls setupShareContext and reserveShare, invokes onUrl immediately, runs renderBuild/renderPrepare and the Listr uploadShare task, uploads supporting files before index.html, then confirms complete/error/cancelled; confirmation failures warn without replacing the upload outcome. — [node-src/share.ts#L49-L110](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/share.ts#L49-L110) [node-src/share.ts#L160-L178](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/share.ts#L160-L178) [node-src/tasks/uploadShare.ts#L96-L117](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/uploadShare.ts#L96-L117)
- Patch builds: renderPrepareWorkspace precedes authentication; runPrepareWorkspace checks cleanliness/currentness, finds and checks out the merge base, and installs dependencies. runBuild's finally calls runRestoreWorkspace despite pipeline skips, which resets, checks out the previous branch, reinstalls, and resets again. — [node-src/index.ts#L359-L362](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L359-L362) [node-src/tasks/prepareWorkspace.ts#L33-L79](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/prepareWorkspace.ts#L33-L79) [node-src/index.ts#L393-L407](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L393-L407) [node-src/tasks/restoreWorkspace.ts#L15-L21](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/tasks/restoreWorkspace.ts#L15-L21)
- Post-run persistence: runAll writes diagnostics when requested or needed for metadata, uploads metadata when a published build URL permits it, cleans implicit files, and calls checkPackageJson only for non-E2E exit codes 0/1; that function can interactively add a script using originalArgv. — [node-src/index.ts#L236-L254](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L236-L254) [node-src/index.ts#L273-L296](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/index.ts#L273-L296) [node-src/lib/checkPackageJson.ts#L24-L44](https://github.com/chromaui/chromatic-cli/blob/9e2606a2dbc11bcd07e7e451431432e32de0224b/node-src/lib/checkPackageJson.ts#L24-L44)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
