---
updatedAt: 2026-03-24T14:04:38.000Z
agentTools:
  projectIndex: https://developers.laratranslate.com/llms.txt
---

# Introduction to Lara CLI

# What It Does

The Lara CLI brings powerful translation capabilities directly to your command line and development workflows. By providing a streamlined interface to Lara's translation engine, it enables developers to integrate accurate, context-aware, and culturally nuanced translations into their projects with minimal configuration.

The CLI acts as a direct bridge between your development environment and Lara's Translation Language Models. It allows you to perform professional-grade translations without leaving your terminal, making it ideal for automating translation tasks, integrating with CI/CD pipelines, or quickly translating content during development.

The tool supports features such as automatic source language detection, context injection, and custom instructions to guide translation behavior. These capabilities make it possible to tailor translation output to match the tone, style, or intent of your content—whether it's technical documentation, user-facing text, or creative writing.

## API Credentials

To use the Lara CLI, you must have valid API credentials.

1. Visit [Lara Translate](https://laratranslate.com) and subscribe to any plan (including the free one).
2. Go to the **API** section in your account dashboard and generate a new pair of credentials.
3. Store your credentials securely. If lost, you will need to generate a new pair.

# Supported File Formats

Lara Cli supports multiple internationalization file formats. The appropriate parser is automatically selected based on the file extension.

## Available Formats

| Format           | Extension     | Description                                                                        | Documentation                                                                                                                                                                           |
| ---------------- | ------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **JSON**         | `.json`       | Nested or flat JSON structures commonly used in JavaScript/TypeScript applications | Built-in support                                                                                                                                                                        |
| **PO**           | `.po`         | Gettext Portable Object files commonly used in PHP, Python, and other platforms    | <Anchor label="PO Files Guide" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/files/po-files.md">PO Files Guide</Anchor>                            |
| **TS**           | `.ts`         | TypeScript files commonly used in Vue.js applications                              | <Anchor label="TS Files Guide" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/files/ts-files.md">TS Files Guide</Anchor>                            |
| **Vue**          | `.vue`        | Vue I18n single-file components                                                    | <Anchor label="Vue Files Guide" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/files/vue-files.md">Vue Files Guide</Anchor>                         |
| **Markdown/MDX** | `.md`, `.mdx` | Markdown and MDX files for documentation, blogs, and content sites                 | <Anchor label="Markdown Files Guide" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/files/md-files.md">Markdown Files Guide</Anchor>                |
| **Android XML**  | `.xml`        | Android string resource files commonly used in Android applications                | <Anchor label="Android XML Files Guide" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/files/android-xml-files.md">Android XML Files Guide</Anchor> |

## How It Works

The file format is automatically detected based on the file extension:

* Files ending with `.json` are parsed as JSON
* Files ending with `.po` are parsed as PO (gettext) files
* Files ending with `.ts` are parsed as TypeScript files
* Files ending with `.vue` are parsed as Vue.js I18n single-file components
* Files ending with `.md` or `.mdx` are parsed as Markdown/MDX files
* Files ending with `.xml` are parsed as Android XML string resource files

You can configure multiple formats simultaneously in the same project by adding different format sections under the `files` configuration.

## Configuration Example

```yaml
files:
  json:
    include:
      - 'src/i18n/[locale].json'
  po:
    include:
      - 'locales/[locale]/LC_MESSAGES/messages.po'
  ts:
    include:
      - 'src/i18n.ts'
  md:
    include:
      - 'docs/[locale]/*.md'
  xml:
    include:
      - 'res/[locale]/strings.xml'
```

<br />

## Technology Stack

Lara Cli is built with modern technologies to ensure reliability, performance, and maintainability:

* **TypeScript** - For type safety and developer experience
* **Commander.js** - For CLI argument parsing and command structure
* **Zod** - For robust schema validation
* **Inquirer.js** - For interactive command-line user interfaces
* **Lara Translation API** - For high-quality, context-aware translations

The codebase follows a modular architecture with clear separation of concerns, making it easy to extend and maintain.

## Supported Locales

Lara Cli supports translations using different locale codes, following two main standards:

See the [full list of supported locales](https://developers.laratranslate.com/docs/supported-languages).

## Documentation

For detailed documentation on using Lara Cli:

### Configuration

* <Anchor label="Configuration Overview" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/README.md">Configuration Overview</Anchor> - Configuration system overview
* <Anchor label="Supported Formats" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/formats.md">Supported Formats</Anchor> - Supported file formats (JSON, PO, etc.)
* <Anchor label="Locales Configuration" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/locales.md">Locales Configuration</Anchor> - Configure source and target languages
* <Anchor label="Files Configuration" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/files.md">Files Configuration</Anchor> - Configure file paths and patterns
* [Instructions](https://github.com/translated/lara-cli/blob/main/docs/config/instructions.md) - Configure translation instructions
* [Translation Memories](https://github.com/translated/lara-cli/blob/main/docs/config/memories.md) - Configure Translation Memories
* [Glossaries](https://github.com/translated/lara-cli/blob/main/docs/config/glossaries.md) - Configure Glossaries

### Commands

* <Anchor label="Init Command" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/commands/init.md">Init Command</Anchor> - Initialize your project
* <Anchor label="Translate Command" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/commands/translate.md">Translate Command</Anchor> - Translate your files
* <Anchor label="Memory Command" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/commands/memory.md">Memory Command</Anchor> - List available Translation Memories
* <Anchor label="Glossary Command" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/commands/glossary.md">Glossary Command</Anchor> - List available Glossaries

### Format-Specific Guides

* <Anchor label="PO Files Guide" target="_blank" href="https://github.com/translated/lara-cli/blob/main/docs/config/files/po-files.md">PO Files Guide</Anchor> - Complete guide for gettext PO files