Skip to main content

CLI

The easyi18n command downloads published files, synchronizes Xcode String Catalogs, and registers strings extracted from Dart tr() calls. Start with Getting started to create your project and configure its languages and output formats. To let an AI coding agent run these workflows, see AI agents. The command reference lists every command and option. To call the server without the CLI, see the REST API.

Version availability

This reference describes the latest CLI release, published on pub.dev and on npm as @easyi18n.com/cli. The changelog lists what each version added. Check easyi18n --version and your installed command's --help before using these workflows.

Install and authenticate​

The CLI runs on Dart 3.9 or later within Dart 3.x, on Node.js 18 or later through the npm package @easyi18n.com/cli, or as a prebuilt binary that needs neither; Install the CLI covers each method. With Dart, install the published package globally for a shell or CI environment:

dart pub global activate easyi18n_cli
easyi18n --version
easyi18n --help

Make sure Dart's global executable directory is on your PATH. In a Flutter project, you can instead keep the CLI as a development dependency:

dart pub add dev:easyi18n_cli
dart run easyi18n_cli:easyi18n --version

The examples below use the global executable. With a project dependency, replace easyi18n with dart run easyi18n_cli:easyi18n.

On your own machine, run easyi18n login once: it opens the approval page in your browser, and every command then works as you for 30 days, with your role in each workspace. easyi18n whoami shows the login and its workspaces; easyi18n logout signs it out. See login.

In CI, or for an agent whose spending should wait for an approval, use an API key instead. Create it under project Settings → API keys → New API key, or let easyi18n init --ci mint one with your login. Supply it through your shell or CI secret named EASYI18N_TOKEN; commands also accept --token, which takes precedence. Both win over the login. The CLI does not save the key in its configuration. Keep it out of source control and client application code.

OperationRequired scopes
pull, status, applyread
doctor published coverage in Mode Aread; other checks are local or use public delivery
pushtranslate
push --publishtranslate, publish; local Mode A also needs read
sync with publicationtranslate, publish, read
sync --no-publishtranslate
formats addwrite
rollbackpublish

Automatic adoption of a missing output format also needs write. The offline commands init and extract do not require a credential.

Configure a project​

With your login, a bare easyi18n init sets the project up on the server: it lists your workspaces, links a project or creates one named after the directory, adds the target languages, enables the stack's output format and writes easyi18n.yaml. --workspace, --project, --create, --languages and --base make the same choices without a terminal, and --ci mints an API key for CI and prints it once.

To link a project you already have, use the workspace handle and project slug from your app URL. For @acme/mobile-app, initialize a Flutter file integration with:

easyi18n init --workspace acme --project mobile-app --mode a

This creates easyi18n.yaml and ignores derived .easyi18n/ state in Git:

workspace: acme
project: mobile-app
mode: a
baseUrl: https://api.easyi18n.com
format: arb
output: lib/l10n
source: lib/l10n/app_en.arb
sourceRoot: lib/l10n

Use projectId instead of the workspace/project pair if you have an opaque project ID; init --project-id accepts it. Do not combine the two forms. output is a directory, relative to the config file. With an l10n.yaml, init sets it to that file's arb-dir; the default is lib/l10n. A template-arb-file that exists (app_en.arb when the file names none) becomes source: you keep adding keys to it, and pull never writes it. Before the first pull, import your existing .arb files on the Keys screen and publish, so the server has your keys and translations; pull then writes the other .arb files, named after your template (strings_es.arb next to strings_en.arb).

Without --stack, init sets up the stack doctor checks: the one it detects, else the one an existing easyi18n.yaml declares, else Flutter. CLI 1.1.0 and earlier set up Flutter whenever --stack was left out. For Flutter it detects Mode A from l10n.yaml, otherwise Mode B; --mode a or --mode b makes your choice explicit. --stack xcode, --stack web, --stack android and --stack angular name the stack; --stack auto detects it, Flutter first, and refuses a project it does not recognize.

Preview changes with init --dry-run. Re-running init uses an existing config; --force rewrites that config from the flags. An unknown YAML setting produces a warning. Omitting mode in a hand-written config means Mode B. The local mode does not change the project's dashboard setting.

