The init command initializes a new Lara project by creating a configuration file (lara.yaml) that defines localization settings for your project.
lara-cli init [options]| Option | Description |
|---|---|
-y, --non-interactive |
Run in non-interactive mode using provided options |
-f, --force |
Overwrite an existing configuration file without confirmation |
-s, --source <locale> |
Set source locale (default: en) |
-t, --target <locales> |
Set comma-separated target locales |
-p, --paths <paths> |
Set comma-separated file paths to watch (must include [locale] placeholder) |
-r, --reset-credentials |
Reset or update your Lara API credentials |
-i, --instruction <instruction> |
Set project instruction for translation quality |
-m, --translation-memories <memories> |
Set comma-separated Translation Memory IDs |
-g, --glossaries <glossaries> |
Set comma-separated Glossary IDs |
--no-trace |
Prevent server-side storage of translated content |
-h, --help |
Display help information |
Running without --non-interactive prompts for information:
lara-cli initThe command guides you through:
- Source locale selection
- Target locales detection and selection
- Translation file path configuration
- Project instructions (optional)
- Translation Memories configuration (optional)
- Glossaries configuration (optional)
- API credentials setup (if needed)
Generates configuration file using provided options:
lara-cli init --source "en" --target "es, fr" --paths "./src/i18n/[locale].json" --force --non-interactivelara-cli initlara-cli init --forcelara-cli init --source "es" --target "en, fr"lara-cli init --paths "src/locales/[locale]/messages.json, public/i18n/[locale].json"lara-cli init --source "en" --target "de, fr, it" \
--paths "src/i18n/[locale]/common.json" \
--instruction "E-commerce app, formal tone" \
--force --non-interactivelara-cli init --reset-credentialslara-cli init --no-traceThis sets noTrace: true in lara.yaml, which prevents the translation API from storing or logging your content server-side. All subsequent lara-cli translate runs will automatically use no-trace mode. You can also pass --no-trace directly to the translate command for one-off usage.