-
Notifications
You must be signed in to change notification settings - Fork 662
Open
Labels
Description
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