Open Assets
CLI

open-assets check

Fail CI when assets.lock no longer matches your templates, strings and captures. Recomputes every render key without rendering, so it needs no browser.

open-assets check [options] [dir]
ArgumentDefaultDescription
dir.Project directory containing assets.json

check recomputes the render key of every output from the current inputs and compares it with assets.lock. It reads files and hashes them; it never renders and never launches Chromium, so it finishes in seconds on any runner.

Examples

open-assets check
open-assets check ./marketing --collection screenshots
open-assets check --require-outputs
open-assets check --json

Options

FlagEnv varDefaultDescription
--collection <id>--Check only the collection with this ID
--tag <tag>--Check only collections with this tag
--require-outputs--Also fail when an output file is missing (for committed exports)
-o, --output <dir>OPEN_ASSETS_OUTPUT./exportsOutput directory used by render
--config <path>OPEN_ASSETS_CONFIGassets.jsonPath to config file
--json--Output results as JSON

What fails

ProblemMessage
An input changed without a re-renderThe reasons, e.g. strings[de].hero_title changed or public/screenshots/fr/01.png changed
An output is not in the locknot in assets.lock (new output)
An output file differs from the hash in the lockoutput file differs from assets.lock (edited by hand?)
An output file is missing (only with --require-outputs)output file is missing
No lockNo assets.lock in <dir>. Run open-assets render and commit assets.lock.
Lock from an older Open Assetsassets.lock is lockfile v1; this open-assets writes v2. It needs upgrading: ...
Lock from a newer Open Assetsassets.lock was written by open-assets <version> ...

Inputs that the lock recorded but the checkout lacks (gitignored captures, a built stylesheet) are taken from the lock's hashes, and the output notes how many. Inputs that are present are always verified.

Missing output files pass by default, since most projects gitignore exports/. Set --require-outputs when you commit your exports.

Output

✗ 2 output(s) are out of date with assets.lock
  exports/screenshots/de/iphone-6.9/01-hero.png   strings[de].hero_title changed
  exports/screenshots/de/iphone-6.7/01-hero.png   strings[de].hero_title changed
Run `npx open-assets render` and commit assets.lock.

On success: ✓ 720 output(s) match assets.lock. With --json it prints { ok, problems: [{ path, reasons }], checked, message? }.

Exit codes

CodeWhen
0Every output matches the lock
1Any problem above, or the config is missing or invalid

In CI

The shared workflow runs check for you. See GitHub Actions.

New to Open Assets?

See examples from shipped apps and install it in one command on open-assets.dev.

Last updated on

On this page