Use the global --config option before the command for another config path:

easyi18n --config config/easyi18n.yaml status

Pull published files​

After enabling your output format and publishing in the app:

easyi18n pull
flutter gen-l10n

The second command applies to Flutter ARB projects. Other stacks run their own localization build step. Pull reads published snapshots, not draft edits.

OptionBehavior
--version 2026.09.19.1Download that published version; the default is latest.
--lang esDownload one locale. Not supported for .xcstrings.
--dry-runFetch and report the proposed files without writing them.
--forceReplace a file that changed since the pull that wrote it.
--watchFollow new published versions until stopped.
--interval 30Watch polling interval in seconds; minimum 5, default 30.
--require-completeCheck the published version's target-language coverage in Mode A.

Watch cannot combine with --version, --dry-run, --require-complete, or --json. It can wait for the first publication if the project is not yet published.

Pull records its writes in .easyi18n/state.json. On a later full pull into the same format and directory, it removes previously tracked files that the server no longer serves. A single-language pull does not prune files, and switching formats or output directories does not delete files from the old location. Keep .easyi18n/ ignored.

The record also holds a digest of each file the pull wrote. When one of them changed since, the next pull names it, writes and removes nothing, and exits with status 1 and the code edited_targets; --dry-run reports the same. With --json the files are listed under edited, beside error. Reformatting is not a change: JSON and ARB files are compared decoded, with their keys sorted, and other formats with their line ends folded. The @@last_modified stamp of an ARB file is not compared.

To keep the change, make it in the dashboard, publish, and pull again: a file that already says what the pull serves is kept. To discard it, run easyi18n pull --force. The record belongs to one checkout, so a file that arrived through Git from a pull on another machine reads as changed too. A String Catalog is merged, not replaced, and has no digest.

Check completeness in CI​

For a Mode A project, check without changing the checkout:

easyi18n pull --dry-run --require-complete

This exits 1 for missing translations or when completeness cannot be verified. The published snapshot must report coverage based on Skip and have at least one target language. Source-fallback snapshots, unstamped older snapshots, unrecognized coverage semantics, and backends without coverage are refused. --lang may select a target language, but selecting the base is refused.

The check concerns the selected published snapshot, including alias entries; it does not grade unpublished edits. A normal pull with --require-complete can write files before reporting the failed gate. Use --dry-run when CI must leave the checkout untouched.

status compares published version identifiers with the last pull. It does not check translation completeness or local file edits. It exits 1 if the project has never been published, has never been pulled, or is behind.

Sync an Xcode String Catalog​

Initialize from the root of your Xcode project:

easyi18n init --stack xcode --workspace acme --project ios-app
easyi18n sync --dry-run
easyi18n sync --yes --max-credits 50 --require-complete

Xcode initialization selects Mode A and format: xcstrings. It looks for an existing catalog, preferring Localizable.xcstrings and excluding InfoPlist.xcstrings from discovery. Use --catalog MyApp/Localizable.xcstrings to select the file explicitly. It does not create a catalog or add Flutter runtime files.

workspace: acme
project: ios-app
mode: a
format: xcstrings
catalog: MyApp/Localizable.xcstrings

catalog is a file path, relative to the config. sync supports this single-file catalog format and the per-locale JSON files of a web project, described below; an ARB directory is not a sync catalog.

An app with several String Catalogs lists them under catalogs: instead. They are one project: sync uploads the union of their keys, with every key keeping its name, and pull writes each key back into the file it came from. A key that is in two files, or catalog: next to catalogs:, stops the command before it sends or writes anything.

format: xcstrings
catalogs:
- MyApp/Localizable.xcstrings
- MyApp/AppShortcuts.xcstrings
- MyApp/InfoPlist.xcstrings

Sync previews changes and estimated credits, asks for consent, uploads the catalog, waits for translation, publishes, and writes the result back to the same catalog. --yes supplies consent for CI; choose a --max-credits value appropriate to your budget. The dry run still calls the server to classify and price the upload, but does not apply it or spend credits.

