goDeepL
is a command-line tool for translating text using the DeepL API. It allows you to easily translate text between different languages, view the current API key, and update the API key.
To build the goDeepL
executable, use the following command:
go build -o ./Build/goDeepL.exe
This will generate the executable file at ./Build/goDeepL.exe
.
To translate text from one language to another, use the translate
mode:
goDeepL -mode translate -from EN -to RU -text "hello world"
or you can use the shortcuts:
goDeepL translate -from EN -to RU -text "hello world"
To display the usage help, use the help
flag:
goDeepL -help
To use the goDeepL
tool, you need a valid DeepL API key. You can update the API key using the update-key
mode:
goDeepL -mode update-key
This command will prompt you to enter a new API key.
translate
: Translates text from the source language to the target language.-from
: Specifies the source language (default:SP
).-to
: Specifies the target language (default:EN
).-text
: Specifies the text to be translated (default:"Hello!"
).
view-key
: Displays the current API key.update-key
: Updates the DeepL API key.delete-key
: Deletes the DeepL API key. (not yet implemented!)help
: Displays the usage help.
Translate text from English to Russian:
goDeepL translate -from EN -to RU -text "hello world"
Translate text from Spanish to English:
goDeepL translate -from ES -to EN -text "hola mundo!"
View usage help:
goDeepL -help
Update the DeepL API key:
goDeepL -mode update-key
View the DeepL API key:
goDeepL -mode view-key
- Ensure you have a valid DeepL API key to use the
translate
functionality. - The API key is stored in a
key.json
file in the.goDeepL
directory within your home directory.
This project is licensed under the MIT License - see the LICENSE file for details.
- DeepL API for providing the translation service.