AI-powered translation CLI. Translate text and files into multiple languages simultaneously using your favourite LLM provider — with a live TUI, watch mode, and a config wizard.
llmtr.example.mov
| Package | Description |
|---|---|
@llmtr/cli |
CLI with interactive TUI |
@llmtr/core |
Reusable translation API |
- Multi-language — translate into any number of target languages in one command
- Multiple providers — OpenAI, Anthropic, Google, Mistral, DeepSeek
- Watch mode — re-translate automatically whenever the source file changes
- Live TUI — real-time streaming progress per language
- Config wizard — interactive
llmtr configwith a live config card - Config walk-up — finds the nearest config file from CWD up to
~ - Pipeable —
--stdoutflag for scripting and shell pipelines - Proxy-aware — auto-reads
HTTPS_PROXY/ALL_PROXY(HTTP & SOCKS5); validates proxy URL and shows active proxy in TUI
npm install -g @llmtr/cli
# Check version
llmtr version
# Interactive setup
llmtr config
# Translate text
llmtr translate "Hello, world!" --lang zh-CN,ja,fr
# Translate a file
llmtr translate --file README.md --lang zh-CN --output ./i18n
# Watch for changes
llmtr watch content.md --lang zh-CN,de| Provider | Default Model | Env Var |
|---|---|---|
openai |
gpt-4o |
OPENAI_API_KEY |
anthropic |
claude-3-5-sonnet-20241022 |
ANTHROPIC_API_KEY |
google |
gemini-1.5-pro |
GOOGLE_API_KEY |
mistral |
mistral-large-latest |
MISTRAL_API_KEY |
deepseek |
deepseek-chat |
DEEPSEEK_API_KEY |
Run llmtr config to generate a config file, or create llmtr.config.json manually:
{
"provider": "openai",
"targetLanguages": ["zh-CN", "ja", "fr"],
"systemPrompt": "Translate naturally and preserve all formatting.",
"output": {
"directory": "./i18n",
"fileNamePattern": "{name}.{lang}{ext}"
}
}Config files are discovered by walking up from the current directory (llmtr.config.json, .llmtr.config.json, .llmtrrc, package.json#llmtr, …). The global config lives at ~/.llmtr.config.json.
Requires Node.js ≥ 22 and pnpm.
pnpm install
pnpm build # build all packages
pnpm lint:fix # lint and auto-fix
pnpm test # run testsMIT © Moozon