CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
auth.js57 linesDownload Raw Back to commands
1/**2 * @license3 * Copyright 2025 Google LLC4 * SPDX-License-Identifier: Apache-2.05 */6import { t } from '../i18n/index.js';7const shouldUseColor = () => Boolean(process.stdout.isTTY && !process.env['NO_COLOR']);8const color = (value, code) => shouldUseColor() ? `\x1b[${code}m${value}\x1b[0m` : value;9const cyan = (value) => color(value, '36');10const yellow = (value) => color(value, '33');11export const buildRemovalNotice = () => [12    '',13    yellow(t('⚠  qwen auth has been removed.')),14    '',15    `  ${cyan(t('Interactive'))}   →  ${t('run qwen and use /auth to configure providers')}`,16    `  ${cyan(t('CI / Headless'))} →  ${t('set provider environment variables, for example OPENAI_API_KEY + OPENAI_BASE_URL + OPENAI_MODEL')}`,17    `                     ${t('or pass --openai-api-key, --openai-base-url, --model')}`,18    `  ${cyan(t('Coding Plan'))}   →  ${t('set BAILIAN_CODING_PLAN_API_KEY and use the Coding Plan base URL for your region')}`,19    `                     ${t('China: https://coding.dashscope.aliyuncs.com/v1')}`,20    `                     ${t('International: https://coding-intl.dashscope.aliyuncs.com/v1')}`,21    `  ${cyan(t('OpenRouter'))}    →  ${t('set OPENROUTER_API_KEY and OPENAI_BASE_URL=https://openrouter.ai/api/v1')}`,22    `  ${cyan(t('Requesty'))}      →  ${t('set REQUESTY_API_KEY and OPENAI_BASE_URL=https://router.requesty.ai/v1')}`,23    `  ${cyan(t('Qwen OAuth'))}    →  ${t('run qwen interactively and use /auth; OAuth cannot be configured with env vars alone')}`,24    `  ${cyan(t('Scripted'))}      →  ${t('edit ~/.qwen/settings.json, or run qwen interactively once')}`,25    '',26    `  ${t('Check auth status')} → ${cyan('/doctor')}`,27    '',28].join('\n');29export const printRemovalNotice = () => {30    process.stdout.write(buildRemovalNotice(), () => process.exit(0));31};32const legacySubcommands = [33    'status',34    'coding-plan',35    'openrouter',36    'requesty',37    'api-key',38    'qwen-oauth',39];40export const authCommand = {41    command: 'auth',42    describe: t('Configure authentication (removed)'),43    builder: (yargs) => {44        let y = yargs.version(false).strict(false);45        for (const name of legacySubcommands) {46            y = y.command({47                command: `${name} [legacyArgs..]`,48                describe: false,49                builder: (subYargs) => subYargs.strict(false),50                handler: printRemovalNotice,51            });52        }53        return y;54    },55    handler: printRemovalNotice,56};57//# sourceMappingURL=auth.js.map
basant307/AI_Governance_Project · CoolFace