Skip to content

CLI — Audit & Reports

Audit and reporting commands — check, prune, stale, export, import, stats. For scaffolding and generation commands (init, add, merge, types, split, merge-ns), see CLI — Scaffolding & Codegen.

check — Audit translation completeness

Reads all .json files in the locales directory and reports missing or extra keys compared to the reference locale.

bash
vue-i18n-kit check
vue-i18n-kit check --default en --dir src/i18n

# Exit with code 1 if any keys are missing (useful in CI)
vue-i18n-kit check --default en --fail
FlagDefaultDescription
--dir <path>src/localesLocales directory.
--default <locale>first alphabeticallyReference locale.
--failfalseExit with code 1 if any keys are missing.

CI integration (GitHub Actions):

yaml
- name: Check i18n completeness
  run: npx vue-i18n-kit check --default en --fail

prune — Remove unused keys

Scans source files for t(), tm(), $t() calls and removes any locale keys not referenced anywhere in the project.

bash
vue-i18n-kit prune --dry
vue-i18n-kit prune
vue-i18n-kit prune --entries i18n-tools/locales.entries.json
FlagDefaultDescription
--dir <path>src/localesLocales directory.
--entries <file>(scan)Path to a pre-built locales.entries.json; skips scanning.
--dryfalsePrint keys that would be removed, without writing files.
--yesfalseSkip confirmation prompt.
--ignore <patterns>(none)Comma-separated key patterns to never remove (e.g. "status.*,legacy.*").

Tip: Run prune --dry in CI and fail the build if output is non-empty to enforce a "no dead keys" policy.

stale — Show outdated translations

Reports keys whose reference locale value has changed since the translation was last reviewed. Requires staleTracking: true in i18n-kit.config.json.

bash
vue-i18n-kit stale

Output:

Stale keys (reference locale changed since last review):
  buttons.submit      stored: "Submit"  →  current: "Submit form"
  errors.auth.invalid  stored: "Invalid"  →  current: "Invalid credentials"

export — Export for translators (XLIFF / PO)

Exports a locale to XLIFF 1.2 or Gettext PO format, ready to send to a professional translation agency or CAT tool.

bash
vue-i18n-kit export --locale ru
vue-i18n-kit export --locale ru --format po --out translations/ru.po
vue-i18n-kit export --locale ru --format xliff --ref en
FlagDefaultDescription
--locale <code>Required. Locale to export.
--format <xliff|po>xliffOutput format.
--out <path><locale>.<format>Output file path.
--dir <path>src/localesLocales directory.
--ref <code>first in configReference locale (source language).

import — Import from XLIFF / PO

Reads a completed XLIFF or PO file from a translator and writes the translated values back into the locale JSON file.

bash
vue-i18n-kit import ru.xliff
vue-i18n-kit import translations/ru.po --dry

The target locale code is read from the file itself. Only keys present in the import file are updated; unrelated keys are left untouched.

Coverage report (vue-i18n-kit stats)

Get a quick snapshot of translation completeness without opening the editor.

bash
vue-i18n-kit stats
vue-i18n-kit stats --format json --out ci-report.json
vue-i18n-kit stats --format html

Console output:

  vue-i18n-kit stats  2026-04-11
  35 keys · 3 locales

  Coverage
  🇬🇧 English (en)    ████████████████████  100%
  🇷🇺 Русский (ru)    ████████████████░░░░   89%  4 missing
  🇩🇪 Deutsch (de)    ███████████████░░░░░   77%  8 missing

GitHub Actions example:

yaml
- name: Check i18n coverage
  run: |
    npx vue-i18n-kit stats --format json --out coverage.json
    node -e "
      const r = require('./coverage.json');
      const low = r.locales.filter(l => l.coverage < 80);
      if (low.length) { console.error('Low coverage:', low.map(l => l.code + ' ' + l.coverage + '%')); process.exit(1); }
    "
OptionDescription
--format consoleTerminal output with ANSI colours (default)
--format jsonMachine-readable JSON; writes to stdout or --out
--format htmlSelf-contained HTML file (default: i18n-stats.html)
--out <path>Write to file instead of stdout (json/html)
--dir <path>Locales directory (default: src/locales)