CLI Commands
translate
Find missing translations and translate them via LLM. Requires --provider and --model for auto-translation.
Synopsis
the-i18n-cli translate
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--layer | string | no | — | Layer name (default: all locale-backed layers, aggregated) |
--ref | string | no | — | Reference locale (default: project default) |
--targets | string | no | — | Comma-separated target locales (default: all except ref) |
--keys | string | no | — | Comma-separated keys to translate (default: all missing) |
--batchSize | string | no | — | Batch size (default: 50) |
--provider=<openai|anthropic|google> | string | no | — | LLM provider: "openai", "anthropic", or "google". Required for automatic translation. |
--model | string | no | — | Model name (required when --provider is set) |
--apiKey | string | no | — | API key (falls back to OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY env). |
--baseUrl | string | no | — | Provider base URL for gateways, self-hosted models and proxies speaking the provider's protocol. Falls back to I18N_BASE_URL, then providerBaseUrl in .i18n-mcp.json. Not supported by "google". |
--dryRun | boolean | no | false | Preview what would be translated |
--failOnFailed | boolean | no | false | Exit 2 when any key failed to translate (CI gate) |
Other Names
the-i18n-cli translate-missing runs this same command with the same flags. Alias of "translate" — matches the MCP tool translate_missing.
Every command accepts the shared flags and sets one of the exit codes documented on the overview.