CLI Commands

translate

Find missing translations and translate them via LLM. Requires --provider and --model for auto-translation.

Synopsis

the-i18n-cli translate

Flags

FlagTypeRequiredDefaultDescription
--layerstringnoLayer name (default: all locale-backed layers, aggregated)
--refstringnoReference locale (default: project default)
--targetsstringnoComma-separated target locales (default: all except ref)
--keysstringnoComma-separated keys to translate (default: all missing)
--batchSizestringnoBatch size (default: 50)
--provider=<openai|anthropic|google>stringnoLLM provider: "openai", "anthropic", or "google". Required for automatic translation.
--modelstringnoModel name (required when --provider is set)
--apiKeystringnoAPI key (falls back to OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY env).
--baseUrlstringnoProvider 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".
--dryRunbooleannofalsePreview what would be translated
--failOnFailedbooleannofalseExit 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.

Copyright © 2026