https://github.com/kkinos/dt
A simple command line application to translate with DeepL API.
https://github.com/kkinos/dt
cli deepl go golang
Last synced: over 1 year ago
JSON representation
A simple command line application to translate with DeepL API.
- Host: GitHub
- URL: https://github.com/kkinos/dt
- Owner: kkinos
- License: mit
- Created: 2021-10-23T10:00:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-25T06:57:24.000Z (over 3 years ago)
- Last Synced: 2025-02-10T12:43:28.117Z (over 1 year ago)
- Topics: cli, deepl, go, golang
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dt (DeepL Translation)
[](https://github.com/kinpoko/dt/actions/workflows/go.yml)

A simple command line application to translate with DeepL API.
This application only supports DeepL API Free, and does not currently support other APIs.
## Installing
```bash
go install github.com/kinpoko/dt@latest
```
## Usage
1. Obtain an authentication key for the DeepL API. For information on how to obtain an authentication key, please see the [official documentation](https://www.deepl.com/ja/docs-api/).
2. Set the authentication key as an environment variable named `DEEPL_TOKEN`.
`.bashrc`
```bash
export DEEPL_TOKEN=
```
3. Translate text using the following command:
```bash
dt Hello World
ハロー・ワールド
```
Use the `-h` flag to view the help menu and command line options:
```bash
dt -h
A simple command line application to translate with deepl API.
Usage:
dt [text] [flags]
Flags:
-h, --help help for dt
-s, --source string source language (default "en")
-t, --target string target language (default "ja")
```
## Using Pipe
You can use `dt` with other command line utilities by piping text to the application. For example, to translate the contents of a file named text.txt, you can use the following command:
```bash
cat text.txt | xargs dt
```
This will translate the text in the `text.txt` file and output the resulting translation to the command line.