diff --git a/.qwen/skills/qwen-code-claw/SKILL.md b/.qwen/skills/qwen-code-claw/SKILL.md index 9c080f332..f9a7b6a17 100644 --- a/.qwen/skills/qwen-code-claw/SKILL.md +++ b/.qwen/skills/qwen-code-claw/SKILL.md @@ -41,10 +41,10 @@ echo $BAILIAN_CODING_PLAN_API_KEY **If `BAILIAN_CODING_PLAN_API_KEY` exists**, authenticate directly: ```bash -qwen auth code-plan --region china --key $BAILIAN_CODING_PLAN_API_KEY +qwen auth coding-plan --region china --key $BAILIAN_CODING_PLAN_API_KEY ``` -**If the environment variable does not exist**, interrupt and prompt the user to authenticate via `qwen-oauth` or `code-plan`: +**If the environment variable does not exist**, interrupt and prompt the user to authenticate via `qwen-oauth` or `coding-plan`: ```bash qwen auth diff --git a/docs/users/configuration/auth.md b/docs/users/configuration/auth.md index dee7933e0..445e42bc5 100644 --- a/docs/users/configuration/auth.md +++ b/docs/users/configuration/auth.md @@ -56,10 +56,10 @@ You can set up Coding Plan authentication in two ways: ```bash # Interactive — prompts for region and API key -qwen auth code-plan +qwen auth coding-plan # Or non-interactive — pass region and key directly -qwen auth code-plan --region china --key sk-sp-xxxxxxxxx +qwen auth coding-plan --region china --key sk-sp-xxxxxxxxx ``` **Option B: Inside a Qwen Code session** @@ -335,13 +335,13 @@ Select authentication method: ### Subcommands -| Command | Description | -| -------------------------------------------------- | ------------------------------------------------- | -| `qwen auth` | Interactive authentication setup | -| `qwen auth qwen-oauth` | Authenticate with Qwen OAuth | -| `qwen auth code-plan` | Authenticate with Alibaba Cloud Coding Plan | -| `qwen auth code-plan --region china --key sk-sp-…` | Non-interactive Coding Plan setup (for scripting) | -| `qwen auth status` | Show current authentication status | +| Command | Description | +| ---------------------------------------------------- | ------------------------------------------------- | +| `qwen auth` | Interactive authentication setup | +| `qwen auth qwen-oauth` | Authenticate with Qwen OAuth | +| `qwen auth coding-plan` | Authenticate with Alibaba Cloud Coding Plan | +| `qwen auth coding-plan --region china --key sk-sp-…` | Non-interactive Coding Plan setup (for scripting) | +| `qwen auth status` | Show current authentication status | **Examples:** @@ -350,10 +350,10 @@ Select authentication method: qwen auth qwen-oauth # Set up Coding Plan interactively (prompts for region and key) -qwen auth code-plan +qwen auth coding-plan # Set up Coding Plan non-interactively (useful for CI/scripting) -qwen auth code-plan --region china --key sk-sp-xxxxxxxxx +qwen auth coding-plan --region china --key sk-sp-xxxxxxxxx # Check your current auth configuration qwen auth status diff --git a/docs/users/features/commands.md b/docs/users/features/commands.md index 78148a17a..c5ca44e45 100644 --- a/docs/users/features/commands.md +++ b/docs/users/features/commands.md @@ -98,13 +98,13 @@ Commands for obtaining information and performing system settings. In addition to the in-session `/auth` slash command, Qwen Code provides standalone CLI subcommands for managing authentication directly from the terminal: -| Command | Description | -| -------------------------------------------------- | ------------------------------------------------- | -| `qwen auth` | Interactive authentication setup | -| `qwen auth qwen-oauth` | Authenticate with Qwen OAuth | -| `qwen auth code-plan` | Authenticate with Alibaba Cloud Coding Plan | -| `qwen auth code-plan --region china --key sk-sp-…` | Non-interactive Coding Plan setup (for scripting) | -| `qwen auth status` | Show current authentication status | +| Command | Description | +| ---------------------------------------------------- | ------------------------------------------------- | +| `qwen auth` | Interactive authentication setup | +| `qwen auth qwen-oauth` | Authenticate with Qwen OAuth | +| `qwen auth coding-plan` | Authenticate with Alibaba Cloud Coding Plan | +| `qwen auth coding-plan --region china --key sk-sp-…` | Non-interactive Coding Plan setup (for scripting) | +| `qwen auth status` | Show current authentication status | > [!tip] > diff --git a/packages/cli/src/commands/auth.ts b/packages/cli/src/commands/auth.ts index 0e6cfcb80..b90795bc7 100644 --- a/packages/cli/src/commands/auth.ts +++ b/packages/cli/src/commands/auth.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type { CommandModule , Argv } from 'yargs'; +import type { CommandModule, Argv } from 'yargs'; import { handleQwenAuth, runInteractiveAuth, @@ -12,7 +12,6 @@ import { } from './auth/handler.js'; import { t } from '../i18n/index.js'; - // Define subcommands separately const qwenOauthCommand = { command: 'qwen-oauth', @@ -23,7 +22,7 @@ const qwenOauthCommand = { }; const codePlanCommand = { - command: 'code-plan', + command: 'coding-plan', describe: t('Authenticate using Alibaba Cloud Coding Plan'), builder: (yargs: Argv) => yargs @@ -43,10 +42,10 @@ const codePlanCommand = { // If region and key are provided, use them directly if (region && key) { - await handleQwenAuth('code-plan', { region, key }); + await handleQwenAuth('coding-plan', { region, key }); } else { // Otherwise, prompt interactively - await handleQwenAuth('code-plan', {}); + await handleQwenAuth('coding-plan', {}); } }, }; diff --git a/packages/cli/src/commands/auth/handler.ts b/packages/cli/src/commands/auth/handler.ts index 112db6949..0c0ad2a88 100644 --- a/packages/cli/src/commands/auth/handler.ts +++ b/packages/cli/src/commands/auth/handler.ts @@ -53,7 +53,7 @@ interface MergedSettingsWithCodingPlan { * Handles the authentication process based on the specified command and options */ export async function handleQwenAuth( - command: 'qwen-oauth' | 'code-plan', + command: 'qwen-oauth' | 'coding-plan', options: QwenAuthOptions, ) { try { @@ -120,7 +120,7 @@ export async function handleQwenAuth( if (command === 'qwen-oauth') { await handleQwenOAuth(config, settings); - } else if (command === 'code-plan') { + } else if (command === 'coding-plan') { await handleCodePlanAuth(config, settings, options); } @@ -372,7 +372,7 @@ export async function runInteractiveAuth() { description: t('Free · Up to 1,000 requests/day · Qwen latest models'), }, { - value: 'code-plan' as const, + value: 'coding-plan' as const, label: t('Alibaba Cloud Coding Plan'), description: t( 'Paid · Up to 6,000 requests/5 hrs · All Alibaba Cloud Coding Plan Models', @@ -384,8 +384,8 @@ export async function runInteractiveAuth() { const choice = await selector.select(); - if (choice === 'code-plan') { - await handleQwenAuth('code-plan', {}); + if (choice === 'coding-plan') { + await handleQwenAuth('coding-plan', {}); } else { await handleQwenAuth('qwen-oauth', {}); } @@ -414,7 +414,7 @@ export async function showAuthStatus(): Promise { ); writeStdoutLine( t( - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n', + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n', ), ); writeStdoutLine(t('Or simply run:')); @@ -478,7 +478,7 @@ export async function showAuthStatus(): Promise { writeStdoutLine( t(' Issue: API key not found in environment or settings\n'), ); - writeStdoutLine(t(' Run `qwen auth code-plan` to re-configure.\n')); + writeStdoutLine(t(' Run `qwen auth coding-plan` to re-configure.\n')); } } else { writeStdoutLine( diff --git a/packages/cli/src/commands/auth/status.test.ts b/packages/cli/src/commands/auth/status.test.ts index 69c020a02..b0f2be210 100644 --- a/packages/cli/src/commands/auth/status.test.ts +++ b/packages/cli/src/commands/auth/status.test.ts @@ -60,7 +60,7 @@ describe('showAuthStatus', () => { expect.stringContaining('qwen auth qwen-oauth'), ); expect(writeStdoutLine).toHaveBeenCalledWith( - expect.stringContaining('qwen auth code-plan'), + expect.stringContaining('qwen auth coding-plan'), ); expect(process.exit).toHaveBeenCalledWith(0); }); diff --git a/packages/cli/src/i18n/locales/de.js b/packages/cli/src/i18n/locales/de.js index d3eee4c49..95a33bbf1 100644 --- a/packages/cli/src/i18n/locales/de.js +++ b/packages/cli/src/i18n/locales/de.js @@ -1698,8 +1698,8 @@ export default { 'Führen Sie einen der folgenden Befehle aus, um zu beginnen:\n', ' qwen auth qwen-oauth - Authenticate with Qwen OAuth (free tier)': ' qwen auth qwen-oauth - Mit Qwen OAuth authentifizieren (kostenlos)', - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n': - ' qwen auth code-plan - Mit Alibaba Cloud Coding Plan authentifizieren\n', + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n': + ' qwen auth coding-plan - Mit Alibaba Cloud Coding Plan authentifizieren\n', 'Or simply run:': 'Oder einfach ausführen:', ' qwen auth - Interactive authentication setup\n': ' qwen auth - Interaktive Authentifizierungseinrichtung\n', @@ -1720,8 +1720,8 @@ export default { '⚠️ Authentifizierungsmethode: Alibaba Cloud Coding Plan (Unvollständig)', ' Issue: API key not found in environment or settings\n': ' Problem: API-Schlüssel nicht in Umgebung oder Einstellungen gefunden\n', - ' Run `qwen auth code-plan` to re-configure.\n': - ' Führen Sie `qwen auth code-plan` aus, um neu zu konfigurieren.\n', + ' Run `qwen auth coding-plan` to re-configure.\n': + ' Führen Sie `qwen auth coding-plan` aus, um neu zu konfigurieren.\n', '✓ Authentication Method: {{type}}': '✓ Authentifizierungsmethode: {{type}}', ' Status: Configured\n': ' Status: Konfiguriert\n', 'Failed to check authentication status: {{error}}': diff --git a/packages/cli/src/i18n/locales/en.js b/packages/cli/src/i18n/locales/en.js index 335229eff..d74b78693 100644 --- a/packages/cli/src/i18n/locales/en.js +++ b/packages/cli/src/i18n/locales/en.js @@ -1747,8 +1747,8 @@ export default { 'Run one of the following commands to get started:\n', ' qwen auth qwen-oauth - Authenticate with Qwen OAuth (free tier)': ' qwen auth qwen-oauth - Authenticate with Qwen OAuth (free tier)', - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n': - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n', + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n': + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n', 'Or simply run:': 'Or simply run:', ' qwen auth - Interactive authentication setup\n': ' qwen auth - Interactive authentication setup\n', @@ -1768,8 +1768,8 @@ export default { '⚠️ Authentication Method: Alibaba Cloud Coding Plan (Incomplete)', ' Issue: API key not found in environment or settings\n': ' Issue: API key not found in environment or settings\n', - ' Run `qwen auth code-plan` to re-configure.\n': - ' Run `qwen auth code-plan` to re-configure.\n', + ' Run `qwen auth coding-plan` to re-configure.\n': + ' Run `qwen auth coding-plan` to re-configure.\n', '✓ Authentication Method: {{type}}': '✓ Authentication Method: {{type}}', ' Status: Configured\n': ' Status: Configured\n', 'Failed to check authentication status: {{error}}': diff --git a/packages/cli/src/i18n/locales/ja.js b/packages/cli/src/i18n/locales/ja.js index 3e80691ab..e102bca60 100644 --- a/packages/cli/src/i18n/locales/ja.js +++ b/packages/cli/src/i18n/locales/ja.js @@ -1199,8 +1199,8 @@ export default { '以下のコマンドのいずれかを実行して開始してください:\n', ' qwen auth qwen-oauth - Authenticate with Qwen OAuth (free tier)': ' qwen auth qwen-oauth - Qwen OAuth で認証(無料)', - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n': - ' qwen auth code-plan - Alibaba Cloud Coding Plan で認証\n', + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n': + ' qwen auth coding-plan - Alibaba Cloud Coding Plan で認証\n', 'Or simply run:': 'または以下を実行:', ' qwen auth - Interactive authentication setup\n': ' qwen auth - インタラクティブ認証セットアップ\n', @@ -1220,8 +1220,8 @@ export default { '⚠️ 認証方法: Alibaba Cloud Coding Plan(不完全)', ' Issue: API key not found in environment or settings\n': ' 問題: 環境変数または設定にAPIキーが見つかりません\n', - ' Run `qwen auth code-plan` to re-configure.\n': - ' `qwen auth code-plan` を実行して再設定してください。\n', + ' Run `qwen auth coding-plan` to re-configure.\n': + ' `qwen auth coding-plan` を実行して再設定してください。\n', '✓ Authentication Method: {{type}}': '✓ 認証方法: {{type}}', ' Status: Configured\n': ' ステータス: 設定済み\n', 'Failed to check authentication status: {{error}}': diff --git a/packages/cli/src/i18n/locales/pt.js b/packages/cli/src/i18n/locales/pt.js index a4f5f3300..630be8d39 100644 --- a/packages/cli/src/i18n/locales/pt.js +++ b/packages/cli/src/i18n/locales/pt.js @@ -1692,8 +1692,8 @@ export default { 'Execute um dos seguintes comandos para começar:\n', ' qwen auth qwen-oauth - Authenticate with Qwen OAuth (free tier)': ' qwen auth qwen-oauth - Autenticar com Qwen OAuth (gratuito)', - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n': - ' qwen auth code-plan - Autenticar com Alibaba Cloud Coding Plan\n', + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n': + ' qwen auth coding-plan - Autenticar com Alibaba Cloud Coding Plan\n', 'Or simply run:': 'Ou simplesmente execute:', ' qwen auth - Interactive authentication setup\n': ' qwen auth - Configuração interativa de autenticação\n', @@ -1713,8 +1713,8 @@ export default { '⚠️ Método de autenticação: Alibaba Cloud Coding Plan (Incompleto)', ' Issue: API key not found in environment or settings\n': ' Problema: Chave de API não encontrada no ambiente ou configurações\n', - ' Run `qwen auth code-plan` to re-configure.\n': - ' Execute `qwen auth code-plan` para reconfigurar.\n', + ' Run `qwen auth coding-plan` to re-configure.\n': + ' Execute `qwen auth coding-plan` para reconfigurar.\n', '✓ Authentication Method: {{type}}': '✓ Método de autenticação: {{type}}', ' Status: Configured\n': ' Status: Configurado\n', 'Failed to check authentication status: {{error}}': diff --git a/packages/cli/src/i18n/locales/ru.js b/packages/cli/src/i18n/locales/ru.js index fa5e49ef6..cff3b0316 100644 --- a/packages/cli/src/i18n/locales/ru.js +++ b/packages/cli/src/i18n/locales/ru.js @@ -1703,8 +1703,8 @@ export default { 'Выполните одну из следующих команд для начала:\n', ' qwen auth qwen-oauth - Authenticate with Qwen OAuth (free tier)': ' qwen auth qwen-oauth - Аутентификация через Qwen OAuth (бесплатно)', - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n': - ' qwen auth code-plan - Аутентификация через Alibaba Cloud Coding Plan\n', + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n': + ' qwen auth coding-plan - Аутентификация через Alibaba Cloud Coding Plan\n', 'Or simply run:': 'Или просто выполните:', ' qwen auth - Interactive authentication setup\n': ' qwen auth - Интерактивная настройка аутентификации\n', @@ -1724,8 +1724,8 @@ export default { '⚠️ Метод аутентификации: Alibaba Cloud Coding Plan (Не завершён)', ' Issue: API key not found in environment or settings\n': ' Проблема: API-ключ не найден в окружении или настройках\n', - ' Run `qwen auth code-plan` to re-configure.\n': - ' Выполните `qwen auth code-plan` для повторной настройки.\n', + ' Run `qwen auth coding-plan` to re-configure.\n': + ' Выполните `qwen auth coding-plan` для повторной настройки.\n', '✓ Authentication Method: {{type}}': '✓ Метод аутентификации: {{type}}', ' Status: Configured\n': ' Статус: Настроено\n', 'Failed to check authentication status: {{error}}': diff --git a/packages/cli/src/i18n/locales/zh.js b/packages/cli/src/i18n/locales/zh.js index 653faa3a5..c7ba39488 100644 --- a/packages/cli/src/i18n/locales/zh.js +++ b/packages/cli/src/i18n/locales/zh.js @@ -1562,8 +1562,8 @@ export default { '运行以下命令之一开始配置:\n', ' qwen auth qwen-oauth - Authenticate with Qwen OAuth (free tier)': ' qwen auth qwen-oauth - 使用 Qwen OAuth 认证(免费)', - ' qwen auth code-plan - Authenticate with Alibaba Cloud Coding Plan\n': - ' qwen auth code-plan - 使用阿里云百炼 Coding Plan 认证\n', + ' qwen auth coding-plan - Authenticate with Alibaba Cloud Coding Plan\n': + ' qwen auth coding-plan - 使用阿里云百炼 Coding Plan 认证\n', 'Or simply run:': '或者直接运行:', ' qwen auth - Interactive authentication setup\n': ' qwen auth - 交互式认证配置\n', @@ -1583,8 +1583,8 @@ export default { '⚠️ 认证方式:阿里云百炼 Coding Plan(不完整)', ' Issue: API key not found in environment or settings\n': ' 问题:在环境变量或设置中未找到 API 密钥\n', - ' Run `qwen auth code-plan` to re-configure.\n': - ' 运行 `qwen auth code-plan` 重新配置。\n', + ' Run `qwen auth coding-plan` to re-configure.\n': + ' 运行 `qwen auth coding-plan` 重新配置。\n', '✓ Authentication Method: {{type}}': '✓ 认证方式:{{type}}', ' Status: Configured\n': ' 状态:已配置\n', 'Failed to check authentication status: {{error}}':