translate-cli
Use this skill to help end users run and configure the translate CLI.
INLINECODE1 is a command-line translator for text, stdin, files, globs, and .xcstrings catalogs. It supports multiple providers (OpenAI, Anthropic, Ollama, OpenAI-compatible endpoints, Apple providers, DeepL), prompt presets and template overrides, and persistent TOML configuration.
Capabilities
- - Build correct
translate commands for inline text, stdin, single-file, and multi-file workflows. - Keep options before positional input(s) when constructing commands (for example,
translate --to de README.md). - Explain provider selection, credentials, model/base URL requirements, and provider-specific constraints.
- Configure defaults, provider endpoints, network settings, and presets with
translate config and config.toml. - Customize prompts with presets, inline templates,
@file templates, and placeholders. - Explain output behavior (
stdout, --output, --in-place, suffix naming), parallel jobs, dry-run, and validation errors. - Streaming output:
--stream forces on, --no-stream forces off, otherwise defaults.stream applies.
Starter commands
CODEBLOCK0
Note: prefer option-before-input ordering in all examples and generated commands.
References
- - Quick examples: INLINECODE14
- Full flag and subcommand reference: INLINECODE15
- TOML schema and precedence: INLINECODE16
- Provider rules and environment variables: INLINECODE17
- Presets, prompt templates, placeholders: INLINECODE18
- Runtime behavior, warnings, and exit codes: INLINECODE19
translate-cli
使用此技能帮助终端用户运行和配置 translate CLI。
translate 是一个命令行翻译工具,支持文本、标准输入、文件、通配符和 .xcstrings 目录的翻译。它支持多种提供商(OpenAI、Anthropic、Ollama、兼容OpenAI的端点、Apple提供商、DeepL)、提示预设和模板覆盖,以及持久的TOML配置。
功能
- - 为内联文本、标准输入、单文件和多文件工作流构建正确的 translate 命令。
- 在构建命令时,将选项放在位置输入之前(例如,translate --to de README.md)。
- 解释提供商选择、凭证、模型/基础URL要求以及提供商特定的限制。
- 使用 translate config 和 config.toml 配置默认值、提供商端点、网络设置和预设。
- 使用预设、内联模板、@file 模板和占位符自定义提示。
- 解释输出行为(stdout、--output、--in-place、后缀命名)、并行任务、空运行和验证错误。
- 流式输出:--stream 强制开启,--no-stream 强制关闭,否则使用 defaults.stream。
入门命令
bash
translate --text --to fr Hello world
translate --to de README.md
translate --provider ollama --text --to en --dry-run Merhaba dunya
translate config set defaults.provider anthropic
注意:在所有示例和生成的命令中,优先使用选项在输入之前的顺序。
参考资料
- - 快速示例:references/quickstart.md
- 完整标志和子命令参考:references/flags-and-subcommands.md
- TOML模式和优先级:references/config-toml.md
- 提供商规则和环境变量:references/providers-and-env.md
- 预设、提示模板、占位符:references/presets-and-prompts.md
- 运行时行为、警告和退出代码:references/behavior-and-errors.md