/install cohere-translator
Cohere Translator Skill
State-of-the-art neural machine translation using Cohere's Command A Translate model
(cohere/command-a-translate-08-2025, 111B parameters, 23 languages).
🔑 Requires a Cohere API key. The model is free for trial keys as of 2026-05-17 (1,000 calls/month, 20 req/min). Get a key at: https://dashboard.cohere.com/api-keys
⚠️ CRITICAL: Always Use File Mode to Save Tokens
When translating file content, use --file/-f mode. This bypasses the agent
entirely — the script reads the file directly and translates it. Your agent never
loads the file content into its context window.
# ❌ WASTES TOKENS: Agent reads file → passes text as CLI argument
python3 translate.py "$(cat document.txt)" --to ja
# ✅ ZERO AGENT TOKENS: Script reads file directly, agent only issues the command
python3 translate.py -f document.txt --to ja -o output.txt
This is not optional advice — it is the correct way to use this skill. Every byte of text you pass through the agent as a CLI argument doubles your token cost for no benefit. File mode eliminates this entirely.
This applies equally when using the skill from an agent (OpenClaw, Claude Code, etc.) or directly from the command line.
Quick Start
# 1. Set your Cohere API key (get one at https://dashboard.cohere.com/api-keys)
export COHERE_API_KEY="your-key-here"
# 2. Translate a file (RECOMMENDED — zero agent tokens)
python3 skills/cohere-translator/scripts/translate.py -f input.txt --to ja -o output.txt
# 3. Quick one-liner (text on command line — small texts only)
python3 skills/cohere-translator/scripts/translate.py "Hello" --to ja
# → こんにちは
Usage Modes
File Mode (RECOMMENDED)
# File → file
python3 translate.py -f document.txt --to ja -o translated.txt
# File → stdout
python3 translate.py -f document.txt --to en
# Stdin → stdout
cat document.txt | python3 translate.py -f - --to ja
# Stdin → file
cat document.txt | python3 translate.py -f - --to ja -o output.txt
# Large files auto-chunked (6,000+ chars automatically split)
python3 translate.py -f large_document.txt --to ja -o output.txt
# Output: 📄 12000 chars → 16 chunks ... ✓ 16/16
Text Mode (small texts only)
python3 translate.py "Hello world" --to ja # EN→JA
python3 translate.py "こんにちは" --to en # JA→EN
python3 translate.py "Bonjour" --to es # FR→ES
Supported Language Codes
en: English ja: Japanese zh: Chinese ko: Korean
fr: French de: German es: Spanish it: Italian
pt: Portuguese ar: Arabic ru: Russian pl: Polish
tr: Turkish vi: Vietnamese nl: Dutch cs: Czech
id: Indonesian uk: Ukrainian ro: Romanian el: Greek
hi: Hindi he: Hebrew fa: Persian
Options
-f, --file PATH Input file (or '-' for stdin). PREFERRED MODE.
-o, --output PATH Output file (default: stdout)
-t, --to CODE Target language (default: en)
--temperature FLOAT Temperature 0.1-1.0 (default: 0.3)
--max-tokens INT Max output tokens per chunk (default: 4000)
--system-prompt STR System message for constraints
--api-key KEY Cohere API key (or set COHERE_API_KEY env var)
--json Output full JSON with token counts
-q, --quiet Suppress progress messages
--list-languages List supported language codes
System Prompt Examples
# Operational constraints work well
python3 translate.py -f doc.txt --to ja \
--system-prompt "Output ONLY the translation. Keep numbers and URLs unchanged."
Note: System prompts work for operational constraints but have limited effect on translation tone/style. The model's DPO training makes translation behavior largely hardwired.
API Key
This skill requires a Cohere API key. Get a free trial key at: https://dashboard.cohere.com/api-keys
Trial keys provide: 1,000 calls/month, 20 req/min, completely free.
export COHERE_API_KEY="your-key-here"
How the Agent Should Use This Skill
[TASK] Translate /workspace/document.txt to Japanese.
# Correct:
python3 skills/cohere-translator/scripts/translate.py -f /workspace/document.txt --to ja -o /workspace/document_ja.txt
# The agent never reads document.txt. ZERO context tokens wasted on file content.
# After completion, the agent may read document_ja.txt to verify the result.
Known Limitations
- Japanese slang (2ch-style, ギャル語) may cause API errors
- System messages cannot change formality reliably
- 8K input token limit — auto-chunked for files (see translate_file())
- Idioms translate literally rather than finding cultural equivalents
- Business keigo→European loses some formality density
Quality Matrix
| Direction | Casual | Business | Technical | Idioms |
|---|---|---|---|---|
| JA↔KO | ★★★★★ | ★★★★★ | ★★★★★ | ★★★ |
| JA↔ZH | ★★★★★ | ★★★★ | ★★★★★ | ★★★ |
| EN→any | ★★★★★ | ★★★★★ | ★★★★★ | ★★★★ |
| Any→EN | ★★★★★ | ★★★★★ | ★★★★★ | ★★★★ |
| ZH↔KO | ★★★★★ | — | ★★★★★ | — |
| FR↔DE | ★★★★★ | ★★★★★ | ★★★★★ | — |
Full research: skills/cohere-translator/RESEARCH.md
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cohere-translator - 安装完成后,直接呼叫该 Skill 的名称或使用
/cohere-translator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Cohere Translator 是什么?
Neural machine translation supporting 23 languages using Cohere's Command A Translate model, optimized for file-based input to minimize token costs. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 81 次。
如何安装 Cohere Translator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cohere-translator」即可一键安装,无需额外配置。
Cohere Translator 是免费的吗?
是的,Cohere Translator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Cohere Translator 支持哪些平台?
Cohere Translator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Cohere Translator?
由 大村愛弥(@lykeion-dev)开发并维护,当前版本 v1.0.0。