Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevcui/translate-cli
:speech_balloon: Use translation service in your terminal
https://github.com/kevcui/translate-cli
cli command-line command-line-tool deepl deepl-translator google-translate google-translator nodejs puppeteer
Last synced: about 2 months ago
JSON representation
:speech_balloon: Use translation service in your terminal
- Host: GitHub
- URL: https://github.com/kevcui/translate-cli
- Owner: KevCui
- License: wtfpl
- Created: 2020-03-27T14:29:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T19:55:22.000Z (8 months ago)
- Last Synced: 2024-05-21T20:55:44.098Z (8 months ago)
- Topics: cli, command-line, command-line-tool, deepl, deepl-translator, google-translate, google-translator, nodejs, puppeteer
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 18
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# translate-cli
Use web translation service in terminal, without requiring any additional API registration.
## Supported services
- [Google Translate](https://translate.google.com/)
- [DeepL](https://www.deepl.com/translator)## Dependency
- [puppeteer-core](https://github.com/puppeteer/puppeteer/): core library of puppeteer, headless Chrome
- [commander](https://github.com/tj/commander.js): argument options parser## Installation
```
npm i puppeteer-core commander
```## Usage
```
Usage: ./translate.js [-p ] [-f ] [-s ]Options:
-p, --path path to chrome/chromium binary
default "/usr/bin/chromium"
-f, --from language ISO code of text to translate
default "en"
-t, --to language ISO code of target language
default "en"
-s, --service supported service: google, deepl
default "goodle"
-h, --help display help for command
```### Examples
- Translate text to EN:
```bash
$ ./translate.js Schnappi Das Kleine Krokodil
Schnappi the little crocodil
```- Translate text to DE:
```bash
$ ./translate.js -t de 'Hold my beer'
Halte mein Bier
```- Translate text to Simplified Chinese, using DeepL:
```bash
$ ./translate.js -t zh -s deepl 'stay the fuck home'
宅在家里
```---