Open Assets

Environment variables

Every environment variable the open-assets CLI reads, the flag it stands in for, its default and accepted values, plus the exit codes to check in CI scripts.

Flags win over environment variables, which win over defaults. Boolean variables count only when set to exactly true.

VariableFlagCommandsDefaultNotes
OPEN_ASSETS_PORT-p, --portdev3200Next free port is tried up to 10 times
OPEN_ASSETS_HOST-H, --hostdevlocalhost0.0.0.0 for LAN access
OPEN_ASSETS_NO_OPEN--no-opendevunsettrue skips opening the browser
OPEN_ASSETS_QUIET-q, --quietdev, renderunsettrue silences logs
CI--cidevunsettrue means quiet and no browser. Most CI providers set it
OPEN_ASSETS_CONFIG--configdev, render, list, validate, addassets.jsonRelative to [dir]
OPEN_ASSETS_RENDER_TIMEOUT--render-timeoutdev, render30000Milliseconds for page load
OPEN_ASSETS_OUTPUT-o, --outputrender./exportsRelative to the working directory
OPEN_ASSETS_CONCURRENCYnonerenderautoPositive integer; see below

OPEN_ASSETS_CONCURRENCY

By default render runs min(units, cores - 1, 2) pages at once (at least 1), where a unit is one template in one locale. A positive integer here replaces that, capped at the number of units. Zero, negative or non-numeric values are ignored. See /reference/cli/render.

OPEN_ASSETS_CONCURRENCY=4 npx open-assets render --force

Example: CI

export OPEN_ASSETS_QUIET=true
export OPEN_ASSETS_OUTPUT=./build/assets
npx open-assets validate
npx open-assets render --json > render.json

See /ci/github-actions.

Exit codes

CodeMeaning
0Success. render also exits 0 when --size or --locale skipped every collection
1Config missing or invalid JSON; a --collection or --tag filter matched nothing; validate found errors; add duplicate; init found an existing assets.json; dev found no free port
non-zeroUncaught error during a render (timeout, missing localizations file), with a stack trace

Last updated on

On this page