Introduction
Detect and sync translation keys in your React/Next.js apps
Better i18n CLI helps you manage the entire lifecycle of your translation keys, from detecting hardcoded strings to auditing remote sync status.
Core Capabilities
scan: Find hardcoded strings that need translation.sync: Compare your localt()calls with Better i18n cloud (Remote) and detect missing or unused keys.
Why use the CLI?
Managing i18n manually is error-prone. The CLI provides a "Senior Tooling" experience to ensure your translations are always consistent and fully covered.
// ❌ Detected by 'scan'
<h1>Welcome to our app</h1>
// ✅ Analyzed by 'sync'
<h1>{t('welcome')}</h1> // Linked to 'home.welcome' namespaceInstallation
# With npx (no install needed)
npx @better-i18n/cli scan
# Or install globally
npm install -g @better-i18n/cliWorkflow
- Scan: Run
better-i18n scanto find untranslated text. - Translate: Wrap text with
t()calls using@better-i18n/next. - Sync: Run
better-i18n syncto verify your local keys exist in Better i18n cloud.
Features
- ✅ Lexical Scope Tracking - Smart namespace detection for both
useTranslationsandgetTranslations. - ✅ Server Component Support - Full support for Next.js App Router async server functions.
- ✅ Compact Tree Output - Human-readable grouping of missing/unused keys.
- ✅ Senior Audit Log - Deep transparency with
--verbose. - ✅ CI/CD Ready - Enforce 100% key coverage in your pipeline.
- ✅ Smart Filtering - Automatically ignores CSS, URLs, and constants.
Cmd+Click on any file path in the terminal to jump directly to the code in VS Code!