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/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
- command = 'sudo npm install -g @openai/codex --registry https://registry.npmmirror.com';
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(`[错误] ${error.message}`, 'red');
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('' + ''.repeat(68) + '', 'cyan');
455
- log('║' + ' '.repeat(10) + '欢迎使用 Codex 开始您的 AI 编程之旅' + ' '.repeat(10) + '║', 'cyan');
456
- log('' + ''.repeat(68) + '', 'cyan');
457
-
458
- log('\n ┌─ 已完成操作', 'cyan');
459
- log(' ', 'cyan');
460
- log(' │ ✓ 安装 @openai/codex', 'green');
461
- log(` │ ✓ 创建目录 ${codexPath}`, 'green');
462
- log(' │ ✓ 创建配置文件 config.toml', 'green');
463
- log(' │ ✓ 创建认证文件 auth.json', 'green');
464
- log('', 'cyan');
465
- log(' └─────────────────────────────────────────────', 'cyan');
466
-
467
- log('\n ┌─ 配置文件路径', 'cyan');
468
- log(' ', 'cyan');
469
- log(` │ config.toml(可此处数修改域名url)`, 'reset');
470
- log(` │ ${configPath}`, 'yellow');
471
- log('', 'cyan');
472
- log(` │ auth.json(可在此处修改key)`, 'reset');
473
- log(` │ ${authPath}`, 'yellow');
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 艺术 Logo
512
+ // ASCII Logo - 水平渐变 (蓝→紫→粉)
496
513
  log('\n', 'reset');
497
- log(' ██████╗ ██████╗ ██████╗ ███████╗██╗ ██╗', 'cyan');
498
- log(' ██╔════╝██╔═══██╗██╔══██╗██╔════╝╚██╗██╔╝', 'cyan');
499
- log(' ██║ ██║ ██║██║ ██║█████╗ ╚███╔╝ ', 'cyan');
500
- log(' ██║ ██║ ██║██║ ██║██╔══╝ ██╔██╗ ', 'cyan');
501
- log(' ╚██████╗╚██████╔╝██████╔╝███████╗██╔╝ ██╗', 'cyan');
502
- log(' ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝', 'cyan');
503
- log('\n PPChat Codex 一键安装配置工具', 'magenta');
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.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
- "claude-config": "./claude-setup.js"
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",
@@ -1,3 +0,0 @@
1
- {
2
- "OPENAI_API_KEY": "sk-xxx"
3
- }
@@ -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