← Back to Skills Marketplace
lykeion-dev

Cohere Translator

by 大村愛弥 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
81
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install cohere-translator
Description
Neural machine translation supporting 23 languages using Cohere's Command A Translate model, optimized for file-based input to minimize token costs.
README (SKILL.md)

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

Usage Guidance
Install only if you are comfortable sending the files you translate to Cohere and using your Cohere API key/quota. Prefer environment-variable key setup, avoid translating highly sensitive documents unless permitted, and make sure curl is installed.
Capability Analysis
Type: OpenClaw Skill Name: cohere-translator Version: 1.0.0 The cohere-translator skill bundle is a legitimate tool for neural machine translation using the Cohere API. The core logic in `scripts/translate.py` uses Python's standard library and `curl` to interact with the official Cohere endpoint (api.cohere.ai), implementing robust features like script-density-aware chunking and rate-limit pacing. The instructions in `SKILL.md` and `README.md` are focused on token optimization and efficiency, specifically advising the AI agent to use file-mode to minimize context window usage. No indicators of data exfiltration, unauthorized execution, or malicious prompt injection were found.
Capability Tags
cryptocan-make-purchasesrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
The stated purpose, documentation, and visible code all align around translating user-provided text/files through Cohere. The notable user impact is that translated content is sent to an external provider.
Instruction Scope
The skill strongly recommends file mode so the agent does not load the source document into context. That is purpose-aligned for token savings, but it means the script reads the selected file directly and sends its contents for translation.
Install Mechanism
There is no install spec, and the registry lists no required binaries, but the visible script invokes curl. This is disclosed in README as using stdlib plus curl, so it is an install metadata gap rather than hidden behavior.
Credentials
Network access to Cohere and a Cohere API key are proportionate to the translation purpose. Users should consider provider privacy terms and API quota or billing effects.
Persistence & Privilege
No persistence, background worker, privilege escalation, or local credential storage is evident in the provided artifacts. The skill does handle a Cohere API key for authorized API calls.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cohere-translator
  3. After installation, invoke the skill by name or use /cohere-translator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: SOTA neural machine translation using Cohere's Command A Translate (111B, 23 languages). Free tier available (1,000 calls/month). Features: zero-agent-token file mode, script-density-aware auto-chunking, 6000-token round-trip budget, rate-limit pacing. Zero Python dependencies (stdlib + curl only).
Metadata
Slug cohere-translator
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Cohere Translator?

Neural machine translation supporting 23 languages using Cohere's Command A Translate model, optimized for file-based input to minimize token costs. It is an AI Agent Skill for Claude Code / OpenClaw, with 81 downloads so far.

How do I install Cohere Translator?

Run "/install cohere-translator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Cohere Translator free?

Yes, Cohere Translator is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Cohere Translator support?

Cohere Translator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Cohere Translator?

It is built and maintained by 大村愛弥 (@lykeion-dev); the current version is v1.0.0.

💬 Comments