code-abyss 1.6.10 → 1.6.11
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/bin/install.js +39 -19
- package/config/ccline/config.toml +161 -0
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -316,6 +316,7 @@ async function postClaude(ctx) {
|
|
|
316
316
|
printMergeLog(log);
|
|
317
317
|
fs.writeFileSync(ctx.settingsPath, JSON.stringify(ctx.settings, null, 2) + '\n');
|
|
318
318
|
ok('settings.json 合并完成');
|
|
319
|
+
await installCcline(ctx);
|
|
319
320
|
return;
|
|
320
321
|
}
|
|
321
322
|
|
|
@@ -323,7 +324,7 @@ async function postClaude(ctx) {
|
|
|
323
324
|
message: '选择要安装的配置 (空格选择, 回车确认)',
|
|
324
325
|
choices: [
|
|
325
326
|
{ name: '精细合并推荐 settings.json (保留现有配置)', value: 'settings', checked: true },
|
|
326
|
-
{ name: '安装 ccline 状态栏 (需要 Nerd Font)', value: 'ccline' },
|
|
327
|
+
{ name: '安装 ccline 状态栏 (需要 Nerd Font)', value: 'ccline', checked: true },
|
|
327
328
|
],
|
|
328
329
|
});
|
|
329
330
|
|
|
@@ -343,45 +344,64 @@ async function installCcline(ctx) {
|
|
|
343
344
|
console.log('');
|
|
344
345
|
info('安装 ccline 状态栏...');
|
|
345
346
|
const { execSync } = require('child_process');
|
|
347
|
+
const cclineDir = path.join(HOME, '.claude', 'ccline');
|
|
348
|
+
const cclineBin = path.join(cclineDir, process.platform === 'win32' ? 'ccline.exe' : 'ccline');
|
|
346
349
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
if (!
|
|
350
|
-
|
|
351
|
-
if (fs.existsSync(cclineBin)) installed = true;
|
|
350
|
+
// 1. 检测是否已有二进制
|
|
351
|
+
let hasBin = fs.existsSync(cclineBin);
|
|
352
|
+
if (!hasBin) {
|
|
353
|
+
try { execSync('ccline --version', { stdio: 'pipe' }); hasBin = true; } catch (e) {}
|
|
352
354
|
}
|
|
353
355
|
|
|
354
|
-
|
|
356
|
+
// 2. 未安装则通过 npm 安装(postinstall 自动下载原生二进制)
|
|
357
|
+
if (!hasBin) {
|
|
355
358
|
info('ccline 未检测到,正在安装...');
|
|
356
359
|
try {
|
|
357
360
|
execSync('npm install -g @cometix/ccline', { stdio: 'inherit' });
|
|
358
|
-
|
|
359
|
-
ok('ccline
|
|
361
|
+
hasBin = fs.existsSync(cclineBin);
|
|
362
|
+
if (hasBin) ok('ccline 二进制安装成功');
|
|
363
|
+
else {
|
|
364
|
+
try { execSync('ccline --version', { stdio: 'pipe' }); hasBin = true; ok('ccline 安装成功 (全局)'); } catch (e) {}
|
|
365
|
+
}
|
|
360
366
|
} catch (e) {
|
|
361
367
|
warn('npm install -g @cometix/ccline 失败');
|
|
362
|
-
info(
|
|
368
|
+
info(`手动安装: ${c.cyn('npm install -g @cometix/ccline')}`);
|
|
369
|
+
info(`或下载: ${c.cyn('https://github.com/Haleclipse/CCometixLine/releases')}`);
|
|
363
370
|
}
|
|
364
371
|
} else {
|
|
365
|
-
ok('ccline
|
|
372
|
+
ok('ccline 二进制已存在');
|
|
366
373
|
}
|
|
367
374
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
375
|
+
// 3. 部署打包的 config.toml(覆盖默认配置)
|
|
376
|
+
const bundledConfig = path.join(PKG_ROOT, 'config', 'ccline', 'config.toml');
|
|
377
|
+
const targetConfig = path.join(cclineDir, 'config.toml');
|
|
378
|
+
if (fs.existsSync(bundledConfig)) {
|
|
379
|
+
fs.mkdirSync(cclineDir, { recursive: true });
|
|
380
|
+
if (fs.existsSync(targetConfig)) {
|
|
381
|
+
info(`备份: ${c.d('ccline/config.toml')}`);
|
|
382
|
+
const backupDir = path.join(HOME, '.claude', '.sage-backup');
|
|
383
|
+
fs.mkdirSync(backupDir, { recursive: true });
|
|
384
|
+
fs.copyFileSync(targetConfig, path.join(backupDir, 'ccline-config.toml'));
|
|
385
|
+
}
|
|
386
|
+
fs.copyFileSync(bundledConfig, targetConfig);
|
|
387
|
+
ok('ccline/config.toml 已部署 (Code Abyss 定制版)');
|
|
388
|
+
} else {
|
|
389
|
+
// 无打包配置,回退到 ccline --init
|
|
390
|
+
if (hasBin && !fs.existsSync(targetConfig)) {
|
|
391
|
+
try { execSync('ccline --init', { stdio: 'inherit' }); ok('ccline 默认配置已生成'); }
|
|
392
|
+
catch (e) { warn('ccline --init 失败,可手动运行'); }
|
|
393
|
+
}
|
|
374
394
|
}
|
|
375
395
|
|
|
396
|
+
// 4. 合并 statusLine 到 settings.json
|
|
376
397
|
ctx.settings.statusLine = CCLINE_STATUS_LINE.statusLine;
|
|
377
398
|
ok(`statusLine → ${c.cyn(CCLINE_STATUS_LINE.statusLine.command)}`);
|
|
378
399
|
fs.writeFileSync(ctx.settingsPath, JSON.stringify(ctx.settings, null, 2) + '\n');
|
|
379
400
|
|
|
380
401
|
console.log('');
|
|
381
|
-
warn(`需要 ${c.b('Nerd Font')}
|
|
402
|
+
warn(`需要 ${c.b('Nerd Font')} 字体才能正确显示图标`);
|
|
382
403
|
info(`推荐: FiraCode Nerd Font / JetBrainsMono Nerd Font`);
|
|
383
404
|
info(`下载: ${c.cyn('https://www.nerdfonts.com/')}`);
|
|
384
|
-
info(`配置: ${c.cyn('ccline --config')}`);
|
|
385
405
|
ok('ccline 配置完成');
|
|
386
406
|
}
|
|
387
407
|
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
theme = "www"
|
|
2
|
+
|
|
3
|
+
[style]
|
|
4
|
+
mode = "nerd_font"
|
|
5
|
+
separator = " | "
|
|
6
|
+
|
|
7
|
+
[[segments]]
|
|
8
|
+
id = "model"
|
|
9
|
+
enabled = true
|
|
10
|
+
|
|
11
|
+
[segments.icon]
|
|
12
|
+
plain = "🤖"
|
|
13
|
+
nerd_font = ""
|
|
14
|
+
|
|
15
|
+
[segments.colors.icon]
|
|
16
|
+
c256 = 208
|
|
17
|
+
|
|
18
|
+
[segments.colors.text]
|
|
19
|
+
c256 = 208
|
|
20
|
+
|
|
21
|
+
[segments.styles]
|
|
22
|
+
text_bold = true
|
|
23
|
+
|
|
24
|
+
[segments.options]
|
|
25
|
+
|
|
26
|
+
[[segments]]
|
|
27
|
+
id = "directory"
|
|
28
|
+
enabled = true
|
|
29
|
+
|
|
30
|
+
[segments.icon]
|
|
31
|
+
plain = "📁"
|
|
32
|
+
nerd_font = ""
|
|
33
|
+
|
|
34
|
+
[segments.colors.icon]
|
|
35
|
+
c256 = 142
|
|
36
|
+
|
|
37
|
+
[segments.colors.text]
|
|
38
|
+
c256 = 142
|
|
39
|
+
|
|
40
|
+
[segments.styles]
|
|
41
|
+
text_bold = true
|
|
42
|
+
|
|
43
|
+
[segments.options]
|
|
44
|
+
|
|
45
|
+
[[segments]]
|
|
46
|
+
id = "git"
|
|
47
|
+
enabled = true
|
|
48
|
+
|
|
49
|
+
[segments.icon]
|
|
50
|
+
plain = "🌿"
|
|
51
|
+
nerd_font = ""
|
|
52
|
+
|
|
53
|
+
[segments.colors.icon]
|
|
54
|
+
c256 = 109
|
|
55
|
+
|
|
56
|
+
[segments.colors.text]
|
|
57
|
+
c256 = 109
|
|
58
|
+
|
|
59
|
+
[segments.styles]
|
|
60
|
+
text_bold = true
|
|
61
|
+
|
|
62
|
+
[segments.options]
|
|
63
|
+
show_sha = false
|
|
64
|
+
|
|
65
|
+
[[segments]]
|
|
66
|
+
id = "context_window"
|
|
67
|
+
enabled = true
|
|
68
|
+
|
|
69
|
+
[segments.icon]
|
|
70
|
+
plain = "⚡️"
|
|
71
|
+
nerd_font = ""
|
|
72
|
+
|
|
73
|
+
[segments.colors.icon]
|
|
74
|
+
c16 = 5
|
|
75
|
+
|
|
76
|
+
[segments.colors.text]
|
|
77
|
+
c16 = 5
|
|
78
|
+
|
|
79
|
+
[segments.styles]
|
|
80
|
+
text_bold = true
|
|
81
|
+
|
|
82
|
+
[segments.options]
|
|
83
|
+
|
|
84
|
+
[[segments]]
|
|
85
|
+
id = "usage"
|
|
86
|
+
enabled = true
|
|
87
|
+
|
|
88
|
+
[segments.icon]
|
|
89
|
+
plain = "📊"
|
|
90
|
+
nerd_font = ""
|
|
91
|
+
|
|
92
|
+
[segments.colors.icon]
|
|
93
|
+
c16 = 14
|
|
94
|
+
|
|
95
|
+
[segments.colors.text]
|
|
96
|
+
c16 = 14
|
|
97
|
+
|
|
98
|
+
[segments.styles]
|
|
99
|
+
text_bold = false
|
|
100
|
+
|
|
101
|
+
[segments.options]
|
|
102
|
+
cache_duration = 180
|
|
103
|
+
timeout = 2
|
|
104
|
+
api_base_url = "https://api.anthropic.com"
|
|
105
|
+
|
|
106
|
+
[[segments]]
|
|
107
|
+
id = "cost"
|
|
108
|
+
enabled = true
|
|
109
|
+
|
|
110
|
+
[segments.icon]
|
|
111
|
+
plain = "💰"
|
|
112
|
+
nerd_font = ""
|
|
113
|
+
|
|
114
|
+
[segments.colors.icon]
|
|
115
|
+
c256 = 214
|
|
116
|
+
|
|
117
|
+
[segments.colors.text]
|
|
118
|
+
c256 = 214
|
|
119
|
+
|
|
120
|
+
[segments.styles]
|
|
121
|
+
text_bold = true
|
|
122
|
+
|
|
123
|
+
[segments.options]
|
|
124
|
+
|
|
125
|
+
[[segments]]
|
|
126
|
+
id = "session"
|
|
127
|
+
enabled = true
|
|
128
|
+
|
|
129
|
+
[segments.icon]
|
|
130
|
+
plain = "⏱️"
|
|
131
|
+
nerd_font = ""
|
|
132
|
+
|
|
133
|
+
[segments.colors.icon]
|
|
134
|
+
c256 = 142
|
|
135
|
+
|
|
136
|
+
[segments.colors.text]
|
|
137
|
+
c256 = 142
|
|
138
|
+
|
|
139
|
+
[segments.styles]
|
|
140
|
+
text_bold = true
|
|
141
|
+
|
|
142
|
+
[segments.options]
|
|
143
|
+
|
|
144
|
+
[[segments]]
|
|
145
|
+
id = "output_style"
|
|
146
|
+
enabled = true
|
|
147
|
+
|
|
148
|
+
[segments.icon]
|
|
149
|
+
plain = "🎯"
|
|
150
|
+
nerd_font = ""
|
|
151
|
+
|
|
152
|
+
[segments.colors.icon]
|
|
153
|
+
c256 = 109
|
|
154
|
+
|
|
155
|
+
[segments.colors.text]
|
|
156
|
+
c256 = 109
|
|
157
|
+
|
|
158
|
+
[segments.styles]
|
|
159
|
+
text_bold = true
|
|
160
|
+
|
|
161
|
+
[segments.options]
|