lingo.dev icon indicating copy to clipboard operation
lingo.dev copied to clipboard

Feature: Add lingo.dev validate command for configuration validation

Open sushanthach12 opened this issue 1 month ago • 3 comments

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

  1. Quick configuration check before running translations
  2. CI/CD quality gate to ensure valid setup
  3. Debugging configuration issues
  4. Onboarding new team members
  5. 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

sushanthach12 avatar Oct 29 '25 18:10 sushanthach12

Hi , please assign this to me

KrishCodesw avatar Oct 29 '25 23:10 KrishCodesw

Can i work on this ?

Kaval-Rathod avatar Oct 30 '25 11:10 Kaval-Rathod

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 avatar Oct 30 '25 15:10 navyansh007

@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?

maxprilutskiy avatar Nov 10 '25 08:11 maxprilutskiy