@pikecode/api-key-manager 1.0.6 → 1.0.7
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
package/src/commands/switch.js
CHANGED
|
@@ -40,11 +40,13 @@ class EnvSwitcher extends BaseCommand {
|
|
|
40
40
|
console.log();
|
|
41
41
|
console.log(UIHelper.createCard('供应商', UIHelper.formatProvider(provider), UIHelper.icons.info));
|
|
42
42
|
console.log();
|
|
43
|
+
// 根据 IDE 类型动态显示启动提示
|
|
44
|
+
const launchLabel = provider.ideName === 'codex' ? '启动 Codex' : '启动 Claude Code';
|
|
43
45
|
console.log(UIHelper.createHintLine([
|
|
44
46
|
['空格', '切换选中'],
|
|
45
47
|
['A', '全选'],
|
|
46
48
|
['I', '反选'],
|
|
47
|
-
['Enter',
|
|
49
|
+
['Enter', launchLabel],
|
|
48
50
|
['ESC', '返回供应商选择']
|
|
49
51
|
]));
|
|
50
52
|
console.log();
|
|
@@ -13,6 +13,21 @@ class ProviderStatusChecker {
|
|
|
13
13
|
return this._result('unknown', '未找到配置', null);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// Codex 的特殊处理
|
|
17
|
+
if (provider.ideName === 'codex') {
|
|
18
|
+
if (provider.authMode === 'chatgpt_login') {
|
|
19
|
+
return this._result('online', '使用 ChatGPT 登录', null);
|
|
20
|
+
}
|
|
21
|
+
if (provider.authMode === 'api_key' && !provider.authToken) {
|
|
22
|
+
return this._result('unknown', '未配置 OpenAI API Key', null);
|
|
23
|
+
}
|
|
24
|
+
// Codex 的 api_key 模式支持检测(通过 OpenAI API)
|
|
25
|
+
// 但目前我们暂不实现 OpenAI SDK 的检测,只提示已配置
|
|
26
|
+
if (provider.authMode === 'api_key') {
|
|
27
|
+
return this._result('online', '已配置 OpenAI API Key', null);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
16
31
|
if (provider.authMode === 'oauth_token') {
|
|
17
32
|
return this._result('unknown', '暂不支持 OAuth 令牌检测', null);
|
|
18
33
|
}
|
package/src/utils/ui-helper.js
CHANGED
|
@@ -77,7 +77,13 @@ class UIHelper {
|
|
|
77
77
|
const status = provider.current ? 'current' : 'inactive';
|
|
78
78
|
const statusText = this.createStatus(status, provider.name);
|
|
79
79
|
const displayName = this.colors.secondary(`(${provider.displayName})`);
|
|
80
|
-
|
|
80
|
+
|
|
81
|
+
// 添加 IDE 类型标识
|
|
82
|
+
const ideIcon = provider.ideName === 'codex' ? '⚙️' : '🚀';
|
|
83
|
+
const ideLabel = provider.ideName === 'codex' ? 'Codex' : 'Claude Code';
|
|
84
|
+
const ideText = this.colors.muted(`[${ideIcon} ${ideLabel}]`);
|
|
85
|
+
|
|
86
|
+
return `${statusText} ${displayName} ${ideText}`;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
// 创建进度条
|