translate-cli icon indicating copy to clipboard operation
translate-cli copied to clipboard

:speech_balloon: Use translation service in your terminal

translate-cli

Use web translation service in terminal, without requiring any additional API registration.

Supported services

Dependency

Installation

npm i puppeteer-core commander

Usage

Usage: ./translate.js [-p <path>] [-f <from_lang] [-t <to_lang>] [-s <service>] <text>

Options:
  -p, --path <binary_path>  path to chrome/chromium binary
                            default "/usr/bin/chromium"
  -f, --from <lang_iso>     language ISO code of text to translate
                            default "en"
  -t, --to <lang_iso>       language ISO code of target language
                            default "en"
  -s, --service <service>   supported service: google, deepl
                            default "goodle"
  -h, --help                display help for command

Examples

  • Translate text to EN:
$ ./translate.js Schnappi Das Kleine Krokodil
Schnappi the little crocodil
  • Translate text to DE:
$ ./translate.js -t de 'Hold my beer'
Halte mein Bier
  • Translate text to Simplified Chinese, using DeepL:
$ ./translate.js -t zh -s deepl 'stay the fuck home'
宅在家里

Buy Me A Coffee