@pikecode/api-key-manager 1.0.11 → 1.0.13

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/README.md CHANGED
@@ -40,6 +40,7 @@ akm list
40
40
  ## IDE 特定指南
41
41
 
42
42
  - **[Codex 配置指南](./CODEX_SETUP_GUIDE.md)** - 详细的 Codex 安装和使用指南
43
+ - **[IDE 隔离设计](./IDE_ISOLATION_DESIGN.md)** - Codex 和 Claude Code 隔离机制说明
43
44
 
44
45
  ## 命令
45
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikecode/api-key-manager",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "A CLI tool for managing and switching multiple API provider configurations",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -32,27 +32,48 @@ class ProviderLister {
32
32
  const availabilityIcon = this._iconForState(availability.state);
33
33
  const availabilityText = this._formatAvailability(availability);
34
34
  const nameColor = isCurrent ? chalk.green : chalk.white;
35
-
36
- console.log(`${status} ${availabilityIcon} ${nameColor(provider.name)} (${provider.displayName}) - ${availabilityText}`);
35
+
36
+ // 显示 IDE 类型
37
+ const ideIcon = provider.ideName === 'codex' ? '⚙️' : '🚀';
38
+ const ideLabel = provider.ideName === 'codex' ? 'Codex' : 'Claude Code';
39
+
40
+ console.log(`${status} ${availabilityIcon} ${nameColor(provider.name)} (${provider.displayName}) [${ideIcon} ${ideLabel}] - ${availabilityText}`);
37
41
 
38
42
  // 显示认证模式
39
- const authModeDisplay = {
40
- api_key: '通用API密钥模式',
41
- auth_token: '认证令牌模式',
42
- oauth_token: 'OAuth令牌模式'
43
- };
43
+ let authModeDisplay;
44
+ if (provider.ideName === 'codex') {
45
+ // Codex 认证模式
46
+ authModeDisplay = {
47
+ api_key: 'OpenAI API Key',
48
+ chatgpt_login: 'ChatGPT 登录'
49
+ };
50
+ } else {
51
+ // Claude Code 认证模式
52
+ authModeDisplay = {
53
+ api_key: '通用API密钥模式',
54
+ auth_token: '认证令牌模式',
55
+ oauth_token: 'OAuth令牌模式'
56
+ };
57
+ }
44
58
  console.log(chalk.gray(` 认证模式: ${authModeDisplay[provider.authMode] || provider.authMode}`));
45
59
 
46
- // 如果是 api_key 模式,显示 tokenType
47
- if (provider.authMode === 'api_key' && provider.tokenType) {
60
+ // 如果是 Claude Code api_key 模式,显示 tokenType
61
+ if (provider.ideName === 'claude' && provider.authMode === 'api_key' && provider.tokenType) {
48
62
  const tokenTypeDisplay = provider.tokenType === 'auth_token' ? 'ANTHROPIC_AUTH_TOKEN' : 'ANTHROPIC_API_KEY';
49
63
  console.log(chalk.gray(` Token类型: ${tokenTypeDisplay}`));
50
64
  }
51
65
 
52
66
  if (provider.baseUrl) {
53
- console.log(chalk.gray(` URL: ${provider.baseUrl}`));
67
+ console.log(chalk.gray(` API基础URL: ${provider.baseUrl}`));
54
68
  }
55
- console.log(chalk.gray(` Token: ${provider.authToken}`));
69
+
70
+ // 仅在有 authToken 时显示(Codex ChatGPT 登录模式没有 Token)
71
+ if (provider.authToken) {
72
+ console.log(chalk.gray(` Token: ${provider.authToken.substring(0, 10)}...`));
73
+ } else if (provider.ideName === 'codex') {
74
+ console.log(chalk.gray(` 认证: ChatGPT 交互式登录(无需 Token)`));
75
+ }
76
+
56
77
  if (provider.launchArgs && provider.launchArgs.length > 0) {
57
78
  console.log(chalk.gray(` 启动参数: ${provider.launchArgs.join(' ')}`));
58
79
  }
@@ -62,7 +83,7 @@ class ProviderLister {
62
83
  }
63
84
  console.log(chalk.gray(` 创建时间: ${new Date(provider.createdAt).toLocaleString()}`));
64
85
  console.log(chalk.gray(` 最后使用: ${new Date(provider.lastUsed).toLocaleString()}`));
65
-
86
+
66
87
  if (index < providers.length - 1) {
67
88
  console.log(chalk.gray('─'.repeat(60)));
68
89
  }