CLI

CLI reference

The lingo command — subcommands, shared options, and exit codes.

Shape#

lingo <command> [options]

The canonical form is a subcommand followed by options. With no command, lingo prints status.

shell
lingo status                    # translation status per locale
lingo translate --locale de     # translate missing / changed keys
lingo validate --strict         # CI gate (exit 1 on strict-tier issues)
lingo quality --ai              # quality linting + optional AI pass
lingo fix-quality --locale en   # auto-fix the fixable issues
lingo accept-edits --locale de  # mark current translations as intentional
lingo sync                      # rebuild drift state from current files
lingo hash                      # source-translation fingerprint

Each command is described in detail on the Commands page.

Shared options#

OptionMeaning
-l, --locale LOCALERestrict to a single target locale
-f, --forceRe-translate all keys (not just missing/changed)
--force-key KEYRe-translate one specific key (repeatable); skips manual keys
--include-manualLet --force-key overwrite manual keys
--key KEYaccept-edits, quality: act on one specific key (repeatable)
--prefix PREFIXquality: check only keys starting with PREFIX
-v, --verboseVerbose logging
-n, --dry-runShow what would happen without writing files
--strictFail on the strict-tier violation types
--strict-allFail on the strict-all-tier violation types
--aiUse the AI pass for quality suggestions
--jsonEmit machine-readable JSON
--package PATHScope to a package from .locallingo.yml
-h, --helpShow help

Legacy flag aliases#

If you're migrating from a bin/translate script, the old --flag command forms still work — they print a one-line deprecation notice and map onto the new subcommands, so you can move CI and docs over incrementally.

deprecated → canonical
--status       → status
--translate    → translate
--validate     → validate
--check-quality → quality
--fix-quality  → fix-quality
--sync-state   → sync

Exit codes#

validate sets a failing exit code only under --strict / --strict-all. It returns 1 when any violation whose type is listed in the matching strict tier is present, and 0 otherwise — so it slots straight into a CI step.

translate returns 1 when any key could not be translated: it prints ⚠️ Translation finished: N keys failed and lists them. Outside --dry-run, the keys that were translated are still written and the after_translate hooks still run. Under --dry-run nothing is written, no hooks run, and failures are reported with exit code 0. Appending || true restores the old always-0 behaviour, but it also hides every other failure, such as missing credentials or a broken .locallingo.yml.