Registry / devops / format-message-cli

format-message-cli

JSON →
library6.2.4jsnpmunverified

Command-line tools for linting, extracting, and inlining format-message translations in JavaScript projects. Version 6.2.4 provides three main commands: lint (validate message patterns and translations), extract (collect all message patterns into a JSON/YAML file), and transform (replace pattern calls with translations, optionally inlined). Integrates with format-message and supports generating IDs from messages. CLI-only, requires format-message as a peer dependency. Differentiates from similar i18n tools by offering a complete workflow from extraction to inlining without a build plugin.

npm install format-message-cli
INSTALL
IMPORT
SIG · FORMAT-MESSAGE-CLI
F
format-message-cli
devopsjavascriptv6.2.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

lint
npx format-message lint
npm run format-message lint
Run via npx or install globally; no JavaScript import for CLI.
extract
npx format-message extract --out-file locales/en.json src/**/*.js
format-message-extract src/**/*.js
Command is 'extract' not 'extract-format-message' or similar.
transform
npx format-message transform --inline --translations locales/fr.json --locale fr src/**/*.js
format-message inline --translations ...
There is no separate 'inline' command; inlining is a flag on transform.

Install the CLI and run lint, extract, and transform commands on source files with translations.

# Install globally or use npx npm install -g format-message-cli # Lint source files and translations format-message lint --translations locales/fr.json src/**/*.js # Extract all messages to a JSON file format-message extract --out-file locales/en.json --format json src/**/*.js # Transform (inline) French translations format-message transform --inline --translations locales/fr.json --locale fr src/**/*.js --out-dir build
format-message --version
Debug
Known issues
gotchaThe CLI does not install format-message automatically; you must have format-message as a dependency or installed globally.
fix
Run 'npm install format-message' in your project or globally.
affects: >=6.0
deprecatedThe --generate-id option with 'underscored_crc32' type is deprecated and will be removed in a future version.
fix
Switch to 'underscored' or 'literal' type.
affects: >=6.0
gotchaWhen using --inline, you must provide --translations for any language other than the default; otherwise transform fails silently.
fix
Always specify --translations when using --inline for non-default locales.
affects: >=6.0
breakingSeveral commands removed in v6.0: format-message braille, format-message merge, and format-message pattern were removed.
fix
Use lint, extract, or transform instead.
affects: >=6.0
Errors
Common errors & fixes
Error: Cannot find module 'format-message'
format-message is not installed; it is a peer dependency.
fix
Run 'npm install format-message'
Missing translation for locale 'fr' and id 'xxx'
The translations file does not contain the expected message ID.
fix
Ensure your translations file includes all IDs from the extract output.
Error: Unknown option '--inline-transform'
The CLI does not have an inline-transform command; use --inline flag on transform.
fix
Use 'format-message transform --inline ...' instead.
Upgrade
Version history
6.2.4latest on npm
Audit
Dependencies
format-messagerequiredpeer dependency; the CLI processes calls to format-message in source files
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
format-message-cli — npm install format-message-cli · libregistry