@stackkit-translate/cli
v1.1.0
Published
CLI tools for stackkit-translate — key extraction and type generation.
Maintainers
Readme
@stackkit-translate/cli
CLI tools for the translate i18n monorepo — scan source for translation keys and generate TypeScript unions from locale JSON.
Current release: 1.0.0 — Depends on @stackkit-translate/core ^1.0.0 and @stackkit-translate/enterprise ^1.0.0 (enterprise gate for --require-license). See monorepo CHANGELOG.
Keywords: translate i18n cli extract typegen
Install
npm install -D @stackkit-translate/cli
# Or run from monorepo root: npm run extractUsage — extract keys
npx translate-extract "src/**/*.ts" "src/**/*.html" --out src/assets/i18n/en.jsonScans translate pipe, [translate] directive, t() / instant() calls, and merges keys into a locale JSON file.
Usage — typegen
npx translate-extract typegen --in src/assets/i18n/en.json --out src/translation-keys.d.tsEmits a TranslationKey string union for typed lookups.
Usage — CI with enterprise licence
TRANSLATE_LICENSE_KEY=TR-ENT-… translate-extract "src/**/*.ts" --out assets/i18n/en.json --require-licenseRequires the extract-cli module on the licence.
Commands
| Command | Description |
| --- | --- |
| translate-extract [globs…] --out <file> | Extract keys into JSON. |
| translate-extract typegen --in <locale> --out <d.ts> | Generate key union types. |
| --require-license | Fail without valid enterprise extract-cli module. |
Related packages
@stackkit-translate/core— runtime engine.@stackkit-translate/enterprise— licence validation for gated CLI.
