Delete derived target files and/or the lockfile. Destructive — runs as a dry-run unless you pass --yes.
lingo purge [--locale <code>...] [--file <substring>...] [--lockfile-only] [--yes]With no flags, purge targets every derived file for every configured target locale, plus .lingo/lock.json.
Flags#
| Flag | Effect |
|---|---|
--locale <code> | Limit to the listed target locales. Repeatable. |
--file <substring> | Limit to source paths containing this substring. Repeatable. |
--lockfile-only | Keep all target files; delete only .lingo/lock.json. |
--yes | Actually delete. Without it, purge only prints what it would remove. |
Dry run by default#
lingo purge --locale frWould delete (dry run — pass --yes to apply):
content/fr/app.json
content/fr/guide.md
...Add --yes to apply.
Examples#
Remove one locale#
lingo purge --locale ja --yesDeletes every ja target file. Pair with removing ja from targetLocales in config.
Cheap per-locale retranslation#
lingo purge --locale fr --yes
lingo push --backfill-missingDeletes the French targets, then regenerates only what's missing. Cheaper than --force because every other locale stays a cache hit. See Retranslation.
Narrow to specific files#
lingo purge --file marketing --locale de --yesDeletes German targets whose source path contains marketing.
Reset the lockfile only#
lingo purge --lockfile-only --yesKeeps every translation on disk but drops .lingo/lock.json. The next lingo push re-hashes all sources from scratch. Use when the lockfile is out of sync with what's actually on disk.
There's no undo
purge --yes deletes files immediately. If your translations aren't committed to git, they're gone. Run without --yes first to confirm the file list.
Coming from the legacy CLI?#
The legacy CLI's purge also filtered by --key and --bucket. The current CLI filters by --locale and --file (source path substring) only. To clear specific keys, edit or delete them at the source and re-run lingo push.
