i18next-cli is a unified, high-performance command-line interface tool for the i18next internationalization ecosystem, currently at version 1.56.2. It leverages the Rust-based SWC parser for rapid static analysis, providing features such as automatic translation key extraction from JavaScript and TypeScript files, generation of TypeScript type definitions for improved developer experience, synchronization of locale files, and intelligent linting to detect hardcoded strings. The tool is designed to consolidate various i18next-related static analysis tasks into a single, cohesive workflow, replacing disparate scripts and older tools like `i18next-parser`. It also features a modern plugin architecture for extensibility to custom file types and workflows, and offers seamless integration with translation management platforms like Locize.
npm install i18next-cliVerified import paths — ran on the pinned version, not inferred.
Installs the CLI, sets up a basic TypeScript configuration file, and then demonstrates checking translation status and extracting keys.
Utilize the `npx i18next-cli init` command to create a new configuration file, or refer to the `i18next.config.ts` documentation for the new format. Review existing i18next-parser configurations to translate them to the new `i18next-cli` config structure.
For non-JavaScript/TypeScript file types, a dedicated plugin is required. Check the documentation for available plugins or create a custom plugin to handle specific templating languages or frameworks.
Upgrade your Node.js environment to version 22 or newer. Use a Node Version Manager (NVM) like `nvm install 22 && nvm use 22` to manage multiple Node.js versions.
Update your Node.js environment to version 22 or newer. For example, using nvm: `nvm install 22 && nvm use 22`.
Verify that the glob patterns in `i18next.config.ts` under `extract.input` correctly match your project's source files. Ensure file paths are relative to the config file's location.
Install or create a `i18next-cli` plugin for the specific file type (e.g., '.vue' files) you wish to extract keys from. Consult the 'Plugin System' section in the documentation.
No dependency data recorded yet.