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]| Argument | Default | Description |
|---|---|---|
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 --jsonOptions
| Flag | Env var | Default | Description |
|---|---|---|---|
--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 | ./exports | Output directory used by render |
--config <path> | OPEN_ASSETS_CONFIG | assets.json | Path to config file |
--json | - | - | Output results as JSON |
What fails
| Problem | Message |
|---|---|
| An input changed without a re-render | The reasons, e.g. strings[de].hero_title changed or public/screenshots/fr/01.png changed |
| An output is not in the lock | not in assets.lock (new output) |
| An output file differs from the hash in the lock | output file differs from assets.lock (edited by hand?) |
An output file is missing (only with --require-outputs) | output file is missing |
| No lock | No assets.lock in <dir>. Run open-assets render and commit assets.lock. |
| Lock from an older Open Assets | assets.lock is lockfile v1; this open-assets writes v2. It needs upgrading: ... |
| Lock from a newer Open Assets | assets.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
| Code | When |
|---|---|
| 0 | Every output matches the lock |
| 1 | Any 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
open-assets validate
Check assets.json for missing fields, duplicate ids, missing template files and broken localizations, fix them interactively, and fail CI with exit code 1.
open-assets init
Scaffold an Open Assets project interactively with an assets.json, starter HTML templates for screenshots, icons, logos and more, plus public and src folders.