Skip to content

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:

bash
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:

bash
npx lingo.dev@latest i18n

This single command:

  1. Scans your source files for content
  2. Identifies new or modified text
  3. Translates only what's changed
  4. Updates your translation files
  5. Maintains the lockfile for tracking

Command Options

OptionDescriptionExample
--locale <code>Target specific language--locale fr
--bucket <type>Process specific file types--bucket json
--frozenVerify translations without updating--frozen
--forceRetranslate everything--force

Common Workflows

Target a Specific Language

bash
npx lingo.dev@latest i18n --locale fr

Process Only Certain File Types

bash
npx lingo.dev@latest i18n --bucket json

Verify Translations in CI/CD

bash
npx lingo.dev@latest i18n --frozen

Refresh All Translations

Useful after changing AI context settings:

bash
npx lingo.dev@latest i18n --force

Combine Options for Precision

bash
npx lingo.dev@latest i18n --force --bucket json

Configuration Management

View Your Current Setup

bash
npx lingo.dev@latest show config

Check Available Languages

View source languages:

bash
npx lingo.dev@latest show locale sources

View target languages:

bash
npx lingo.dev@latest show locale targets

Best Practices

  1. Version Control: Always commit your i18n.lock file to track translation changes

  2. CI Integration: Add translation verification to your pipeline:

    bash
    npx lingo.dev@latest i18n --frozen
  3. After Context Changes: Refresh translations when you modify AI settings:

    bash
    npx lingo.dev@latest i18n --force
  4. Automation: Integrate with your build process for seamless localization

  5. Bucket Usage: The --bucket flag targets entire file types (json, markdown, etc.)

  6. File Exclusion: Use the exclude array in i18n.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.