Command Line Interface
Translate your project with a few simple commands using Lingo.dev's powerful CLI tool.
Quick Start
1. Authenticate
Before using any commands, authenticate with your Lingo.dev account:
npx lingo.dev@latest auth
For detailed authentication options, see the Authentication Guide.
Essential Commands
Translate Your Project
The i18n
command is the core of Lingo.dev's functionality:
npx lingo.dev@latest i18n
This single command:
- Scans your source files for content
- Identifies new or modified text
- Translates only what's changed
- Updates your translation files
- Maintains the lockfile for tracking
Command Options
Option | Description | Example |
---|---|---|
--locale <code> | Target specific language | --locale fr |
--bucket <type> | Process specific file types | --bucket json |
--frozen | Verify translations without updating | --frozen |
--force | Retranslate everything | --force |
Common Workflows
Target a Specific Language
npx lingo.dev@latest i18n --locale fr
Process Only Certain File Types
npx lingo.dev@latest i18n --bucket json
Verify Translations in CI/CD
npx lingo.dev@latest i18n --frozen
Refresh All Translations
Useful after changing AI context settings:
npx lingo.dev@latest i18n --force
Combine Options for Precision
npx lingo.dev@latest i18n --force --bucket json
Configuration Management
View Your Current Setup
npx lingo.dev@latest show config
Check Available Languages
View source languages:
npx lingo.dev@latest show locale sources
View target languages:
npx lingo.dev@latest show locale targets
Best Practices
Version Control: Always commit your
i18n.lock
file to track translation changesCI Integration: Add translation verification to your pipeline:
bashnpx lingo.dev@latest i18n --frozen
After Context Changes: Refresh translations when you modify AI settings:
bashnpx lingo.dev@latest i18n --force
Automation: Integrate with your build process for seamless localization
Bucket Usage: The
--bucket
flag targets entire file types (json, markdown, etc.)File Exclusion: Use the
exclude
array ini18n.json
rather than CLI filtering
With these commands, you can efficiently manage translations across your entire project, keeping your localized content in sync with development.