pumpkinai-config 1.3.1 → 1.5.0
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/claude-api.js +424 -0
- package/claude-setup.js +201 -84
- package/codex-api.js +573 -0
- package/codex-setup.js +60 -43
- package/package.json +4 -2
- package/templates/auth.json +0 -3
- package/templates/config.toml +0 -11
package/codex-setup.js
CHANGED
|
@@ -100,7 +100,13 @@ function installCodex() {
|
|
|
100
100
|
if (osType === 'windows') {
|
|
101
101
|
command = 'npm install -g @openai/codex --registry https://registry.npmmirror.com';
|
|
102
102
|
} else {
|
|
103
|
-
|
|
103
|
+
// 检查是否已经是 root 用户(通过 sudo 运行或直接 root)
|
|
104
|
+
const isRoot = process.getuid && process.getuid() === 0;
|
|
105
|
+
if (isRoot) {
|
|
106
|
+
command = 'npm install -g @openai/codex --registry https://registry.npmmirror.com';
|
|
107
|
+
} else {
|
|
108
|
+
command = 'sudo npm install -g @openai/codex --registry https://registry.npmmirror.com';
|
|
109
|
+
}
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
log(`[执行] ${command}`, 'yellow');
|
|
@@ -111,7 +117,28 @@ function installCodex() {
|
|
|
111
117
|
return true;
|
|
112
118
|
} catch (error) {
|
|
113
119
|
log('[错误] @openai/codex 安装失败', 'red');
|
|
114
|
-
log(
|
|
120
|
+
log('\n[错误详情]', 'red');
|
|
121
|
+
|
|
122
|
+
// 显示错误信息
|
|
123
|
+
if (error.message) {
|
|
124
|
+
log(`错误信息: ${error.message}`, 'red');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 显示退出码
|
|
128
|
+
if (error.status !== undefined) {
|
|
129
|
+
log(`退出码: ${error.status}`, 'red');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// 显示错误输出
|
|
133
|
+
if (error.stderr) {
|
|
134
|
+
log(`错误输出:\n${error.stderr.toString()}`, 'red');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 显示标准输出(可能包含有用信息)
|
|
138
|
+
if (error.stdout) {
|
|
139
|
+
log(`标准输出:\n${error.stdout.toString()}`, 'yellow');
|
|
140
|
+
}
|
|
141
|
+
|
|
115
142
|
log('\n[提示] 你可以手动安装:', 'yellow');
|
|
116
143
|
log(` ${command}`, 'yellow');
|
|
117
144
|
log(' 然后重新运行此工具', 'yellow');
|
|
@@ -163,7 +190,7 @@ function createConfigToml(codexDir) {
|
|
|
163
190
|
const configPath = path.join(codexDir, 'config.toml');
|
|
164
191
|
|
|
165
192
|
const configContent = `model_provider = "codex"
|
|
166
|
-
model = "gpt-5" #可更改为model = "gpt-5-codex"
|
|
193
|
+
model = "gpt-5.2" #可更改为model = "gpt-5.1-codex或者gpt-5.1-codex-max"
|
|
167
194
|
model_reasoning_effort = "high"
|
|
168
195
|
disable_response_storage = true
|
|
169
196
|
|
|
@@ -285,7 +312,7 @@ function configureVSCodeSettings() {
|
|
|
285
312
|
"chatgpt.apiBase": "https://code.ppchat.vip/v1",
|
|
286
313
|
"chatgpt.config": {
|
|
287
314
|
"preferred_auth_method": "apikey",
|
|
288
|
-
"model": "gpt-5",
|
|
315
|
+
"model": "gpt-5.1",
|
|
289
316
|
"model_reasoning_effort": "high",
|
|
290
317
|
"wire_api": "responses"
|
|
291
318
|
}
|
|
@@ -377,7 +404,7 @@ function configureCursorSettings() {
|
|
|
377
404
|
"chatgpt.apiBase": "https://code.ppchat.vip/v1",
|
|
378
405
|
"chatgpt.config": {
|
|
379
406
|
"preferred_auth_method": "apikey",
|
|
380
|
-
"model": "gpt-5",
|
|
407
|
+
"model": "gpt-5.1",
|
|
381
408
|
"model_reasoning_effort": "high",
|
|
382
409
|
"wire_api": "responses"
|
|
383
410
|
}
|
|
@@ -451,36 +478,26 @@ function showCompletionInfo() {
|
|
|
451
478
|
const authPath = path.join(codexPath, 'auth.json');
|
|
452
479
|
|
|
453
480
|
log('\n', 'reset');
|
|
454
|
-
log('
|
|
455
|
-
log('
|
|
456
|
-
log('
|
|
457
|
-
|
|
458
|
-
log('\n
|
|
459
|
-
log('
|
|
460
|
-
log(
|
|
461
|
-
log(
|
|
462
|
-
log('
|
|
463
|
-
|
|
464
|
-
log('
|
|
465
|
-
log('
|
|
466
|
-
|
|
467
|
-
log('
|
|
468
|
-
log('
|
|
469
|
-
log(`
|
|
470
|
-
|
|
471
|
-
log('
|
|
472
|
-
log(
|
|
473
|
-
log(
|
|
474
|
-
log(' │', 'cyan');
|
|
475
|
-
log(' └─────────────────────────────────────────────', 'cyan');
|
|
476
|
-
|
|
477
|
-
log('\n ┌─ 使用方式', 'cyan');
|
|
478
|
-
log(' │', 'cyan');
|
|
479
|
-
log(' │ 在终端输入以下命令启动 Codex:', 'reset');
|
|
480
|
-
log(' │', 'cyan');
|
|
481
|
-
log(' │ codex', 'yellow');
|
|
482
|
-
log(' │', 'cyan');
|
|
483
|
-
log(' └─────────────────────────────────────────────', 'cyan');
|
|
481
|
+
log('=' + '='.repeat(68) + '=', 'yellow');
|
|
482
|
+
log(' 欢迎使用 Codex 开始您的 AI 编程之旅', 'yellow');
|
|
483
|
+
log('=' + '='.repeat(68) + '=', 'yellow');
|
|
484
|
+
|
|
485
|
+
log('\n[已完成操作]', 'cyan');
|
|
486
|
+
log(' * 安装 @openai/codex', 'green');
|
|
487
|
+
log(` * 创建目录 ${codexPath}`, 'green');
|
|
488
|
+
log(' * 创建配置文件 config.toml', 'green');
|
|
489
|
+
log(' * 创建认证文件 auth.json', 'green');
|
|
490
|
+
|
|
491
|
+
log('\n[配置文件路径]', 'cyan');
|
|
492
|
+
log(' config.toml (可在此处修改域名url):', 'reset');
|
|
493
|
+
log(` ${configPath}`, 'yellow');
|
|
494
|
+
log('', 'reset');
|
|
495
|
+
log(' auth.json (可在此处修改key):', 'reset');
|
|
496
|
+
log(` ${authPath}`, 'yellow');
|
|
497
|
+
|
|
498
|
+
log('\n[使用方式]', 'cyan');
|
|
499
|
+
log(' 在终端输入以下命令启动 Codex:', 'reset');
|
|
500
|
+
log(' codex', 'yellow');
|
|
484
501
|
|
|
485
502
|
const codexVersion = getCodexVersion();
|
|
486
503
|
log('\n Codex 版本: v' + codexVersion, 'reset');
|
|
@@ -492,15 +509,15 @@ function showCompletionInfo() {
|
|
|
492
509
|
async function main() {
|
|
493
510
|
console.clear();
|
|
494
511
|
|
|
495
|
-
// ASCII
|
|
512
|
+
// ASCII Logo - 水平渐变 (蓝→紫→粉)
|
|
496
513
|
log('\n', 'reset');
|
|
497
|
-
log(' ██████╗ ██████╗ ██████╗
|
|
498
|
-
log('
|
|
499
|
-
log(' ██║ ██║
|
|
500
|
-
log(' ██║ ██║
|
|
501
|
-
log('
|
|
502
|
-
log(' ╚═════╝ ╚═════╝ ╚═════╝
|
|
503
|
-
log('\n
|
|
514
|
+
console.log(' \x1b[38;5;39m██████╗ \x1b[38;5;75m██████╗ \x1b[38;5;111m██████╗ \x1b[38;5;147m███████╗\x1b[38;5;183m██╗ \x1b[38;5;219m██╗\x1b[0m');
|
|
515
|
+
console.log(' \x1b[38;5;39m██╔════╝\x1b[38;5;75m██╔═══██╗\x1b[38;5;111m██╔══██╗\x1b[38;5;147m██╔════╝\x1b[38;5;183m╚██╗\x1b[38;5;219m██╔╝\x1b[0m');
|
|
516
|
+
console.log(' \x1b[38;5;45m██║ \x1b[38;5;81m██║ ██║\x1b[38;5;117m██║ ██║\x1b[38;5;153m█████╗ \x1b[38;5;189m ╚███╔╝ \x1b[0m');
|
|
517
|
+
console.log(' \x1b[38;5;75m██║ \x1b[38;5;111m██║ ██║\x1b[38;5;147m██║ ██║\x1b[38;5;183m██╔══╝ \x1b[38;5;219m ██╔██╗ \x1b[0m');
|
|
518
|
+
console.log(' \x1b[38;5;111m╚██████╗\x1b[38;5;147m╚██████╔╝\x1b[38;5;183m██████╔╝\x1b[38;5;219m███████╗\x1b[38;5;225m██╔╝ ██╗\x1b[0m');
|
|
519
|
+
console.log(' \x1b[38;5;147m╚═════╝ \x1b[38;5;183m╚═════╝ \x1b[38;5;219m╚═════╝ \x1b[38;5;225m╚══════╝\x1b[38;5;231m╚═╝ ╚═╝\x1b[0m');
|
|
520
|
+
log('\n pumpkinai Codex config Tool', 'magenta');
|
|
504
521
|
log(' ' + '='.repeat(44), 'cyan');
|
|
505
522
|
log('', 'reset');
|
|
506
523
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumpkinai-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "PumpkinAI 一键安装配置工具 - 支持 Codex 和 Claude Code",
|
|
5
5
|
"main": "codex-setup.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"codex-config": "./codex-setup.js",
|
|
8
|
-
"
|
|
8
|
+
"codex-api": "./codex-api.js",
|
|
9
|
+
"claude-config": "./claude-setup.js",
|
|
10
|
+
"claude-api": "./claude-api.js"
|
|
9
11
|
},
|
|
10
12
|
"scripts": {
|
|
11
13
|
"test": "node codex-setup.js",
|
package/templates/auth.json
DELETED
package/templates/config.toml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
model_provider = "codex"
|
|
2
|
-
model = "gpt-5" #可更改为model = "gpt-5-codex"
|
|
3
|
-
model_reasoning_effort = "high"
|
|
4
|
-
disable_response_storage = true
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[model_providers.codex]
|
|
8
|
-
name = "codex"
|
|
9
|
-
base_url = "https://code.ppchat.vip/v1"
|
|
10
|
-
wire_api = "responses"
|
|
11
|
-
requires_openai_auth = true
|