Feature: Add lingo.dev validate command for configuration validation
Problem
Currently, users can check translation status with lingo.dev status and view files with lingo.dev show files, but there's no dedicated command to validate that:
All configured file paths actually exist Files are accessible (read/write permissions) Configuration is syntactically and semantically correct No broken file references This causes issues when copying configs between projects, after moving files, or checking setup in CI/CD before running translations.
Proposed Solution
Add a validate command that performs comprehensive configuration validation and file accessibility checks.
Use Cases
- Quick configuration check before running translations
- CI/CD quality gate to ensure valid setup
- Debugging configuration issues
- Onboarding new team members
- Post-migration validation
Proposed API
# Basic validation
lingo.dev validate
# Strict mode (treat missing target files as errors)
lingo.dev validate --strict
# With authentication check
lingo.dev validate --api-key=<key>
Expected Output
✓ Configuration file (i18n.json) exists
✓ Source locale 'en' is valid
✓ Target locales ['es', 'fr'] are valid
✓ Bucket type 'json' is supported
✓ Source file exists: src/locales/en/common.json
✓ Source file exists: src/locales/en/messages.json
⚠ Target file missing: src/locales/es/common.json (will be created)
✓ All source files are readable
✓ Target directories are writable
Validation complete: 6 checks passed, 2 warnings
Implementation Details
- New command: packages/cli/src/cli/cmd/validate.ts
- Reuses existing utilities: getConfig(), getBuckets(), checkIfFileExists()
- ~200-300 lines of code
- 2-4 hours implementation time
- Follows existing error handling patterns with CLIError
Benefits
- Early Detection: Catches setup issues before running translations
- CI/CD Integration: Can be used as a quality gate in pipelines
- Better DX: Quick feedback on configuration correctness
- No Breaking Changes: New command, doesn't modify existing behavior
Hi , please assign this to me
Can i work on this ?
Hey @sushanthach12
I have raised a PR #1425 that implements this feature. I request you to have a look at it. Feel free to let me know if there are any changes required. I have also attached a reference video that demonstrates the working on lingo.dev validate command
@navyansh007 to keep collab fair, you should first wait for the issue to be assigned to you before raising a PR.
@KrishCodesw @Kaval-Rathod would you guys prefer to join the conversation in #1425 this time instead?