You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [Unreleased]
9
+
10
+
## [1.2.0] - 2026-04-25
11
+
12
+
### Added
13
+
14
+
-**write**: Japanese (`ja`), Korean (`ko`), and Simplified Chinese (`zh`, `zh-Hans`) are now accepted target languages for `deepl write`.
15
+
-**write**: `--tone` and `--style` now apply to Spanish (`es`), Italian (`it`), French (`fr`), and Portuguese (`pt`, `pt-BR`, `pt-PT`) in addition to the previously supported locales. The full value lists on `--tone` and `--style` are unchanged — the same 9 styles and 9 tones are accepted, and the mutual-exclusion rule between `--style` and `--tone` is unchanged. See `docs/API.md` for supported target-language / style / tone combinations.
16
+
-**write**: 4xx responses from the Write API that arrive while `--style` or `--tone` is set now carry an explicit recovery hint pointing at `docs/API.md` for supported target-language / style / tone combinations.
17
+
-**style-rules**: Full CRUD — `deepl style-rules create|show|update|delete` alongside the existing `list`. `create` requires `--name` and `--language`. `update` accepts `--name` for a rename and `--rules` for replacing configured rules (PUT `/configured_rules`); at least one is required. `--rules` takes a JSON object of category → settings, e.g. `'{"punctuation":{"quotation_mark":"use_guillemets"}}'` — matching the DeepL API's two-level rule shape. `delete` supports `-y`/`--yes`, `--dry-run`, and a TTY confirmation prompt. All new subcommands support `--format text|json`. Text-format output sanitizes control characters from rule names, configured-rule keys/values, and instruction text.
18
+
-**style-rules**: Custom instructions management — `deepl style-rules instructions <style-rule-id>` (list, synthesized from the detailed `show` response), plus `add-instruction <style-id> <label> <prompt>`, `update-instruction <style-id> <label> <prompt>`, and `remove-instruction <style-id> <label>` subcommands. `remove-instruction` ships `-y`/`--yes`, `--dry-run`, and a TTY confirmation prompt (custom instructions are user-authored text and deserve confirmation before deletion).
19
+
-**style-rules**: `deepl style-rules list` and `deepl style-rules instructions <style-rule-id>` accept `--format table` for aligned column output via `cli-table3`, matching the existing `translate`, `languages`, `usage`, and `cache` commands. In non-TTY output (pipe, redirect, CI), table falls back to plain text with a `WARN` line on stderr — same pattern used by `deepl translate --format table`.
-**examples**: `examples/36-write-extended-languages.sh` — `deepl write` with Japanese, Korean, and Simplified Chinese targets and tone / style applied to Spanish, Italian, French, and Portuguese variants.
22
+
23
+
### Fixed
24
+
25
+
-**languages / cache stats / usage**: `--format table` now actually renders a `cli-table3` table on these commands. Previously the flag was advertised in `--help` but the action handler only branched on `'json'`, so `--format table` silently produced text output. Same non-TTY fallback as the other table commands.
26
+
-**sync**: `deepl sync export --output <path>` (and other sync surfaces that call `assertPathWithinRoot`) no longer reject valid output paths under a project root that contains a symlink in its ancestor chain. The containment check now resolves both sides through `fs.realpath` before comparing, so a project under macOS `/tmp` (a symlink to `/private/tmp`) — or any other symlinked directory — works regardless of which form the user types or the engine captures. Symlink-based escape attempts (a symlink inside the project pointing outside) are now also rejected as a defense-in-depth bonus.
27
+
28
+
### Security
29
+
30
+
-**api**: Server-returned error messages are now passed through `sanitizeForTerminal` before being interpolated into the user-facing `API error: …` and `Server error (5xx): …` strings emitted from `src/api/http-client.ts`. Defense-in-depth against a buggy or malicious server scribbling ANSI escape codes or other terminal control characters on the user's terminal via the error path. Mirrors the existing TMS-client hardening; no change to error-message wording when the server payload is well-formed.
Complete reference for all DeepL CLI commands, options, and configuration.
7
7
@@ -664,15 +664,15 @@ deepl write [OPTIONS] TEXT
664
664
665
665
#### Description
666
666
667
-
Enhance text quality with AI-powered grammar checking, style improvement, and tone adjustment. Supports 8 languages.
667
+
Enhance text quality with AI-powered grammar checking, style improvement, and tone adjustment. Supports 14 target languages.
668
668
669
669
**File Detection:** The command automatically detects if the text argument is a file path. If a file exists at that path, it operates on the file; otherwise, it treats the argument as text to improve.
670
670
671
671
#### Options
672
672
673
673
**Language:**
674
674
675
-
-`--lang, -l LANG` - Target language: `de`, `en`, `en-GB`, `en-US`, `es`, `fr`, `it`, `pt`, `pt-BR`, `pt-PT`. Optional — omit to auto-detect the language and rephrase in the original language.
675
+
-`--lang, -l LANG` - Target language: `de`, `en`, `en-GB`, `en-US`, `es`, `fr`, `it`, `ja`, `ko`, `pt`, `pt-BR`, `pt-PT`, `zh`, `zh-Hans`. Optional — omit to auto-detect the language and rephrase in the original language.
676
676
-`--to LANG` - Long-only alias of `--lang`. Accepts the same language values. Provided for muscle-memory consistency with `deepl translate --to`; the short form `-t` is intentionally **not** bound here (it would collide with `deepl translate -t, --to`). Specifying both `--to` and `--lang` with different values exits with a `ValidationError`.
677
677
678
678
**Style Options (mutually exclusive with tone):**
@@ -695,6 +695,16 @@ Enhance text quality with AI-powered grammar checking, style improvement, and to
695
695
-`diplomatic` - More careful and tactful
696
696
-`prefer_enthusiastic`, `prefer_friendly`, etc. - Soft preferences
When `--style` or `--tone` is set for a target language that does not support it, the server returns a 4xx; the CLI converts that response into a `ValidationError` (exit code 6) that names the unsupported combination and points back to this table.
707
+
698
708
**Output Options:**
699
709
700
710
-`--alternatives, -a` - Show all improvement alternatives
-`--format <format>` - Output format: `text`, `json`, `table` (default: `text`). In non-TTY output, `table` falls back to `text` with a `WARN` line on stderr.
2004
2014
2005
2015
##### `clear`
2006
2016
@@ -2139,7 +2149,7 @@ Display your DeepL API character usage and remaining quota. Helps you monitor co
-`--format FORMAT` - Output format: `text`, `json`, `table` (default: `text`). In non-TTY output, `table` falls back to `text` with a `WARN` line on stderr.
2143
2153
2144
2154
#### Examples
2145
2155
@@ -2215,7 +2225,7 @@ You can filter to show only source languages, only target languages, or both (de
-`--format FORMAT` - Output format: `text`, `json`, `table` (default: `text`). In non-TTY output, `table` falls back to `text` with a `WARN` line on stderr.
2219
2229
2220
2230
#### Examples
2221
2231
@@ -2462,7 +2472,7 @@ deepl auth clear
2462
2472
2463
2473
### style-rules
2464
2474
2465
-
Manage DeepL style rules (Pro API only). Style rules are created via the DeepL web UI and applied to translations using their ID.
2475
+
Manage DeepL style rules (Pro API only). Style rules carry a list of configured rule ids and optional custom instructions, and apply to translations via their style id.
2466
2476
2467
2477
#### Synopsis
2468
2478
@@ -2481,30 +2491,208 @@ List all available style rules.
2481
2491
-`--detailed` - Show detailed information including configured rules and custom instructions
2482
2492
-`--page NUMBER` - Page number for pagination
2483
2493
-`--page-size NUMBER` - Number of results per page (1-25)
-`--format FORMAT` - Output format: `text`, `json`, `table`(default: `text`). In non-TTY output, `table` falls back to `text` with a `WARN` line on stderr.
2485
2495
2486
2496
**Examples:**
2487
2497
2488
2498
```bash
2489
-
# List all style rules
2490
2499
deepl style-rules list
2491
-
2492
-
# List with details
2493
2500
deepl style-rules list --detailed
2494
-
2495
-
# JSON output
2496
2501
deepl style-rules list --format json
2497
-
2498
-
# Pagination
2502
+
deepl style-rules list --format table
2499
2503
deepl style-rules list --page 1 --page-size 10
2500
2504
```
2501
2505
2506
+
##### `create`
2507
+
2508
+
Create a new style rule list.
2509
+
2510
+
**Options:**
2511
+
2512
+
-`--name NAME` - Style rule name (required)
2513
+
-`--language LANG` - Target language (required)
2514
+
-`--rules JSON` - Configured rules as a JSON object of category → settings (optional). The DeepL API models configured rules as a two-level dictionary; arrays are not accepted. See "Configured rules shape" below.
The DeepL API expects `configured_rules` as a nested object — a category name maps to a settings object, and each setting maps to a string value. Empty rules are `{}`. Example for fr-CA:
deepl style-rules show sr-abc123 --detailed --format json
2561
+
```
2562
+
2563
+
##### `update`
2564
+
2565
+
Update a style rule — rename and/or replace configured rules. At least one of `--name` / `--rules` is required. When both are provided, the rename (PATCH) runs first, then the rules replacement (PUT `/configured_rules`).
2566
+
2567
+
**Arguments:**
2568
+
2569
+
-`<id>` - Style rule id (required)
2570
+
2571
+
**Options:**
2572
+
2573
+
-`--name NAME` - New name
2574
+
-`--rules JSON` - Replace configured rules with a JSON object of category → settings (see "Configured rules shape" under `create`)
Delete a style rule. Prompts for confirmation on a TTY; use `--yes` to skip or `--dry-run` to preview.
2588
+
2589
+
**Arguments:**
2590
+
2591
+
-`<id>` - Style rule id (required)
2592
+
2593
+
**Options:**
2594
+
2595
+
-`-y`, `--yes` - Skip confirmation prompt
2596
+
-`--dry-run` - Show what would be deleted without performing the operation
2597
+
2598
+
**Examples:**
2599
+
2600
+
```bash
2601
+
deepl style-rules delete sr-abc123
2602
+
deepl style-rules delete sr-abc123 --yes
2603
+
deepl style-rules delete sr-abc123 --dry-run
2604
+
```
2605
+
2606
+
##### `instructions`
2607
+
2608
+
List custom instructions attached to a style rule. Synthesized from the detailed `show` response.
2609
+
2610
+
**Arguments:**
2611
+
2612
+
-`<style-id>` - Style rule id (required)
2613
+
2614
+
**Options:**
2615
+
2616
+
-`--format FORMAT` - Output format: `text`, `json`, `table` (default: `text`). In non-TTY output, `table` falls back to `text` with a `WARN` line on stderr.
deepl style-rules add-instruction sr-abc123 tone "Be formal"
2645
+
deepl style-rules add-instruction sr-abc123 register "Use first person" --source-language en
2646
+
```
2647
+
2648
+
##### `update-instruction`
2649
+
2650
+
Update the prompt and/or source language of an existing custom instruction. The label cannot be changed (it is the identifier); rename by removing and re-adding.
2651
+
2652
+
**Arguments:**
2653
+
2654
+
-`<style-id>` - Style rule id (required)
2655
+
-`<label>` - Instruction label (required)
2656
+
-`<prompt>` - New instruction prompt text (required)
2657
+
2658
+
**Options:**
2659
+
2660
+
-`--source-language LANG` - Source language code (optional)
deepl style-rules update-instruction sr-abc123 tone "Be friendlier"
2667
+
```
2668
+
2669
+
##### `remove-instruction`
2670
+
2671
+
Remove a custom instruction from a style rule. Prompts for confirmation on a TTY.
2672
+
2673
+
**Arguments:**
2674
+
2675
+
-`<style-id>` - Style rule id (required)
2676
+
-`<label>` - Instruction label (required)
2677
+
2678
+
**Options:**
2679
+
2680
+
-`-y`, `--yes` - Skip confirmation prompt
2681
+
-`--dry-run` - Show what would be removed without performing the operation
2682
+
2683
+
**Examples:**
2684
+
2685
+
```bash
2686
+
deepl style-rules remove-instruction sr-abc123 tone --yes
2687
+
deepl style-rules remove-instruction sr-abc123 tone --dry-run
2688
+
```
2689
+
2502
2690
#### Notes
2503
2691
2504
-
- Style rules are created and managed via the DeepL web interface, not through the API
2505
-
-Style rules are Pro API only and datacenter-specific (EU and US rules don't cross)
2506
-
-Use the style ID from `style-rules list` with `deepl translate --style-id <uuid>`
2507
-
-Style rules force the `quality_optimized` model type
2692
+
- Style rules are Pro API only and datacenter-specific (EU and US rules don't cross).
2693
+
-Use the style id with `deepl translate --style-id <uuid>` to apply a rule at translation time.
2694
+
-Style rules force the `quality_optimized` model type.
2695
+
-Text-format output of stored user strings (rule names, instruction labels, instruction prompts) passes through a terminal-escape sanitizer to prevent injection of control characters from the API response. JSON-format output preserves raw strings (JSON-escaped at the encoding layer).
0 commit comments