Add show stats CLI command to generate translation coverage reports (#1502) #1505
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new CLI command to Lingo.dev that reports translation coverage across all locales — helping developers and localization teams quickly spot missing translations before release.
✨ Features
New command:
npx lingo.dev@latest show statsScans locale files and computes:
Total / Translated / Missing keys per locale
Coverage % with color indicators
🟢 ≥90% 🟡 ≥70% 🔴 <70%
Lists missing keys grouped by locale and file
Non-blocking (exit code 0)
🛠 Implementation
Added packages/cli/src/commands/show/stats.tsRegistered under the show command group
Added utilities in i18n.ts for file discovery + key flattening
Added tests for key counting and missing-key detection
Updated CLI help and README with examples
🔮 Next Steps
Support additional formats (YAML, PO, TS)
Add
--ref-locale flagOption to fail CI on low coverage
✅ Compatibility
Additive change , no breaking updates to existing commands or APIs.