Getting Started
Prerequisites
- Node.js 18+
- An LLM API key — OpenAI, Anthropic, Google, or a local Ollama instance. See Providers for details.
- A source locale file — at least one JSON, TypeScript, YAML, or PO file with your source strings.
1. Install
pnpm add -D koto-i18nnpm install -D koto-i18nyarn add -D koto-i18nbun add -D koto-i18n2. Run the init wizard
npx koto initkoto auto-detects your framework, i18n library, and existing locale files:
koto v0.1.0
┌ Detected
│
│ Framework: Next.js 14
│ i18n library: next-intl
│ Source: src/locales/en.json (214 keys)
│
└
◆ Which LLM provider?
│ ● OpenAI (gpt-4o-mini — fast & cheap)
│ ○ Anthropic (claude-sonnet — high quality)
│ ○ Google (gemini-2.5-flash — fast & cheap)
│ ○ Ollama (local, free, private)
◆ Target locales?
│ ◼ 🇪🇸 es ◼ 🇫🇷 fr ◼ 🇩🇪 de ◼ 🇯🇵 ja
✔ Created koto.config.ts
✔ Created koto.lock
3. Set your API key
export OPENAI_API_KEY=sk-...export ANTHROPIC_API_KEY=sk-ant-...export GOOGLE_API_KEY=...No API key needed — just make sure Ollama is running:
ollama serve4. Translate
npx koto translate koto v0.1.0
Translating → 🇪🇸 🇫🇷 🇩🇪 🇯🇵 (4 locales)
🇪🇸 es 214/214 ✓
🇫🇷 fr 214/214 ✓
🇩🇪 de 214/214 ✓
🇯🇵 ja 214/214 ✓
✓ 856 translations written in 4.7s
Quality score: 97/100
What just happened?
- Diff — koto compared your source locale against each target. Only new or changed keys were queued.
- Translate — Pending keys were sent to your LLM with the appropriate context profile, batched for speed.
- Write — Translated strings were written to your target locale files. A lockfile (
koto.lock) was updated so the next run skips unchanged keys.
Files created
| File | Purpose |
|---|---|
koto.config.ts | Project configuration |
koto.lock | Content hashes for incremental translation — commit this |
src/locales/es.json | Translated locale files (one per target) |
Next steps
- Context profiles — give different sections of your app different translation tones
- Type safety — generate TypeScript types from your translation keys
- CI/CD — translate automatically on every PR
- CLI reference — all commands and flags