CLI Usage
KTTC provides a powerful command-line interface for translation quality checking.
Basic Commands
Check Single Translation
Compare Multiple Translations
kttc check source.txt translation1.txt translation2.txt translation3.txt \
--source-lang en --target-lang es
KTTC automatically detects when you provide multiple translations and compares them.
Batch Processing
Process multiple translations from a CSV file:
CSV format:
From directories:
Options
Language Options
--source-lang LANG # Source language code (e.g., en, es, fr, zh, ru)
--target-lang LANG # Target language code
Quality Threshold
Example:
Output Format
Example:
kttc check source.txt translation.txt \
--source-lang en --target-lang es \
--output-format json \
--output-file results.json
Glossary
Use a custom glossary for terminology validation:
Example:
kttc check source.txt translation.txt \
--source-lang en --target-lang es \
--glossary my-glossary.json
Glossary format:
LLM Provider
Specify which LLM provider to use:
Example:
Smart Routing
Enable smart routing for cost optimization:
This can reduce costs by up to 60%.
Verbosity
Control output verbosity:
Advanced Commands
Compare Translations Explicitly
kttc compare --source source.txt -t translation1.txt -t translation2.txt \
--source-lang en --target-lang es
Translate with QA
Translate text and automatically check quality:
Benchmark Providers
Compare different LLM providers:
kttc benchmark --source test.txt \
--providers openai,anthropic,gigachat \
--source-lang en --target-lang es
Glossary Management
kttc glossary list # List all glossaries
kttc glossary show my-glossary # Show glossary details
kttc glossary validate my-glossary # Validate glossary format
Exit Codes
KTTC uses standard exit codes for CI/CD integration:
0- Success (quality threshold met)1- Failure (quality below threshold)2- Error (invalid input, missing API key, etc.)
Example in CI/CD:
kttc check source.txt translation.txt \
--source-lang en --target-lang es \
--threshold 95.0 || exit 1
Examples
Example 1: Basic Quality Check
Example 2: High-Quality Threshold with JSON Output
kttc check en.txt es.txt \
--source-lang en --target-lang es \
--threshold 98.0 \
--output-format json \
--output-file results.json
Example 3: Batch Processing with Glossary
Example 4: Compare Three Translations
Example 5: CI/CD Integration
#!/bin/bash
# CI script for translation quality check
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"
else
echo "❌ Translation quality check failed"
exit 1
fi
Getting Help
View help for any command: