CLI Reference
Complete reference for KTTC command-line interface.
Main Command
Global Options
--version- Show version and exit--help- Show help message and exit-v, --verbose- Increase verbosity-q, --quiet- Decrease verbosity
Commands
check
Check translation quality.
Arguments:
SOURCE- Source text file or directoryTRANSLATION- Translation file(s) or directory
Options:
--source-lang LANG- Source language code (e.g., en, es, fr)--target-lang LANG- Target language code--threshold SCORE- Minimum MQM score (default: 95.0)--glossary FILE- Path to glossary JSON file--provider PROVIDER- LLM provider (openai, anthropic, gigachat, yandexgpt)--output-format FORMAT- Output format (text, json, yaml)--output-file FILE- Save results to file--smart-routing- Enable complexity-based routing
Examples:
# Basic check
kttc check source.txt translation.txt --source-lang en --target-lang es
# With glossary and custom threshold
kttc check source.txt translation.txt \
--source-lang en --target-lang es \
--glossary terms.json \
--threshold 98.0
# JSON output
kttc check source.txt translation.txt \
--source-lang en --target-lang es \
--output-format json \
--output-file results.json
batch
Process multiple translations from a file.
Options:
--file FILE- Input CSV or JSON file with translations--glossary FILE- Path to glossary JSON file--output-format FORMAT- Output format (text, json, yaml)--output-file FILE- Save results to file--parallel N- Number of parallel workers
CSV Format:
Examples:
# Process batch from CSV
kttc batch --file translations.csv
# With parallel processing
kttc batch --file translations.csv --parallel 4
# Save results to JSON
kttc batch --file translations.csv \
--output-format json \
--output-file results.json
compare
Compare multiple translations.
Options:
--source FILE- Source text file-t, --translation FILE- Translation file (can be used multiple times)--source-lang LANG- Source language code--target-lang LANG- Target language code--output-format FORMAT- Output format
Example:
kttc compare --source source.txt \
-t translation1.txt \
-t translation2.txt \
-t translation3.txt \
--source-lang en --target-lang es
translate
Translate text with automatic QA.
Options:
--text TEXT- Text to translate--file FILE- File to translate--source-lang LANG- Source language code--target-lang LANG- Target language code--provider PROVIDER- LLM provider--glossary FILE- Glossary file
Examples:
# Translate text
kttc translate --text "Hello, world!" \
--source-lang en --target-lang es
# Translate file
kttc translate --file source.txt \
--source-lang en --target-lang es \
--provider anthropic
benchmark
Benchmark different LLM providers.
Options:
--source FILE- Source text file--providers LIST- Comma-separated provider list--source-lang LANG- Source language code--target-lang LANG- Target language code
Example:
kttc benchmark --source test.txt \
--providers openai,anthropic,gigachat \
--source-lang en --target-lang es
glossary
Manage glossaries.
Subcommands:
list- List all glossariesshow NAME- Show glossary detailsvalidate FILE- Validate glossary formatcreate- Create new glossary (interactive)
Examples:
# List glossaries
kttc glossary list
# Show specific glossary
kttc glossary show my-glossary
# Validate glossary
kttc glossary validate technical-terms.json
Exit Codes
0- Success (quality threshold met)1- Failure (quality below threshold)2- Error (invalid input, missing API key, etc.)
Configuration
KTTC can be configured via:
- Command-line options (highest priority)
.kttc.ymlin current directory~/.kttc.ymlin home directory- Environment variables (lowest priority)
See Configuration for details.
Environment Variables
KTTC_OPENAI_API_KEY- OpenAI API keyKTTC_ANTHROPIC_API_KEY- Anthropic API keyKTTC_GIGACHAT_CLIENT_ID- GigaChat client IDKTTC_GIGACHAT_CLIENT_SECRET- GigaChat client secretKTTC_YANDEXGPT_API_KEY- YandexGPT API keyKTTC_YANDEXGPT_FOLDER_ID- YandexGPT folder IDKTTC_DEFAULT_PROVIDER- Default providerKTTC_DEFAULT_THRESHOLD- Default quality threshold
Examples
CI/CD Integration
#!/bin/bash
# Check translation quality in CI/CD
kttc check source.txt translation.txt \
--source-lang en --target-lang es \
--threshold 95.0 \
--output-format json \
--output-file qa-report.json
if [ $? -eq 0 ]; then
echo "✅ Translation quality check passed"
exit 0
else
echo "❌ Translation quality check failed"
cat qa-report.json
exit 1
fi
Batch Processing with Glossary
kttc batch --file translations.csv \
--glossary technical-terms.json \
--parallel 8 \
--output-format json \
--output-file batch-results.json