{"id":25603,"library":"format-message-cli","title":"format-message-cli","description":"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.","status":"active","version":"6.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/format-message/format-message","tags":["javascript","i18n","intl","internationalization","localization","globalization","messageformat","pluralformat","selectformat"],"install":[{"cmd":"npm install format-message-cli","lang":"bash","label":"npm"},{"cmd":"yarn add format-message-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add format-message-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the CLI processes calls to format-message in source files","package":"format-message","optional":false}],"imports":[{"note":"Run via npx or install globally; no JavaScript import for CLI.","wrong":"npm run format-message lint","symbol":"lint","correct":"npx format-message lint"},{"note":"Command is 'extract' not 'extract-format-message' or similar.","wrong":"format-message-extract src/**/*.js","symbol":"extract","correct":"npx format-message extract --out-file locales/en.json src/**/*.js"},{"note":"There is no separate 'inline' command; inlining is a flag on transform.","wrong":"format-message inline --translations ...","symbol":"transform","correct":"npx format-message transform --inline --translations locales/fr.json --locale fr src/**/*.js"}],"quickstart":{"code":"# Install globally or use npx\nnpm install -g format-message-cli\n\n# Lint source files and translations\nformat-message lint --translations locales/fr.json src/**/*.js\n\n# Extract all messages to a JSON file\nformat-message extract --out-file locales/en.json --format json src/**/*.js\n\n# Transform (inline) French translations\nformat-message transform --inline --translations locales/fr.json --locale fr src/**/*.js --out-dir build\n","lang":"javascript","description":"Install the CLI and run lint, extract, and transform commands on source files with translations."},"warnings":[{"fix":"Run 'npm install format-message' in your project or globally.","message":"The CLI does not install format-message automatically; you must have format-message as a dependency or installed globally.","severity":"gotcha","affected_versions":">=6.0"},{"fix":"Switch to 'underscored' or 'literal' type.","message":"The --generate-id option with 'underscored_crc32' type is deprecated and will be removed in a future version.","severity":"deprecated","affected_versions":">=6.0"},{"fix":"Always specify --translations when using --inline for non-default locales.","message":"When using --inline, you must provide --translations for any language other than the default; otherwise transform fails silently.","severity":"gotcha","affected_versions":">=6.0"},{"fix":"Use lint, extract, or transform instead.","message":"Several commands removed in v6.0: format-message braille, format-message merge, and format-message pattern were removed.","severity":"breaking","affected_versions":">=6.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install format-message'","cause":"format-message is not installed; it is a peer dependency.","error":"Error: Cannot find module 'format-message'"},{"fix":"Ensure your translations file includes all IDs from the extract output.","cause":"The translations file does not contain the expected message ID.","error":"Missing translation for locale 'fr' and id 'xxx'"},{"fix":"Use 'format-message transform --inline ...' instead.","cause":"The CLI does not have an inline-transform command; use --inline flag on transform.","error":"Error: Unknown option '--inline-transform'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}