mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +00:00
fix: code-plan to coding-plan
This commit is contained in:
parent
a36264936f
commit
620807b1ee
12 changed files with 56 additions and 57 deletions
|
|
@ -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', {});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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<void> {
|
|||
);
|
||||
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<void> {
|
|||
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(
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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}}':
|
||||
|
|
|
|||
|
|
@ -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}}':
|
||||
|
|
|
|||
|
|
@ -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}}':
|
||||
|
|
|
|||
|
|
@ -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}}':
|
||||
|
|
|
|||
|
|
@ -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}}':
|
||||
|
|
|
|||
|
|
@ -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}}':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue