@kopynator/cli
v1.4.1
Published
CLI tool for Kopynator - The i18n management solution
Maintainers
Readme
@kopynator/cli
The official Command Line Interface for Kopynator. Manage your internationalization workflow directly from your terminal.
Installation
You don't need to install it globally! We recommend using npx for the latest version:
npx -y @kopynator/cli <command>If you prefer a global installation:
npm install -g @kopynator/cliCommands
1. Initialize
Sets up Kopynator in your project. Creates the configuration file and guides you verify the setup.
npx -y @kopynator/cli init2. Check / Validate
Validates your local JSON translation files for syntax errors. Useful for CI/CD pipelines.
npx -y @kopynator/cli check3. Sync
Downloads translations from the Kopynator Cloud and saves them as local JSON files (e.g. src/assets/i18n/en.json).
npx -y @kopynator/cli sync4. Upload
Uploads a JSON translation file to the Kopynator Cloud. Keys are merged/updated for the given language. Use the same API key (token) as in your app or kopynator.config.json.
Project: The target project is determined by the token. Each token is linked to one project when created in Dashboard → Settings → Tokens. To upload to a different project, use that project’s token (e.g. another apiKey in kopynator.config.json or a separate config).
# Language inferred from filename (es.json → es)
npx -y @kopynator/cli upload --file=src/assets/i18n/es.json
# Explicit language
npx -y @kopynator/cli upload --file=locales/en.json --lang=enAfter uploading, run sync to download the latest state from the cloud if needed.
Configuration
The init command creates a kopynator.config.json file in your root:
{
"apiKey": "YOUR_API_KEY",
"defaultLocale": "en",
"languages": ["en", "es"],
"mode": "local"
}