DeepL CLI
A simple command-line interface (CLI) tool for translating text using DeepL API. This tool allows you to quickly and easily translate text via the command line without going to the DeepL website.
Requirements
Installation
- Clone this repository:
git clone https://github.com/kojix2/deepl-cli.git
- Change to the cloned directory:
cd deepl-cli
- Build the project using shards:
shards build
- Get a valid API key from DeepL and set it as an environment variable:
export DEEPL_API_KEY=your_api_key_here
Usage
To use the DeepL Translator CLI, simply run the deepl
command followed by the arguments you wish to pass.
$ ./bin/deepl [arguments]
Arguments
Options available for the CLI tool:
-f, --from=LANG
: Set the source language (default: AUTO). Example:-f EN
.-t, --to=LANG
: Set the target language (default: EN). Example:-t ES
.-v, --version
: Show the current version.-h, --help
: Show the help message.
Example
To translate the text "Hola mundo" from Spanish (ES) to English (EN):
$ ./bin/deepl --from ES --to EN "Hola mundo"
Hello world
$ echo "Hola mundo" | ./bin/deepl --from ES --to EN
Hello world
Contributing
If you would like to contribute to the development of this CLI tool, please follow the steps below:
- Fork this repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
License
This project is licensed under the MIT License.
Happy translating!