OptionBehavior
--no-publishUpload and translate without publishing or downloading the result.
--require-completeFail if translation remains incomplete, including exhausted pairs; with publication enabled, stop before publishing.
--on-conflict serverKeep newer project text and report conflicts; this is the default.
--on-conflict filePrefer catalog text on conflicts, including over a source correction.
--max-credits 50Refuse work exceeding the credit budget; also checked in dry run.
--forceReplace a locale file that changed since the pull that wrote it.

In a project with one file per locale, the write-back replaces the locale files. Sync stops before it uploads anything when one of them changed since the pull that wrote it, with the code edited_targets. Run easyi18n pull first, or pass --force; see Pull.

Read language and parse diagnostics in the preview. Languages present only in the catalog do not become project translation targets automatically.

For a readable local catalog, pull and sync merge served translations into .xcstrings, preserving local entries and Xcode metadata. Pull can append keys created in the dashboard; sync keeps the key set from the catalog it uploaded. They do not delete a key merely because it is absent from the server. Xcode extraction remains responsible for removing obsolete local entries. Read any base-text replacement warnings before accepting the diff. pull --lang is refused because the catalog holds all languages together.

Sync a web project with JSON catalogs​

For an app that keeps one JSON file per locale and reads it with Transloco, ngx-translate or i18next:

easyi18n init --stack web --workspace acme --project web-app
easyi18n sync --dry-run
easyi18n sync --yes --max-credits 50
workspace: acme
project: web-app
mode: a
format: json
output: public/i18n
source: public/i18n/en.json
sourceRoot: public/i18n
sourceLayout: locale-files

source is the base-language file, relative to the config. sync uploads it, waits for the translation, publishes, and writes one file per target language into output. sync and pull never write the file source names.

A base language split into several files syncs as one catalog with sourceLayout: namespaces (i18next) or sourceLayout: scopes (Transloco). Under the other layouts sync refuses it before it uploads anything, and the error names the files. Both sourceRoot and sourceLayout are required; existing configurations must add them. The web adapter needs CLI 1.0.0 or later. Web apps with JSON catalogs covers the libraries, the ICU plugin each one needs and the limits.

Sync an Angular app​

For an Angular app that translates with @angular/localize:

easyi18n init --stack angular --workspace acme --project shop
ng extract-i18n --format=json --output-path=src/locale
easyi18n sync --dry-run
easyi18n sync --yes --max-credits 50
workspace: acme
project: shop
mode: a
format: angular_json
output: src/locale
source: src/locale/messages.json
sourceRoot: src/locale
sourceLayout: locale-files

sync uploads the messages.json that ng extract-i18n writes, waits for the translation, publishes, and writes messages.<locale>.json for each target language into output. It never writes messages.json: extract it again after you change a template. The Angular adapter needs CLI 1.2.0 or later. Angular apps covers the wiring, message ids, the placeholder tokens and the limits.

Sync an Android app​

For a native Android app that keeps its strings in res/values/strings.xml:

easyi18n init --stack android --workspace acme --project shop
easyi18n sync --dry-run
easyi18n sync --yes --max-credits 50
workspace: acme
project: shop
mode: a
format: android_xml
output: app/src/main/res
source: app/src/main/res/values/strings.xml
sourceRoot: app/src/main/res/values

sync uploads source, then each values-<qualifier>/strings.xml of a target language of the project with its language, so the translations you already have are stored as they are. It names the language files it leaves out. It waits for the translation of the rest, publishes, and writes values-<qualifier>/strings.xml for each target language into output. It never writes values/strings.xml. The Android adapter needs CLI 1.0.0 or later. Android apps covers the detection, what easyi18n reads from strings.xml and the limits.

Push strings from the Flutter runtime SDK​

For a project using context.tr() or 'literal'.tr():

easyi18n init --workspace acme --project mobile-app --mode b --dry-run
easyi18n init --workspace acme --project mobile-app --mode b
flutter pub get
easyi18n extract
easyi18n push --dry-run
easyi18n push --yes --max-credits 50 --publish --require-complete

Mode B initialization adds the runtime dependency and asset directory, patches macOS network entitlements when present, declares android.permission.INTERNET in the Android main manifest when present (flutter create declares it for debug and profile builds only, so a release build could not reach delivery), and attempts to wrap runApp in Easyi18nScope. Read its report: when automatic wiring is not possible, it prints a snippet for you to apply. doctor checks the resulting integration. For SDK usage and bundled offline translations, see Flutter SDK.

