CLI Commands

write

Write translation key-value pairs to a layer. Keys are inserted in alphabetical order.

Synopsis

the-i18n-cli write --layer <layer> --translations <translations>

Flags

FlagTypeRequiredDefaultDescription
--layerstringyes—Layer name from discover (e.g., "root", "app-admin").
--translationsstringyes—Map of dot-path keys to locale-value pairs. IMPORTANT: values must be locale maps, NOT plain strings. Locale refs may be a code ("en-us"), a language ("en-US") or a file ("en-US.json"). Wrong: { "auth.failed": "Login failed" }. Correct: { "auth.failed": { "en-US": "Login failed", "de-DE": "Anmeldung fehlgeschlagen" } } Pass it as JSON.
--mode=<add|update|upsert>stringno"upsert"Write mode. "upsert": add-or-update (never fails). "add": only new keys. "update": only existing keys. Default: "upsert".
--dryRunbooleannofalseReturn a preview of what would be written without writing any files. Default: false.
Copyright © 2026