@pikecode/api-key-manager 1.0.19 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/list.js +26 -12
package/package.json
CHANGED
package/src/commands/list.js
CHANGED
|
@@ -43,18 +43,32 @@ class ProviderLister {
|
|
|
43
43
|
};
|
|
44
44
|
console.log(chalk.gray(` 认证模式: ${authModeDisplay[provider.authMode] || provider.authMode}`));
|
|
45
45
|
|
|
46
|
-
//
|
|
47
|
-
if (provider.authMode === '
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
// 根据不同模式显示对应的环境变量名称
|
|
47
|
+
if (provider.authMode === 'oauth_token') {
|
|
48
|
+
// OAuth 模式
|
|
49
|
+
if (provider.authToken) {
|
|
50
|
+
console.log(chalk.gray(` CLAUDE_CODE_OAUTH_TOKEN: ${provider.authToken}`));
|
|
51
|
+
}
|
|
52
|
+
if (provider.baseUrl) {
|
|
53
|
+
console.log(chalk.gray(` ANTHROPIC_BASE_URL: ${provider.baseUrl}`));
|
|
54
|
+
}
|
|
55
|
+
} else if (provider.authMode === 'api_key') {
|
|
56
|
+
// API Key 模式
|
|
57
|
+
if (provider.baseUrl) {
|
|
58
|
+
console.log(chalk.gray(` ANTHROPIC_BASE_URL: ${provider.baseUrl}`));
|
|
59
|
+
}
|
|
60
|
+
if (provider.authToken) {
|
|
61
|
+
const tokenEnvName = provider.tokenType === 'auth_token' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY';
|
|
62
|
+
console.log(chalk.gray(` ${tokenEnvName}: ${provider.authToken}`));
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
// auth_token 模式
|
|
66
|
+
if (provider.baseUrl) {
|
|
67
|
+
console.log(chalk.gray(` ANTHROPIC_BASE_URL: ${provider.baseUrl}`));
|
|
68
|
+
}
|
|
69
|
+
if (provider.authToken) {
|
|
70
|
+
console.log(chalk.gray(` ANTHROPIC_AUTH_TOKEN: ${provider.authToken}`));
|
|
71
|
+
}
|
|
58
72
|
}
|
|
59
73
|
|
|
60
74
|
if (provider.launchArgs && provider.launchArgs.length > 0) {
|