Skip to content

Commit 5ea087b

Browse files
sjsyrekclaude
andcommitted
feat: initial release of DeepL CLI (1.0.0)
Command-line interface for the DeepL API: translation, writing enhancement, voice translation, glossary management, and developer workflow automation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit 5ea087b

File tree

303 files changed

+86005
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+86005
-0
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: npm
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
target-branch: main
9+
open-pull-requests-limit: 10
10+
11+
- package-ecosystem: github-actions
12+
directory: /
13+
schedule:
14+
interval: weekly
15+
target-branch: main

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Node ${{ matrix.node-version }}
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [20, 22]
17+
18+
steps:
19+
- uses: actions/checkout@v6
20+
21+
- uses: actions/setup-node@v6
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: npm
25+
26+
- run: npm ci
27+
- run: npm run lint
28+
- run: npm run type-check
29+
- run: npm run build
30+
- name: Link CLI for E2E tests
31+
run: npm link
32+
- run: npm test

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
# Disabled until npm publish permission is granted.
11+
# To enable: remove the `if: false` line and add an NPM_TOKEN secret.
12+
if: false
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- uses: actions/setup-node@v6
23+
with:
24+
node-version: '20'
25+
registry-url: https://registry.npmjs.org
26+
cache: npm
27+
28+
- run: npm ci
29+
- run: npm run build
30+
- run: npm publish --provenance --access public
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/security.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Security Audit
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 2 * * *'
10+
11+
jobs:
12+
security:
13+
name: npm audit
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v6
18+
19+
- uses: actions/setup-node@v6
20+
with:
21+
node-version: '20'
22+
cache: npm
23+
24+
- run: npm ci
25+
26+
- name: Run npm audit (production only)
27+
run: npm audit --audit-level=moderate --omit=dev

.gitignore

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Dependencies
2+
node_modules/
3+
.npm
4+
5+
# Build outputs
6+
dist/
7+
build/
8+
lib/
9+
*.tsbuildinfo
10+
11+
# Testing
12+
coverage/
13+
.nyc_output/
14+
15+
# Environment variables
16+
.env
17+
.env.*
18+
19+
# Secrets and credentials
20+
*.pem
21+
*.key
22+
*.p12
23+
*.pfx
24+
*.cert
25+
*.crt
26+
credentials.json
27+
28+
# IDEs and editors
29+
.vscode/
30+
.idea/
31+
*.swp
32+
*.swo
33+
*~
34+
35+
# OS files
36+
.DS_Store
37+
Thumbs.db
38+
Desktop.ini
39+
40+
# Debug logs
41+
npm-debug.log*
42+
yarn-debug.log*
43+
yarn-error.log*
44+
pnpm-debug.log*
45+
46+
# Runtime data
47+
*.pid
48+
*.seed
49+
*.pid.lock
50+
51+
# Logs
52+
logs/
53+
*.log
54+
55+
# Cache and temporary files
56+
.cache/
57+
.temp/
58+
.tmp/
59+
*.tmp
60+
.eslintcache
61+
62+
# DeepL CLI specific
63+
.deepl-cli/
64+
*.db
65+
*.db-journal
66+
*.db-wal
67+
*.db-shm
68+
69+
# Claude Code local settings
70+
.claude/settings.local.json
71+
72+
# Beads issue tracking (local)
73+
.beads/

.npmignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Build artifacts
2+
dist/*.tsbuildinfo
3+
dist/**/*.tsbuildinfo
4+
5+
# Source maps
6+
dist/**/*.js.map
7+
dist/**/*.d.ts.map
8+
9+
# Development files
10+
tsconfig.json
11+
.eslintrc*
12+
eslint.config.*
13+
.prettierrc*
14+
jest.config.*
15+
.github/
16+
tests/
17+
examples/
18+
docs/
19+
src/
20+
.beads/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
coverage
4+
*.log
5+
.DS_Store

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always",
9+
"endOfLine": "lf",
10+
"bracketSpacing": true,
11+
"quoteProps": "as-needed"
12+
}

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-02-17
9+
10+
### Added
11+
- Text translation via DeepL's next-generation LLM (`deepl translate`)
12+
- Document translation for PDF, DOCX, PPTX, XLSX, HTML, SRT, XLIFF, and images with formatting preservation
13+
- Structured file translation for JSON and YAML i18n locale files (keys, nesting, comments preserved)
14+
- Writing enhancement with grammar, style, and tone suggestions (`deepl write`) via the DeepL Write API
15+
- Real-time speech translation via WebSocket streaming (`deepl voice`) with automatic reconnection
16+
- Watch mode for real-time file monitoring with auto-translation (`deepl watch`)
17+
- Batch directory translation with parallel processing, glob filtering, and concurrency control
18+
- Glossary management with full v3 API support including multilingual glossaries (`deepl glossary`)
19+
- Language detection (`deepl detect`)
20+
- Git hooks for pre-commit, pre-push, commit-msg, and post-commit translation workflows (`deepl hooks`)
21+
- Interactive setup wizard (`deepl init`)
22+
- Admin API for key management and organization usage analytics (`deepl admin`)
23+
- Shell completion for bash, zsh, and fish (`deepl completion`)
24+
- SQLite-based translation cache with LRU eviction and configurable TTL
25+
- Custom translation instructions (`--custom-instruction`) and style rules (`--style-id`)
26+
- XDG Base Directory Specification support with legacy path migration
27+
- JSON output format (`--format json`) across all commands for CI/CD scripting
28+
- Table output format (`--format table`) for structured comparison views
29+
- Semantic exit codes (0–9) for CI/CD integration and scripted error handling
30+
- HTTP/HTTPS proxy support via standard environment variables
31+
- Automatic retry with exponential backoff and `Retry-After` header support
32+
- Dry-run mode (`--dry-run`) for previewing destructive and batch operations
33+
- Cost transparency with `--show-billed-characters` flag
34+
- Multi-target translation to multiple languages in a single command
35+
- Context-aware translation (`--context`) for disambiguation
36+
- Model type selection (`--model-type`) for quality vs. latency trade-offs
37+
- Advanced XML/HTML tag handling with splitting, non-splitting, and ignore tags
38+
39+
### Security
40+
- HTTPS enforcement for all API communication (localhost exempted for testing)
41+
- Symlink rejection on all file-reading paths to prevent directory traversal
42+
- API key masking in logs, config output, and error messages
43+
- Config file permissions restricted to owner read/write (0o600)
44+
- Path traversal defense for batch output patterns
45+
- Atomic writes for translated output and config files to prevent corruption
46+
47+
### Changed
48+
- Requires Node.js >= 20

0 commit comments

Comments
 (0)