Skip to content

CLI Overview

The CLI is included with @localive/cli:

Terminal window
npm install @localive/cli

Or run directly:

Terminal window
npx localive <command> [options]
CommandDescription
extractExtract translation keys from source files
validateCompare extracted keys against locale files
syncAdd missing keys to locale files
typesGenerate TypeScript type declarations
OptionDescription
--jsonOutput structured JSON instead of human-readable text
--helpShow help for any command
Terminal window
# Extract keys from your source code
localive extract --source src --json
# Validate locale files against extracted keys
localive validate --source src --locale-file src/locales/en.json
# Sync missing keys into locale files
localive sync --source src --locale-file src/locales/fr.json --source-locale en
# Generate TypeScript types
localive types --locale-file src/locales/en.json --out src/i18n.d.ts