Skip to content

Commit c480ac5

Browse files
theAPILifeclaude
authored andcommitted
Add DeepL CLI documentation to Getting Started
Group client libraries and CLI under a new "Developer Tools" nav section, add a dedicated CLI page with installation, quick start, and capabilities, and cross-reference from the client libraries page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 451def4 commit c480ac5

3 files changed

Lines changed: 149 additions & 1 deletion

File tree

docs.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@
4141
"docs/getting-started/about",
4242
"docs/getting-started/auth",
4343
"docs/getting-started/regional-endpoints",
44-
"docs/getting-started/client-libraries",
44+
{
45+
"group": "Developer Tools",
46+
"pages": [
47+
"docs/getting-started/client-libraries",
48+
"docs/getting-started/deepl-cli"
49+
]
50+
},
4551
"docs/getting-started/managing-api-keys",
4652
"docs/getting-started/your-first-api-request",
4753
"docs/getting-started/test-your-api-requests-with-postman",
@@ -393,6 +399,10 @@
393399
"source": "/api-reference/client-libraries",
394400
"destination": "/docs/getting-started/client-libraries"
395401
},
402+
{
403+
"source": "/docs/cli",
404+
"destination": "/docs/getting-started/deepl-cli"
405+
},
396406
{
397407
"source": "/docs/resources/release-notes/rss.xml",
398408
"destination": "/docs/resources/roadmap-and-release-notes/rss.xml"

docs/getting-started/client-libraries.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ Features include:
3535

3636
All officially supported client libraries are open-source under the MIT License. We welcome feedback in the form of issues and pull requests!
3737

38+
## Command-line interface
39+
40+
For terminal-based workflows, scripting, and CI/CD pipelines, see the [DeepL CLI](/docs/getting-started/deepl-cli).
41+
3842
## Community-created client libraries
3943

4044
The DeepL community [maintains client libraries](https://github.com/DeepLcom/awesome-deepl?tab=readme-ov-file#community-libraries--sdks) for other languages, including [Dart](https://github.com/komape/deepl_dart), [Go](https://github.com/candy12t/go-deepl), [Rust](https://github.com/Avimitin/deepl-rs), and [Kotlin](https://github.com/SimplyMika/DeeplKt).

docs/getting-started/deepl-cli.mdx

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: "DeepL CLI"
3+
public: true
4+
---
5+
6+
The [DeepL CLI](https://github.com/DeepLcom/deepl-cli) is an open-source (MIT license) command-line tool for interacting with the DeepL API. It covers text translation, document translation, writing enhancement, voice translation, glossary management, and admin operations — all from your terminal.
7+
8+
<Info>
9+
The DeepL CLI is open-source under the [MIT License](https://github.com/DeepLcom/deepl-cli/blob/main/LICENSE). Contributions and feedback are welcome!
10+
</Info>
11+
12+
## Installation
13+
14+
### From npm (coming soon)
15+
16+
```bash
17+
npm install -g deepl-cli
18+
```
19+
20+
### From source
21+
22+
```bash
23+
git clone https://github.com/DeepLcom/deepl-cli.git
24+
cd deepl-cli
25+
npm install
26+
npm run build
27+
npm link
28+
29+
deepl --version
30+
```
31+
32+
<Note>
33+
The CLI uses `better-sqlite3` for local caching, which requires native compilation. Ensure you have build tools installed:
34+
- **macOS**: Xcode Command Line Tools (`xcode-select --install`)
35+
- **Linux**: `python3`, `make`, `gcc` (`apt install python3 make gcc g++`)
36+
- **Windows**: Visual Studio Build Tools
37+
</Note>
38+
39+
## Quick start
40+
41+
### 1. Set up authentication
42+
43+
Use the interactive setup wizard:
44+
45+
```bash
46+
deepl init
47+
```
48+
49+
Or set your API key directly:
50+
51+
```bash
52+
deepl auth set-key YOUR_API_KEY
53+
```
54+
55+
Or use an environment variable:
56+
57+
```bash
58+
export DEEPL_API_KEY=YOUR_API_KEY
59+
```
60+
61+
### 2. Translate text
62+
63+
```bash
64+
deepl translate "Hello, world!" --to es
65+
# ¡Hola, mundo!
66+
```
67+
68+
### 3. Enhance your writing
69+
70+
```bash
71+
deepl write "Their going to the stor tommorow" --lang en-us
72+
# They're going to the store tomorrow.
73+
```
74+
75+
## Key capabilities
76+
77+
| Command | Description |
78+
|---------|-------------|
79+
| `deepl translate` | Translate text with support for formality, context, and custom instructions |
80+
| `deepl translate --file` | Translate text files (preserves code blocks and formatting) |
81+
| `deepl document` | Translate documents (PDF, DOCX, PPTX, XLSX) with format preservation |
82+
| `deepl write` | Grammar and style enhancement via DeepL Write |
83+
| `deepl voice` | Real-time speech translation via WebSocket streaming |
84+
| `deepl watch` | Monitor files and auto-translate on change |
85+
| `deepl glossary` | Create, list, and manage glossaries |
86+
| `deepl admin` | Manage API keys, usage limits, and team access |
87+
| `deepl usage` | Check API usage and character quotas |
88+
| `deepl config` | Configure defaults (target language, formality, model) |
89+
90+
## Usage examples
91+
92+
### Translate with context and formality
93+
94+
```bash
95+
deepl translate "Thank you for your patience" --to de --formality more \
96+
--context "Customer support email to a long-standing client"
97+
```
98+
99+
### Translate a document
100+
101+
```bash
102+
deepl document translate report.pdf --to fr --output report-fr.pdf
103+
```
104+
105+
### Batch translate a directory
106+
107+
```bash
108+
deepl translate --file src/locales/en/ --to de,fr,es --output src/locales/
109+
```
110+
111+
### Watch mode for development
112+
113+
```bash
114+
deepl watch ./content/en --to de,fr --output ./content/
115+
```
116+
117+
### Git hooks integration
118+
119+
```bash
120+
deepl hooks install --pre-commit --languages de,fr
121+
```
122+
123+
## Developer workflow features
124+
125+
- **Smart caching**: Local SQLite cache with LRU eviction avoids redundant API calls
126+
- **Cost tracking**: Monitor billed characters for budget planning (`deepl usage`)
127+
- **CI/CD ready**: `--quiet` and `--no-input` flags for non-interactive pipelines
128+
- **Shell completion**: Generate completions for bash, zsh, fish, and PowerShell
129+
130+
## Further reading
131+
132+
- [DeepL CLI on GitHub](https://github.com/DeepLcom/deepl-cli) — full documentation, changelog, and source code
133+
- [DeepL API authentication](/docs/getting-started/auth) — set up your API key
134+
- [Client libraries](/docs/getting-started/client-libraries) — official SDKs for six languages

0 commit comments

Comments
 (0)