extract scans lib offline. It reports extractable strings, dynamic calls, new entries, and orphans. Use --source-dir to scan another directory, relative to the config, or --fail-on-orphans to fail on strings removed from source. Variables and Dart interpolation cannot be extracted as static literals; use placeholders, for example context.tr('Welcome {name}', args: {'name': name}).

Push previews cost before registering and translating strings. Without --publish, it does not publish or wait for the fill to complete.

OptionBehavior
--dry-runPreview estimated work; register and translate nothing.
--yes, -yAccept the operation without an interactive prompt.
--max-credits 50Set a credit budget; decimal amounts are accepted.
--lang es --lang frRestrict translation targets. Explicitly selecting a manual-fill language is refused; default target selection skips manual languages.
--source-dir libChoose the source directory to scan.
--pruneRemove orphan entries from the local lockfile; never delete server translations.
--publishWait for fill and publish a new version.
--approved-onlyWith --publish, count unapproved translations as missing.
--require-completeWith --publish, stop if extracted strings remain untranslated after retries. A scan with no extractable strings is refused.

push --publish cannot combine with --dry-run. With --json, its record reports the published version in a published block. Without --require-complete, publication can proceed with missing translations: local Mode A requests Skip; otherwise the server uses the project's mode. Publication may also report values refused by validation, so read its warnings.

Commit easyi18n.lock, which tracks registered strings. For ARB projects whose strings live in files rather than tr() calls, use the pull completeness gate.

Enable output formats​

easyi18n formats add arb
easyi18n --json formats add xcstrings

This requires CLI 0.12.0 and a backend supporting the output-formats API. It adds a format without removing existing formats. A repeated add is safe; the response's created field says whether configuration changed. It does not publish or prove that a version is downloadable. File formats lists the format IDs and what each file contains.

Sync with publication and Mode A push --publish require readable format metadata and output-formats API version 1 before cost preview. If no format is configured, they can adopt the requested format after budget checks and consent, using write scope. If a different format is already configured, correct your local format or explicitly add the intended one.

Pull can recover an eligible missing-format error by adopting the format and retrying once. A read-only key cannot do that; ask a write-scope holder to enable it. A dry run never adopts and reports output_format_pending when needed. Configuration changes affect downloads of pinned versions too, and remain in place if a later translation or publication step fails.

Diagnose and maintain an integration​

CommandUse
doctorCheck config, stack wiring, ICU syntax, and delivery. Mode A also reads published coverage with your read credential. It never spends credits.
statusCompare the last pulled version with the currently published version.
applyPreview source-review corrections to Dart literals; apply --write writes them. Requires read and spends no credits. Review the diff, then push.
rollbackRestore the preceding published version as a new version. Supply a version argument to restore a specific one. Requires publish.
mcpRun the MCP server over standard input/output for an agent client; this is not a JSON batch command. See AI agents.

Doctor exits 1 for blocking findings. An unverified check can still exit 0; read the report instead of treating its exit code as a completeness gate. A base-only project has nothing to grade in doctor, but the pull completeness gate refuses it.

Rollback changes live delivery and keeps version history. Current validation rules can omit cells from the restored version; inspect its warnings.

Structured output​

Put global options before the command:

easyi18n --json status
easyi18n --json pull --dry-run --require-complete
easyi18n --json sync --dry-run
easyi18n --json push --yes --max-credits 50

JSON is supported by init, doctor, one-shot pull, extract, push, sync, apply, rollback, status, formats add, and languages add. Normal reports go to stdout and diagnostics to stderr. JSON workflows cannot prompt for consent; pass --yes for real push or sync work that requires it.

Command failures use an error object containing message, code, statusCode, and retryable. A usage error, such as an unknown option or a value the parser refuses, is the same record with code usage_error and exit 64 when --json is its own argument before any --. Without --json it is plain text on stderr with exit 64. Check the process exit status as well as JSON: some commands, such as status, return a report with a nonzero exit code. Do not blindly retry a publish or rollback after an ambiguous network failure; inspect project history to find out whether it completed.