{"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,"search_vec":"'6.2.4':22 'build':89 'call':46 'cli':4,63 'cli-on':62 'collect':34 'command':6,26 'command-lin':5 'complet':81 'depend':72 'differenti':73 'extract':11,33,84 'file':41 'format':2,15,54,67 'format-messag':14,53,66 'format-message-c':1 'generat':58 'global':96 'i18n':76,92 'id':59 'inlin':13,50,86 'integr':51 'internation':94 'intl':93 'javascript':19,91 'json/yaml':40 'line':7 'lint':10,27 'local':95 'main':25 'messag':3,16,29,36,55,61,68 'messageformat':97 'offer':79 'option':49 'pattern':30,37,45 'peer':71 'plugin':90 'pluralformat':98 'project':20 'provid':23 'replac':44 'requir':65 'selectformat':99 'similar':75 'support':57 'three':24 'tool':8,77 'transform':43 'translat':17,32,48 'valid':28 'version':21 'without':87 'workflow':82","created_at":"2026-05-01T13:45:37.235325+00:00","updated_at":"2026-05-01T13:45:37.235325+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"format-message","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/format-message/format-message","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/format-message-cli","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","workflow","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}