CLI referenceverbatra check

verbatra check

Report which keys are missing or stale per locale without writing files.

Report, per target locale, how many keys are missing, stale, or up to date, then exit with a code a CI step can branch on. check runs the same read and diff that verbatra translate performs right before it would call a provider, then stops: no provider call, no files written, no lock file update, and no API key needed.

Synopsis

verbatra check [flags]

Flags

FlagArgumentDefaultEffect
--cwd<path>current directoryresolve config and locale files from this directory
--config<path>search for oneload this config file instead of searching for one
--locales<list>all configured targetscomma-separated subset of target locales to check
--jsonnoneoffprint the check summary as one JSON object on stdout; errors still go to stderr

A key is missing when the source has it and the target does not; stale when the source string changed since it was last translated. A locale is in sync when it has neither. An empty or unknown --locales value is rejected with exit 2 rather than silently checking nothing, so a typo in a locale name never lets a CI gate pass. Want the actual key lists behind the counts? That is verbatra diff.

Examples

# fail the build when translations drifted
verbatra check

# machine-readable status for two locales
verbatra check --locales de,fr --json

Exit codes

CodeMeaning
0in sync: no locale has a missing or stale key
1out of sync: at least one locale has a missing or stale key (the report is still printed)
2could not run: a whole-run error, or a usage error (including an empty or unknown --locales value)

Exit 1 means "out of sync", not a failure: the run itself succeeded, the result just is not all green.

Edit on GitHub