@jason-localise/cli
v0.2.0
Published
Official CLI for Jason — i18n translation automation platform (jason-localise.com)
Maintainers
Readme
@jason-localise/cli
Official command-line interface for Jason — the i18n translation automation platform. Translate your i18n files from your terminal, scripts, or CI/CD.
Installation
npm install -g @jason-localise/cliThis installs the jason command globally.
Quick start
# 1. Initialize config in your project
jason init
# 2. Translate your source file
jason translate --watch
# 3. Pull the translated files
jason pullConfiguration
jason init creates a .jasonrc file in your project:
{
"apiUrl": "https://jason-eo7q.onrender.com",
"apiKey": "jsk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"projectId": "cm4x9z2ab0001abc123",
"sourceFile": "./locales/fr.json",
"sourceLanguage": "fr",
"targetLanguages": ["en", "de", "es"],
"outputDir": "./locales"
}⚠️ Add
.jasonrcto your.gitignore— it contains your API key. In CI/CD, use theJASON_API_KEYenvironment variable instead.
Commands
jason init
Interactive setup. Creates a .jasonrc file in the current directory.
jason translate
Reads the source file, sends it to the Jason API, and returns a job ID.
jason translate # use config defaults
jason translate --file ./src/i18n/fr.json
jason translate --languages en,de,es
jason translate --watch # wait for completionjason status <jobId>
Show the current state of a translation job.
jason status cm5abc123xyz
jason status cm5abc123xyz --watch # poll until donejason pull
Download translations and write them to local JSON files. Auto-detects whether your source file is flat or nested and writes in the same format.
jason pull
jason pull --languages en,de
jason pull --output ./src/i18nCI/CD example — GitHub Actions
name: Translate i18n
on:
push:
branches: [main]
paths: ['locales/fr.json']
jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install -g @jason-localise/cli
- run: |
jason translate --watch
jason pull
env:
JASON_API_KEY: ${{ secrets.JASON_API_KEY }}
- run: |
git config user.name 'Jason Bot'
git config user.email '[email protected]'
git add locales/
git commit -m 'chore: update translations' || exit 0
git pushEnvironment variables
| Variable | Description |
|---|---|
| JASON_API_KEY | Overrides apiKey in .jasonrc. Use this in CI/CD. |
Requirements
- Node.js 18 or higher
- A Jason account (sign up here)
- An API key (Settings → API Keys)
License
MIT
