@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikecode/api-key-manager",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "A CLI tool for managing and switching multiple API provider configurations",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -43,18 +43,32 @@ class ProviderLister {
43
43
  };
44
44
  console.log(chalk.gray(` 认证模式: ${authModeDisplay[provider.authMode] || provider.authMode}`));
45
45
 
46
- // 如果是 api_key 模式,显示 tokenType
47
- if (provider.authMode === 'api_key' && provider.tokenType) {
48
- const tokenTypeDisplay = provider.tokenType === 'auth_token' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY';
49
- console.log(chalk.gray(` Token类型: ${tokenTypeDisplay}`));
50
- }
51
-
52
- if (provider.baseUrl) {
53
- console.log(chalk.gray(` API基础URL: ${provider.baseUrl}`));
54
- }
55
-
56
- if (provider.authToken) {
57
- console.log(chalk.gray(` Token: ${provider.authToken}`));
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) {