@zuolan/micucodeline 1.0.9 → 1.1.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/README.md +34 -11
- package/bin/micucodeline.js +1 -1
- package/package.json +6 -6
- package/scripts/postinstall.js +35 -7
package/README.md
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @zuolan/micucodeline
|
|
2
2
|
|
|
3
|
-
MicuCodeLine 是
|
|
3
|
+
MicuCodeLine 是 MICU OpenClaudeCode 站特供版 Claude Code 状态栏工具,集成余额显示与主题配置。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
```bash
|
|
7
|
-
npm install -g @
|
|
7
|
+
npm install -g @zuolan/micucodeline
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
安装后默认路径:`~/.claude/micucodeline/micucodeline`
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 重要:首次配置
|
|
13
|
+
|
|
14
|
+
**安装完成后必须先运行配置工具:**
|
|
15
|
+
|
|
13
16
|
```bash
|
|
14
|
-
|
|
15
|
-
micucodeline
|
|
17
|
+
# Linux/macOS
|
|
18
|
+
~/.claude/micucodeline/micucodeline
|
|
19
|
+
|
|
20
|
+
# Windows
|
|
21
|
+
C:\Users\你的用户名\.claude\micucodeline\micucodeline.exe
|
|
16
22
|
```
|
|
17
23
|
|
|
24
|
+
运行后会进入交互式配置界面,按照提示输入:
|
|
25
|
+
1. **API Token(系统访问令牌)**:在 OpenClaudeCode 控制台 → 左上角个人设置 → 安全设置 → 系统访问令牌 → 生成令牌
|
|
26
|
+
2. **用户 ID**:在个人设置页面,用户名称下方显示的 ID
|
|
27
|
+
|
|
28
|
+
配置参考图:https://github.com/zuoliangyu/MICUCODELINE/blob/master/assets/image2.png
|
|
29
|
+
|
|
18
30
|
## Claude Code 配置
|
|
19
31
|
在 `~/.claude/settings.json` 中设置:
|
|
20
32
|
```json
|
|
@@ -27,19 +39,30 @@ micucodeline --version
|
|
|
27
39
|
}
|
|
28
40
|
```
|
|
29
41
|
|
|
30
|
-
##
|
|
31
|
-
|
|
42
|
+
## 手动配置余额(可选)
|
|
43
|
+
如果不使用配置工具,也可以在 `settings.json` 的 `env` 中手动添加:
|
|
32
44
|
```json
|
|
33
45
|
{
|
|
34
46
|
"env": {
|
|
35
47
|
"ANTHROPIC_AUTH_TOKEN": "xxx",
|
|
36
48
|
"ANTHROPIC_BASE_URL": "xxx",
|
|
37
49
|
"BALANCE_API_KEY": "YOUR_TOKEN",
|
|
38
|
-
"BALANCE_API_USER": "12345"
|
|
50
|
+
"BALANCE_API_USER": "12345",
|
|
51
|
+
"BALANCE_API_URL": "https://www.openclaudecode.cn/api/user/self"
|
|
39
52
|
}
|
|
40
53
|
}
|
|
41
54
|
```
|
|
42
55
|
|
|
56
|
+
## 使用
|
|
57
|
+
```bash
|
|
58
|
+
micucodeline --help # 查看帮助
|
|
59
|
+
micucodeline --version # 查看版本
|
|
60
|
+
micucodeline --init # 初始化配置与主题
|
|
61
|
+
micucodeline --config # 打开配置面板
|
|
62
|
+
micucodeline --theme nord # 指定主题运行
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 链接
|
|
43
66
|
- 官网:https://www.openclaudecode.cn/
|
|
44
|
-
-
|
|
45
|
-
-
|
|
67
|
+
- GitHub:https://github.com/zuoliangyu/MICUCODELINE
|
|
68
|
+
- 原作者:https://github.com/Haleclipse/CCometixLine
|
package/bin/micucodeline.js
CHANGED
|
@@ -80,7 +80,7 @@ const binaryPath = path.join(__dirname, '..', 'node_modules', packageName, binar
|
|
|
80
80
|
if (!fs.existsSync(binaryPath)) {
|
|
81
81
|
console.error(`Error: Binary not found at ${binaryPath}`);
|
|
82
82
|
console.error('This might indicate a failed installation or unsupported platform.');
|
|
83
|
-
console.error('Please try reinstalling: npm install -g @
|
|
83
|
+
console.error('Please try reinstalling: npm install -g @zuolan/micucodeline');
|
|
84
84
|
console.error(`Expected package: ${packageName}`);
|
|
85
85
|
process.exit(1);
|
|
86
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuolan/micucodeline",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "MicuCodeLine - High-performance Claude Code StatusLine tool",
|
|
5
5
|
"bin": {
|
|
6
6
|
"micucodeline": "bin/micucodeline.js"
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"postinstall": "node scripts/postinstall.js"
|
|
10
10
|
},
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"@zuolan/micucodeline-darwin-x64": "1.0
|
|
13
|
-
"@zuolan/micucodeline-darwin-arm64": "1.0
|
|
14
|
-
"@zuolan/micucodeline-linux-x64": "1.0
|
|
15
|
-
"@zuolan/micucodeline-linux-x64-musl": "1.0
|
|
16
|
-
"@zuolan/micucodeline-win32-x64": "1.0
|
|
12
|
+
"@zuolan/micucodeline-darwin-x64": "1.1.0",
|
|
13
|
+
"@zuolan/micucodeline-darwin-arm64": "1.1.0",
|
|
14
|
+
"@zuolan/micucodeline-linux-x64": "1.1.0",
|
|
15
|
+
"@zuolan/micucodeline-linux-x64-musl": "1.1.0",
|
|
16
|
+
"@zuolan/micucodeline-win32-x64": "1.1.0"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
package/scripts/postinstall.js
CHANGED
|
@@ -53,12 +53,12 @@ try {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const packageMap = {
|
|
56
|
-
'darwin-x64': '@
|
|
57
|
-
'darwin-arm64': '@
|
|
58
|
-
'linux-x64': '@
|
|
59
|
-
'linux-x64-musl': '@
|
|
60
|
-
'win32-x64': '@
|
|
61
|
-
'win32-ia32': '@
|
|
56
|
+
'darwin-x64': '@zuolan/micucodeline-darwin-x64',
|
|
57
|
+
'darwin-arm64': '@zuolan/micucodeline-darwin-arm64',
|
|
58
|
+
'linux-x64': '@zuolan/micucodeline-linux-x64',
|
|
59
|
+
'linux-x64-musl': '@zuolan/micucodeline-linux-x64-musl',
|
|
60
|
+
'win32-x64': '@zuolan/micucodeline-win32-x64',
|
|
61
|
+
'win32-ia32': '@zuolan/micucodeline-win32-x64', // Use 64-bit for 32-bit
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
const packageName = packageMap[platformKey];
|
|
@@ -148,7 +148,35 @@ try {
|
|
|
148
148
|
if (!silent) {
|
|
149
149
|
console.log('✨ MicuCodeLine is ready for Claude Code!');
|
|
150
150
|
console.log(`📍 Location: ${targetPath}`);
|
|
151
|
-
console.log('
|
|
151
|
+
console.log('');
|
|
152
|
+
|
|
153
|
+
// Auto-run configuration if this is a global install
|
|
154
|
+
const isGlobalInstall = process.env.npm_config_global === 'true';
|
|
155
|
+
|
|
156
|
+
if (isGlobalInstall && process.stdin.isTTY) {
|
|
157
|
+
console.log('🔧 Starting first-time setup...');
|
|
158
|
+
console.log('');
|
|
159
|
+
|
|
160
|
+
try {
|
|
161
|
+
const { spawnSync } = require('child_process');
|
|
162
|
+
const result = spawnSync(targetPath, [], {
|
|
163
|
+
stdio: 'inherit',
|
|
164
|
+
shell: true
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
if (result.status === 0) {
|
|
168
|
+
console.log('');
|
|
169
|
+
console.log('✅ Setup completed!');
|
|
170
|
+
console.log('🎉 You can now use: micucodeline --help');
|
|
171
|
+
}
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.log('');
|
|
174
|
+
console.log('⚠️ Could not auto-run setup.');
|
|
175
|
+
console.log(`💡 Please run manually: ${targetPath}`);
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
console.log('🎉 You can now use: micucodeline --help');
|
|
179
|
+
}
|
|
152
180
|
}
|
|
153
181
|
} catch (error) {
|
|
154
182
|
// Silent failure - don't break installation
|