From 6b2f49de711e2b71a4a2ce831948c874ef8a2265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E9=BA=92?= Date: Fri, 14 Aug 2026 11:28:25 +0800 Subject: [PATCH] feat(commands): localize help for core commands --- .../commands/auth/generate-access-token.ts | 17 +++-- packages/commands/src/commands/auth/login.ts | 41 ++++++++--- packages/commands/src/commands/auth/logout.ts | 15 +++- packages/commands/src/commands/auth/status.ts | 5 +- .../src/commands/config/agent/index.ts | 43 ++++++++---- packages/commands/src/commands/config/list.ts | 5 +- packages/commands/src/commands/config/set.ts | 12 ++-- packages/commands/src/commands/config/show.ts | 2 +- packages/commands/src/commands/config/ui.ts | 18 ++++- packages/commands/src/commands/config/use.ts | 7 +- packages/commands/src/commands/mcp/call.ts | 32 +++++++-- packages/commands/src/commands/mcp/list.ts | 30 ++++++-- packages/commands/src/commands/mcp/tools.ts | 15 +++- packages/commands/src/commands/search/web.ts | 24 +++++-- packages/commands/src/commands/text/chat.ts | 69 +++++++++++++++---- 15 files changed, 263 insertions(+), 72 deletions(-) diff --git a/packages/commands/src/commands/auth/generate-access-token.ts b/packages/commands/src/commands/auth/generate-access-token.ts index 0882556..fd95d07 100644 --- a/packages/commands/src/commands/auth/generate-access-token.ts +++ b/packages/commands/src/commands/auth/generate-access-token.ts @@ -10,24 +10,33 @@ const FLAGS = { accessKeyId: { type: "string", valueHint: "", - description: "Alibaba Cloud Access Key ID", + description: { "en-US": "Alibaba Cloud Access Key ID", "zh-CN": "阿里云 Access Key ID" }, required: true, }, accessKeySecret: { type: "string", valueHint: "", - description: "Alibaba Cloud Access Key Secret", + description: { + "en-US": "Alibaba Cloud Access Key Secret", + "zh-CN": "阿里云 Access Key Secret", + }, required: true, }, securityToken: { type: "string", valueHint: "", - description: "Alibaba Cloud STS Security Token to store (optional)", + description: { + "en-US": "Alibaba Cloud STS Security Token to store (optional)", + "zh-CN": "要保存的阿里云 STS Security Token(可选)", + }, }, } satisfies FlagsDef; export default defineCommand({ - description: "Generate a CLI access token using OpenAPI AK/SK", + description: { + "en-US": "Generate a CLI access token using OpenAPI AK/SK", + "zh-CN": "使用 OpenAPI AK/SK 生成 CLI Access Token", + }, auth: "none", usageArgs: "--access-key-id --access-key-secret --security-token ", flags: FLAGS, diff --git a/packages/commands/src/commands/auth/login.ts b/packages/commands/src/commands/auth/login.ts index 006dcd3..6c31780 100644 --- a/packages/commands/src/commands/auth/login.ts +++ b/packages/commands/src/commands/auth/login.ts @@ -15,8 +15,11 @@ function hasValue(value: unknown): value is string { } export default defineCommand({ - description: - "Authenticate with API key, console browser login, or OpenAPI AK/SK (credentials can coexist)", + description: { + "en-US": + "Authenticate with API key, console browser login, or OpenAPI AK/SK (credentials can coexist)", + "zh-CN": "使用 API Key、控制台浏览器登录或 OpenAPI AK/SK 进行认证(多种凭证可共存)", + }, auth: "none", usageArgs: "--api-key | --console | --open-api --access-key-id --access-key-secret ", @@ -24,36 +27,54 @@ export default defineCommand({ apiKey: { type: "string", valueHint: "", - description: "Model API key to store", + description: { "en-US": "Model API key to store", "zh-CN": "要保存的模型 API Key" }, }, baseUrl: { type: "string", valueHint: "", - description: "Model API base URL (used with --api-key for validation)", + description: { + "en-US": "Model API base URL (used with --api-key for validation)", + "zh-CN": "模型 API Base URL(用于配合 --api-key 进行验证)", + }, }, console: { type: "switch", - description: - "Sign in via browser; use --console-site to choose domestic (default) or international", + description: { + "en-US": + "Sign in via browser; use --console-site to choose domestic (default) or international", + "zh-CN": "通过浏览器登录;使用 --console-site 选择国内站(默认)或国际站", + }, }, consoleSite: { type: "string", valueHint: "", - description: "Console site: domestic, international", + description: { + "en-US": "Console site: domestic, international", + "zh-CN": "控制台站点:domestic、international", + }, }, openApi: { type: "switch", - description: "Store Alibaba Cloud OpenAPI AK/SK credentials", + description: { + "en-US": "Store Alibaba Cloud OpenAPI AK/SK credentials", + "zh-CN": "保存阿里云 OpenAPI AK/SK 凭证", + }, }, accessKeyId: { type: "string", valueHint: "", - description: "Alibaba Cloud Access Key ID to store", + description: { + "en-US": "Alibaba Cloud Access Key ID to store", + "zh-CN": "要保存的阿里云 Access Key ID", + }, }, accessKeySecret: { type: "string", valueHint: "", - description: "Alibaba Cloud Access Key Secret to store", + description: { + "en-US": "Alibaba Cloud Access Key Secret to store", + "zh-CN": "要保存的阿里云 Access Key Secret", + }, }, }, exampleArgs: [ diff --git a/packages/commands/src/commands/auth/logout.ts b/packages/commands/src/commands/auth/logout.ts index 2a2860a..9e69d16 100644 --- a/packages/commands/src/commands/auth/logout.ts +++ b/packages/commands/src/commands/auth/logout.ts @@ -2,17 +2,26 @@ import { defineCommand } from "bailian-cli-core"; import { emitBare } from "bailian-cli-runtime"; export default defineCommand({ - description: "Clear stored credentials; full logout also clears the model Base URL", + description: { + "en-US": "Clear stored credentials; full logout also clears the model Base URL", + "zh-CN": "清除已保存的凭证;完整退出还会清除模型 Base URL", + }, auth: "none", usageArgs: "[--console | --open-api] [--dry-run]", flags: { console: { type: "switch", - description: "Only clear the console access_token, keep api_key intact", + description: { + "en-US": "Only clear the console access_token, keep api_key intact", + "zh-CN": "仅清除控制台 access_token,保留 api_key", + }, }, openApi: { type: "switch", - description: "Only clear OpenAPI AK/SK/STS credentials, keep other credentials intact", + description: { + "en-US": "Only clear OpenAPI AK/SK/STS credentials, keep other credentials intact", + "zh-CN": "仅清除 OpenAPI AK/SK/STS 凭证,保留其他凭证", + }, }, }, exampleArgs: ["", "--console", "--open-api", "--dry-run"], diff --git a/packages/commands/src/commands/auth/status.ts b/packages/commands/src/commands/auth/status.ts index d15c603..893d655 100644 --- a/packages/commands/src/commands/auth/status.ts +++ b/packages/commands/src/commands/auth/status.ts @@ -3,7 +3,10 @@ import { emitResult, emitBare } from "bailian-cli-runtime"; import { API_KEY_PAGE } from "bailian-cli-runtime"; export default defineCommand({ - description: "Show current authentication state", + description: { + "en-US": "Show current authentication state", + "zh-CN": "显示当前认证状态", + }, auth: "none", exampleArgs: ["", "--output json"], async run(ctx) { diff --git a/packages/commands/src/commands/config/agent/index.ts b/packages/commands/src/commands/config/agent/index.ts index 54bb55c..581f3cb 100644 --- a/packages/commands/src/commands/config/agent/index.ts +++ b/packages/commands/src/commands/config/agent/index.ts @@ -9,54 +9,73 @@ const FLAGS = { agent: { type: "string", valueHint: "", - description: `Target agent: ${VALID_AGENT_NAMES.join(", ")}`, + description: { + "en-US": `Target agent: ${VALID_AGENT_NAMES.join(", ")}`, + "zh-CN": `目标 Agent:${VALID_AGENT_NAMES.join(", ")}`, + }, required: true, choices: VALID_AGENT_NAMES, }, baseUrl: { type: "string", valueHint: "", - description: "API base URL", + description: { "en-US": "API base URL", "zh-CN": "API Base URL" }, }, region: { type: "string", valueHint: "", - description: - "Model Studio region (e.g. cn-beijing, ap-southeast-1); converted into --base-url. Token Plan only", + description: { + "en-US": + "Model Studio region (e.g. cn-beijing, ap-southeast-1); converted into --base-url. Token Plan only", + "zh-CN": + "模型服务地域(例如 cn-beijing、ap-southeast-1);将转换为 --base-url。仅用于 Token Plan", + }, }, apiKey: { type: "string", valueHint: "", - description: "API key", + description: { "en-US": "API key", "zh-CN": "API Key" }, }, key: { type: "string", valueHint: "", - description: - 'Obfuscated API key from the web console (starts with "o1_"); decoded into --api-key', + description: { + "en-US": + 'Obfuscated API key from the web console (starts with "o1_"); decoded into --api-key', + "zh-CN": '来自 Web 控制台的混淆 API Key(以 "o1_" 开头);将解码为 --api-key', + }, }, model: { type: "string", valueHint: "", - description: "Default model name", + description: { "en-US": "Default model name", "zh-CN": "默认模型名称" }, required: true, }, contextWindow: { type: "number", valueHint: "", - description: "OpenClaw only: model context window in tokens (default: 256000)", + description: { + "en-US": "OpenClaw only: model context window in tokens (default: 256000)", + "zh-CN": "仅 OpenClaw:模型上下文窗口 Token 数(默认:256000)", + }, }, wireApi: { type: "string", valueHint: "", - description: - 'Codex only: wire protocol (default: responses). "chat" only works with legacy Codex <= 0.80.0', + description: { + "en-US": + 'Codex only: wire protocol (default: responses). "chat" only works with legacy Codex <= 0.80.0', + "zh-CN": '仅 Codex:通信协议(默认:responses)。"chat" 仅适用于旧版 Codex <= 0.80.0', + }, choices: ["chat", "responses"], }, } satisfies FlagsDef; export default defineCommand({ - description: "Configure a coding agent to use DashScope API", + description: { + "en-US": "Configure a coding agent to use DashScope API", + "zh-CN": "配置编程 Agent 使用 DashScope API", + }, auth: "none", usageArgs: "--agent (--base-url | --region ) (--api-key | --key ) --model ", diff --git a/packages/commands/src/commands/config/list.ts b/packages/commands/src/commands/config/list.ts index bff9694..15ec6cb 100644 --- a/packages/commands/src/commands/config/list.ts +++ b/packages/commands/src/commands/config/list.ts @@ -2,7 +2,10 @@ import { defineCommand, detectOutputFormat } from "bailian-cli-core"; import { emitBare, emitResult } from "bailian-cli-runtime"; export default defineCommand({ - description: "List config profiles and show the active profile", + description: { + "en-US": "List config profiles and show the active profile", + "zh-CN": "列出配置 Profile 并显示当前激活项", + }, auth: "none", exampleArgs: ["", "--output json"], async run(ctx) { diff --git a/packages/commands/src/commands/config/set.ts b/packages/commands/src/commands/config/set.ts index 67c718a..5aa9e1d 100644 --- a/packages/commands/src/commands/config/set.ts +++ b/packages/commands/src/commands/config/set.ts @@ -3,21 +3,25 @@ import { emitResult } from "bailian-cli-runtime"; import { SECRET_KEYS, resolveKey, validateAndCoerce } from "./shared.ts"; export default defineCommand({ - description: "Set a config value", + description: { "en-US": "Set a config value", "zh-CN": "设置配置项" }, auth: "none", usageArgs: "--key --value ", flags: { key: { type: "string", valueHint: "", - description: - "Config key (language, base_url, output, output_dir, timeout, api_key, access_token, access_key_id, access_key_secret, security_token, default_*_model, workspace_id)", + description: { + "en-US": + "Config key (language, base_url, output, output_dir, timeout, api_key, access_token, access_key_id, access_key_secret, security_token, default_*_model, workspace_id)", + "zh-CN": + "配置项名称(language、base_url、output、output_dir、timeout、api_key、access_token、access_key_id、access_key_secret、security_token、default_*_model、workspace_id)", + }, required: true, }, value: { type: "string", valueHint: "", - description: "Value to set", + description: { "en-US": "Value to set", "zh-CN": "要设置的值" }, required: true, }, }, diff --git a/packages/commands/src/commands/config/show.ts b/packages/commands/src/commands/config/show.ts index ca35803..49ca83d 100644 --- a/packages/commands/src/commands/config/show.ts +++ b/packages/commands/src/commands/config/show.ts @@ -3,7 +3,7 @@ import { emitResult } from "bailian-cli-runtime"; import { SECRET_KEYS } from "./shared.ts"; export default defineCommand({ - description: "Display current configuration", + description: { "en-US": "Display current configuration", "zh-CN": "显示当前配置" }, auth: "none", exampleArgs: ["", "--output json"], async run(ctx) { diff --git a/packages/commands/src/commands/config/ui.ts b/packages/commands/src/commands/config/ui.ts index 5a12de0..cb1cc87 100644 --- a/packages/commands/src/commands/config/ui.ts +++ b/packages/commands/src/commands/config/ui.ts @@ -49,9 +49,18 @@ const FLAGS = { port: { type: "number", valueHint: "", - description: "Port to listen on (default: random free port)", + description: { + "en-US": "Port to listen on (default: random free port)", + "zh-CN": "监听端口(默认:随机可用端口)", + }, + }, + noOpen: { + type: "switch", + description: { + "en-US": "Do not open the browser automatically", + "zh-CN": "不自动打开浏览器", + }, }, - noOpen: { type: "switch", description: "Do not open the browser automatically" }, } satisfies FlagsDef; const MAX_BODY = 1 << 20; // 1 MiB @@ -642,7 +651,10 @@ export function createConfigUiServer( } export default defineCommand({ - description: "Open a local web UI to manage config profiles", + description: { + "en-US": "Open a local web UI to manage config profiles", + "zh-CN": "打开用于管理配置 Profile 的本地 Web UI", + }, auth: "none", usageArgs: "[--port ] [--no-open]", flags: FLAGS, diff --git a/packages/commands/src/commands/config/use.ts b/packages/commands/src/commands/config/use.ts index 13de63a..e85137c 100644 --- a/packages/commands/src/commands/config/use.ts +++ b/packages/commands/src/commands/config/use.ts @@ -2,14 +2,17 @@ import { defineCommand, detectOutputFormat } from "bailian-cli-core"; import { emitResult } from "bailian-cli-runtime"; export default defineCommand({ - description: "Set the active config profile", + description: { "en-US": "Set the active config profile", "zh-CN": "设置当前激活的配置 Profile" }, auth: "none", usageArgs: "--name ", flags: { name: { type: "string", valueHint: "", - description: "Existing profile name, or default", + description: { + "en-US": "Existing profile name, or default", + "zh-CN": "已有 Profile 名称,或 default", + }, required: true, }, }, diff --git a/packages/commands/src/commands/mcp/call.ts b/packages/commands/src/commands/mcp/call.ts index 3d6ba0b..eb4cdb8 100644 --- a/packages/commands/src/commands/mcp/call.ts +++ b/packages/commands/src/commands/mcp/call.ts @@ -14,29 +14,44 @@ const CALL_FLAGS = { target: { type: "string", valueHint: "", - description: - "Server code and tool name joined by a dot, e.g. market-cmapi00073529.SmartStockSelection", + description: { + "en-US": + "Server code and tool name joined by a dot, e.g. market-cmapi00073529.SmartStockSelection", + "zh-CN": "由点号连接的 Server Code 和工具名称,例如 market-cmapi00073529.SmartStockSelection", + }, required: true, }, arg: { type: "array", valueHint: "", - description: "Tool argument (repeatable). Values parsed as JSON if possible, else string.", + description: { + "en-US": "Tool argument (repeatable). Values parsed as JSON if possible, else string.", + "zh-CN": "工具参数(可重复)。值会优先按 JSON 解析,否则作为字符串。", + }, }, json: { type: "string", valueHint: "", - description: "Full arguments object as JSON; merged with --arg (arg wins).", + description: { + "en-US": "Full arguments object as JSON; merged with --arg (arg wins).", + "zh-CN": "完整的 JSON 参数对象;与 --arg 合并(--arg 优先)。", + }, }, query: { type: "string", valueHint: "", - description: "Shortcut for --arg query= (mirrors many DashScope MCP tools).", + description: { + "en-US": "Shortcut for --arg query= (mirrors many DashScope MCP tools).", + "zh-CN": "--arg query= 的快捷方式(与许多 DashScope MCP 工具一致)。", + }, }, url: { type: "string", valueHint: "", - description: "Override the MCP endpoint URL (for non-Bailian servers)", + description: { + "en-US": "Override the MCP endpoint URL (for non-Bailian servers)", + "zh-CN": "覆盖 MCP Endpoint URL(用于非百炼服务器)", + }, }, } satisfies FlagsDef; type CallFlags = ParsedFlags; @@ -99,7 +114,10 @@ function validateCallFlags(flags: CallFlags): string | undefined { } export default defineCommand({ - description: "Call a tool on an MCP server (tools/call)", + description: { + "en-US": "Call a tool on an MCP server (tools/call)", + "zh-CN": "调用 MCP 服务器上的工具(tools/call)", + }, auth: "apiKey", usageArgs: "--target [--arg k=v ...] [--json '{...}'] [--url ]", flags: CALL_FLAGS, diff --git a/packages/commands/src/commands/mcp/list.ts b/packages/commands/src/commands/mcp/list.ts index a220d65..3ef3aac 100644 --- a/packages/commands/src/commands/mcp/list.ts +++ b/packages/commands/src/commands/mcp/list.ts @@ -21,22 +21,42 @@ interface ServerSummary { } export default defineCommand({ - description: "List MCP servers activated under your Bailian account", + description: { + "en-US": "List MCP servers activated under your Bailian account", + "zh-CN": "列出百炼账号下已激活的 MCP 服务器", + }, auth: "console", usageArgs: "[flags]", flags: { name: { type: "string", valueHint: "", - description: "Filter by server name (substring match)", + description: { + "en-US": "Filter by server name (substring match)", + "zh-CN": "按服务器名称筛选(子字符串匹配)", + }, }, type: { type: "string", valueHint: "", - description: "Server type: OFFICIAL | PRIVATE (default: OFFICIAL)", + description: { + "en-US": "Server type: OFFICIAL | PRIVATE (default: OFFICIAL)", + "zh-CN": "服务器类型:OFFICIAL | PRIVATE(默认:OFFICIAL)", + }, + }, + page: { + type: "number", + valueHint: "", + description: { "en-US": "Page number (default: 1)", "zh-CN": "页码(默认:1)" }, + }, + pageSize: { + type: "number", + valueHint: "", + description: { + "en-US": "Results per page (default: 30)", + "zh-CN": "每页结果数(默认:30)", + }, }, - page: { type: "number", valueHint: "", description: "Page number (default: 1)" }, - pageSize: { type: "number", valueHint: "", description: "Results per page (default: 30)" }, }, exampleArgs: ["", "--name finance", "--output json"], async run(ctx) { diff --git a/packages/commands/src/commands/mcp/tools.ts b/packages/commands/src/commands/mcp/tools.ts index fc38f42..ec0b271 100644 --- a/packages/commands/src/commands/mcp/tools.ts +++ b/packages/commands/src/commands/mcp/tools.ts @@ -3,20 +3,29 @@ import { emitResult } from "bailian-cli-runtime"; import { rethrowWithMcpActivateHint } from "./activate-hint.ts"; export default defineCommand({ - description: "List tools exposed by an MCP server (tools/list)", + description: { + "en-US": "List tools exposed by an MCP server (tools/list)", + "zh-CN": "列出 MCP 服务器提供的工具(tools/list)", + }, auth: "apiKey", usageArgs: "--server [--url ]", flags: { server: { type: "string", valueHint: "", - description: "Server code from `mcp list` (e.g. market-cmapi00073529)", + description: { + "en-US": "Server code from `mcp list` (e.g. market-cmapi00073529)", + "zh-CN": "来自 `mcp list` 的 Server Code(例如 market-cmapi00073529)", + }, required: true, }, url: { type: "string", valueHint: "", - description: "Override the MCP endpoint URL (for non-Bailian servers)", + description: { + "en-US": "Override the MCP endpoint URL (for non-Bailian servers)", + "zh-CN": "覆盖 MCP Endpoint URL(用于非百炼服务器)", + }, }, }, exampleArgs: [ diff --git a/packages/commands/src/commands/search/web.ts b/packages/commands/src/commands/search/web.ts index b294ea2..8b8ab4f 100644 --- a/packages/commands/src/commands/search/web.ts +++ b/packages/commands/src/commands/search/web.ts @@ -9,17 +9,33 @@ import { createSpinner, emitResult } from "bailian-cli-runtime"; import { rethrowWithWebSearchActivateHint } from "./web-activate-hint.ts"; const WEB_SEARCH_FLAGS = { - query: { type: "string", valueHint: "", description: "Search query text" }, + query: { + type: "string", + valueHint: "", + description: { "en-US": "Search query text", "zh-CN": "搜索查询文本" }, + }, count: { type: "number", valueHint: "", - description: "Number of search results (default: 10)", + description: { + "en-US": "Number of search results (default: 10)", + "zh-CN": "搜索结果数量(默认:10)", + }, + }, + listTools: { + type: "switch", + description: { + "en-US": "List available MCP tools and exit", + "zh-CN": "列出可用的 MCP 工具并退出", + }, }, - listTools: { type: "switch", description: "List available MCP tools and exit" }, } satisfies FlagsDef; export default defineCommand({ - description: "Search the web using DashScope MCP WebSearch service", + description: { + "en-US": "Search the web using DashScope MCP WebSearch service", + "zh-CN": "使用 DashScope MCP WebSearch 服务搜索互联网", + }, auth: "apiKey", usageArgs: "--query [flags]", flags: WEB_SEARCH_FLAGS, diff --git a/packages/commands/src/commands/text/chat.ts b/packages/commands/src/commands/text/chat.ts index 0beb55d..ad1a817 100644 --- a/packages/commands/src/commands/text/chat.ts +++ b/packages/commands/src/commands/text/chat.ts @@ -15,43 +15,85 @@ import { ansi, emitResult, emitBare } from "bailian-cli-runtime"; import { readFileSync } from "fs"; const CHAT_FLAGS = { - model: { type: "string", valueHint: "", description: "Model ID (default: qwen3.8-max)" }, + model: { + type: "string", + valueHint: "", + description: { + "en-US": "Model ID (default: qwen3.8-max)", + "zh-CN": "模型 ID(默认:qwen3.8-max)", + }, + }, message: { type: "array", valueHint: "", - description: "Message text (repeatable, prefix role: to set role); or use --messages-file", + description: { + "en-US": "Message text (repeatable, prefix role: to set role); or use --messages-file", + "zh-CN": "消息文本(可重复;可使用 role: 前缀指定角色),也可使用 --messages-file", + }, }, messagesFile: { type: "string", valueHint: "", - description: "JSON file with messages array (use - for stdin)", + description: { + "en-US": "JSON file with messages array (use - for stdin)", + "zh-CN": "包含 messages 数组的 JSON 文件(使用 - 从 stdin 读取)", + }, + }, + system: { + type: "string", + valueHint: "", + description: { "en-US": "System prompt", "zh-CN": "系统提示词" }, }, - system: { type: "string", valueHint: "", description: "System prompt" }, maxTokens: { type: "number", valueHint: "", - description: "Maximum tokens to generate (default: 4096)", + description: { + "en-US": "Maximum tokens to generate (default: 4096)", + "zh-CN": "最大生成 Token 数(默认:4096)", + }, }, temperature: { type: "number", valueHint: "", - description: "Sampling temperature (0.0, 2.0]", + description: { + "en-US": "Sampling temperature (0.0, 2.0]", + "zh-CN": "采样温度 (0.0, 2.0]", + }, + }, + topP: { + type: "number", + valueHint: "", + description: { "en-US": "Nucleus sampling threshold", "zh-CN": "核采样阈值" }, + }, + stream: { + type: "switch", + description: { + "en-US": "Stream response tokens (default: on in TTY)", + "zh-CN": "流式输出响应 Token(TTY 中默认开启)", + }, }, - topP: { type: "number", valueHint: "", description: "Nucleus sampling threshold" }, - stream: { type: "switch", description: "Stream response tokens (default: on in TTY)" }, tool: { type: "array", valueHint: "", - description: "Tool definition as JSON or file path (repeatable)", + description: { + "en-US": "Tool definition as JSON or file path (repeatable)", + "zh-CN": "JSON 格式的工具定义或文件路径(可重复)", + }, }, enableThinking: { type: "switch", - description: "Enable thinking/reasoning mode (for qwen3/qwq models)", + description: { + "en-US": "Enable thinking/reasoning mode (for qwen3/qwq models)", + "zh-CN": "启用思考/推理模式(适用于 qwen3/qwq 模型)", + }, }, thinkingBudget: { type: "number", valueHint: "", - description: "Max tokens for thinking (default: 4096)", + description: { + "en-US": "Max tokens for thinking (default: 4096)", + "zh-CN": "思考过程最大 Token 数(默认:4096)", + }, }, } satisfies FlagsDef; type ChatFlags = ParsedFlags; @@ -105,7 +147,10 @@ function parseMessages(flags: ChatFlags): ParsedMessages { } export default defineCommand({ - description: "Send a chat completion (OpenAI compatible, DashScope)", + description: { + "en-US": "Send a chat completion (OpenAI compatible, DashScope)", + "zh-CN": "发送聊天补全请求(兼容 OpenAI,基于 DashScope)", + }, auth: "apiKey", usageArgs: "--message [flags]", flags: CHAT_FLAGS,