readme-translate
v0.1.2
Published
CLI to translate README and Markdown files with local AI CLIs
Readme
readme-translate
A CLI tool for translating README files and other Markdown documents into multiple languages.
Primary use cases:
- Translate a single
README.mdor other Markdown file - Translate all
.mdfiles under a directory recursively
Supported translation backends are local AI CLIs:
- Codex CLI
- Claude Code
The current implementation is a TypeScript-based CLI that supports both single-file translation and recursive directory translation.
Current Features
- Translates a single
.mdfile and writes-<lang>suffixed output - Recursively finds and translates
.mdfiles under a directory - Preserves relative directory structure for directory translation
- Excludes the output directory even when it is nested inside the input directory
- Supports
--includeand--excludeglob filters for directory input - Supports
--fromas an optional source-language hint - Lets you choose a backend with
--engine codex|claude - Auto-detects an available backend when
--engineis omitted - Supports
--out-dir,--dry-run, and--force - Accepts both language codes such as
jaand language names such asJapanese
Requirements
- Node.js 24 or later
codexorclaudemust be available locally- Bun is not required
Usage
npx readme-translate --to ja README.mdnpx readme-translate --helpnpx readme-translate --to fr docsnpx readme-translate --to de --dry-run docsnpx readme-translate --to es --engine claude --out-dir translated/docs docsnpx readme-translate --from English --to Japanese README.mdnpx readme-translate --to fr --include "README.md" --include "guides/*.md" --exclude "drafts/**" docsExample Use Cases
Single file:
npx readme-translate --to ja README.mdExpected result:
- Generates
README-ja.md
Directory:
npx readme-translate --to fr docsExpected result:
- Recursively translates
.mdfiles under the target directory - Creates a sibling output directory such as
docs-frby default - Preserves the original relative directory structure
- Excludes the output directory itself from traversal
- Lets you narrow the translation set with
--includeand--exclude
Project Decisions
- The package name is
readme-translate - The package is unscoped
- The package name does not include a specific language such as
ja - The package name does not include a suffix such as
cli - The tool is centered on README localization, but also supports broader Markdown directory translation
- The design assumes support for 200+ languages and does not target any single language
Naming Intent
The focus of this tool is README localization rather than generic Markdown processing.
In practice, it is also designed to handle documentation directories such as docs.
