minimax-status 1.2.3 → 1.2.5

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 CHANGED
@@ -1,512 +1,224 @@
1
- # MiniMax StatusBar
2
-
3
- [![npm version](https://img.shields.io/npm/v/minimax-status.svg)](https://www.npmjs.com/package/minimax-status)
4
- [![npm downloads](https://img.shields.io/npm/dm/minimax-status.svg)](https://www.npmjs.com/package/minimax-status)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
- [![VSCode Extension](https://img.shields.io/badge/VSCode-MiniMax-blue?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=JochenYang.minimax-status-vscode)
7
-
8
- MiniMax Token-Plan 使用状态监控工具,支持 CLI 命令和 Claude Code 状态栏集成。
9
-
10
- ## 版本
11
-
12
- | 插件 | 版本 | 安装方式 |
13
- |------|------|----------|
14
- | **CLI** | 1.2.2 | `npm install -g minimax-status` |
15
- | **VSCode** | 1.4.0 | [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=JochenYang.minimax-status-vscode) 或 [下载 VSIX](https://github.com/JochenYang/minimax-status/releases) |
16
-
17
- ## 特性
18
-
19
- - ✅ **实时状态监控**: 显示 MiniMax Token-Plan 使用额度、剩余次数、重置时间
20
- - ✅ **套餐卡 Tooltip**(VSCode 1.4.0+): 5h 限额 / 周限额 / 视频赠送 / Hailuo / music / image / speech 各自独立卡片,跟官网一致
21
- - ✅ **上下文窗口跟踪**: 智能解析转录文件,准确显示当前会话的上下文使用量
22
- - ✅ **多种显示模式**: 详细模式、紧凑模式、持续状态栏
23
- - ✅ **Claude Code 集成**: 可在 Claude Code 底部状态栏显示
24
- - ✅ **智能颜色编码**: 根据使用率自动切换颜色和图标
25
- - ✅ **跨会话支持**: 自动从项目历史中查找上下文信息
26
- - **简洁命令**: `minimax status` 查看状态
27
- - ✅ **安全存储**: 凭据存储在独立的配置文件中
28
-
29
- > **注意**: 1.4.0 起,MiniMax 官方更新了用量接口(`/v1/token_plan/remains` → `/v1/api/openplatform/coding_plan/remains`)。本工具同步切换。海外端(`minimax.io`)也同步切换。
30
-
31
- ## 快速开始
32
-
33
- ### 1. 安装
34
-
35
- ```bash
36
- npm install -g minimax-status
37
- ```
38
-
39
- ### 2. 更新(如果已经安装)
40
-
41
- ```bash
42
- npm update -g minimax-status
43
- ```
44
-
45
- ### 3. 配置认证
46
-
47
- ```bash
48
- minimax auth <token>
49
- ```
50
-
51
- 配置信息将保存在 `~/.minimax-config.json` 文件中。
52
-
53
- > 自 1.2.6 起,CLI 不再需要 GroupId 配置 — 用量接口从 token JWT 自动解析 group_id。
54
-
55
- 获取令牌:
56
-
57
- 1. 访问 [MiniMax 开放平台](https://platform.minimaxi.com/user-center/payment/coding-plan)
58
- 2. 登录并进入控制台
59
- 3. Coding Plan 中创建或获取 API Key
60
-
61
- ### 4. 查看状态
62
-
63
- ```bash
64
- # 详细模式
65
- minimax status
66
-
67
- # 紧凑模式
68
- minimax status --compact
69
-
70
- # 持续监控模式
71
- minimax status --watch
72
-
73
- # 所有模型
74
- minimax list
75
- ```
76
-
77
- ## VSCode 扩展
78
-
79
- 提供 VSCode 扩展版本,支持在 VSCode 底部状态栏显示使用状态。
80
-
81
- ### 安装方式
82
-
83
- **方式一:从 VSCode 市场安装(推荐)**
84
-
85
- 1. VSCode 中搜索 "MiniMax Status"
86
- 2. 点击安装
87
-
88
- **方式二:下载 VSIX 文件**
89
-
90
- 1. 访问 [GitHub Releases](https://github.com/JochenYang/minimax-status/releases)
91
- 2. 下载最新的 `.vsix` 文件
92
- 3. 在 VSCode 中按 `Ctrl+Shift+P`
93
- 4. 输入 "Extensions: Install from VSIX..."
94
- 5. 选择下载的 VSIX 文件
95
-
96
- **方式二:从源码构建**
97
-
98
- ```bash
99
- git clone https://github.com/JochenYang/minimax-status.git
100
- cd minimax-status/vscode-extension
101
- npm install
102
- npm run package
103
- # 在 VSCode 中安装生成的 .vsix 文件
104
- ```
105
-
106
- ### 配置步骤
107
-
108
- 1. 安装扩展后,点击状态栏的 "MiniMax 未配置" 按钮
109
- 2. 或使用命令 "MiniMax Status: 配置向导"
110
- 3. 输入您的 API Key
111
- 4. 配置完成后,状态栏将显示实时使用状态
112
-
113
- ## Claude Code 集成
114
-
115
- 将 MiniMax 使用状态显示在 Claude Code 底部状态栏。
116
-
117
- ### 配置步骤
118
-
119
- 1. **安装和配置工具**:
120
-
121
- ```bash
122
- npm install -g minimax-status
123
- minimax auth <token>
124
- ```
125
-
126
- 2. **配置 Claude Code**:
127
-
128
- 编辑 `~/.claude/settings.json`:
129
-
130
- ```json
131
- {
132
- "statusLine": {
133
- "type": "command",
134
- "command": "minimax statusline"
135
- }
136
- }
137
- ```
138
-
139
- 3. **重启 Claude Code**
140
-
141
- 集成成功后,底部状态栏将显示:
142
-
143
- ```
144
- cli main * MiniMax-M3[1M][1m] 25% · 249.5k 5h 41% · W 6% 2h59m 剩291天
145
- ```
146
-
147
- 显示格式:`目录 ❯ 分支 ❯ 模型 ❯ 上下文窗口% · token ❯ 5h限额% · 周限额% ❯ 5h倒计时 ❯ 到期天数`
148
-
149
- **字段说明**:
150
-
151
- | 字段 | 示例 | 含义 |
152
- |------|------|------|
153
- | 目录 | `cli` | 当前工作目录(短名) |
154
- | 分支 | `main *` | Git 分支 + 未提交状态(`*`) |
155
- | 模型 | `MiniMax-M3[1M][1m]` | 实时模型名(从 stdin 读) |
156
- | 上下文 | `25% · 249.5k` | 上下文窗口使用 % + token 用量 |
157
- | 5h 限额 | `5h 41% · W 6%` | 5h 限额百分比 + 周限额百分比 |
158
- | 倒计时 | `2h59m` | 5h 限额下次重置倒计时 |
159
- | 到期 | `剩291天` | 套餐到期剩余天数 |
160
-
161
- > 1.2.2 起,5h 限额 block **总是显示**(即使 `total=0`),并加 `5h` 前缀区分上下文窗口。`total=0` 时不显示 `(X/Y)` 段。
162
-
163
- **颜色说明**:
164
-
165
- - **使用量**: ≥85%红色 | 60-85%黄色 | <60%绿色
166
- - **到期时间**: ≤3天红色 | ≤7天黄色 | >7天绿色
167
-
168
- ### Git 分支显示说明
169
-
170
- 状态栏会显示当前 Git 分支信息:
171
-
172
- ```
173
- my-app │ main * │ ...
174
- ```
175
-
176
- **符号说明**:
177
-
178
- | 符号 | 含义 |
179
- |------|------|
180
- | * | 有未提交的更改 |
181
-
182
- **颜色规则**:
183
-
184
- | 元素 | 颜色 | 说明 |
185
- |------|------|------|
186
- | 主分支 (main/master) | 绿色 | 默认/主分支 |
187
- | 其他分支 | 白色 | 普通功能分支 |
188
- | ⬆ 未推送 | 黄色 | 有待推送的 commit |
189
- | 未拉取 | 青色 | 有待拉取的 commit |
190
- | • 未提交 | 红色 | 工作区有未提交的更改 |
191
-
192
- ### 上下文窗口显示说明
193
-
194
- 状态栏会智能显示当前会话的上下文窗口使用情况:
195
-
196
- - **有转录数据时**: 显示 `百分比 · 已用 tokens`(蓝色块)
197
- - 例如: `25% · 249.5k` 表示已使用 249.5K tokens,占上下文窗口的 25%
198
-
199
- - **无转录数据时**: 仅显示上下文窗口总容量
200
- - 例如: `205K` 表示当前模型的上下文窗口大小
201
-
202
- > 1.2.2 起,5h 限额独立显示在 `5h 41%` block(带 `5h` 前缀区分上下文窗口百分比)。
203
-
204
- **智能特性**:
205
-
206
- - 自动解析 Claude Code 转录文件(transcript)
207
- - ✅ 支持 Anthropic 和 OpenAI 两种 token 格式
208
- - 正确计算缓存 tokens(cache creation + cache read)
209
- - ✅ 跨会话查找:当前会话无数据时,自动从项目历史中查找
210
- - ✅ 处理 summary 类型条目和 leafUuid 引用
211
-
212
- **注意**: MiniMax 的配置独立存储在 `~/.minimax-config.json`,与 Claude Code 的配置分离。
213
-
214
- ## Droid 集成
215
-
216
- MiniMax 使用状态显示在 Droid 底部状态栏。
217
-
218
- ### 配置步骤
219
-
220
- 1. **安装和配置工具**:
221
-
222
- ```bash
223
- npm install -g minimax-status
224
- minimax auth <token>
225
- ```
226
-
227
- 2. **配置 Droid**:
228
-
229
- 编辑 `~/.factory/settings.json`:
230
-
231
- ```json
232
- {
233
- "statusLine": {
234
- "type": "command",
235
- "command": "minimax droid-statusline"
236
- }
237
- }
238
- ```
239
-
240
- 3. **重启 Droid**
241
-
242
- 集成成功后,底部状态栏将显示:
243
-
244
- ```
245
- cli main * MiniMax-M3[1M][1m] 25% · 249.5k 5h 41% · W 6% 2h59m 剩291天
246
- ```
247
-
248
- 显示格式:`目录 ❯ 分支 ❯ 模型 ❯ 上下文窗口% · token ❯ 5h限额% · 周限额% ❯ 5h倒计时 ❯ 到期天数`
249
-
250
- **颜色说明**:
251
-
252
- - **使用量**: ≥85%红色 | 60-85%黄色 | <60%绿色
253
- - **到期时间**: ≤3天红色 | ≤7天黄色 | >7天绿色
254
-
255
- ## 显示示例
256
-
257
- ### 详细模式
258
-
259
- ```
260
- ┌──────────────────────────────────────────────────────┐
261
- │ MiniMax Claude Code 使用状态 │
262
- │ │
263
- │ 剩余时间: 3 小时 17 分钟后重置 │
264
- │ │
265
- │ 已用额度: █████████░░░░░░░░░░░░░░░░░░ 33% │
266
- │ │
267
- │ 周限额: ░░░░░░░░░░░░░░░ 5% │
268
- │ 重置: 6 天 12 小时后重置 │
269
- │ 套餐到期: 03/19/2027 (还剩 291 天) │
270
- │ │
271
- │ Token 消耗统计 │
272
- │ 昨日消耗: 766.3万 │
273
- │ 近7天消耗: 1039.9万 │
274
- │ 当月消耗: 0 │
275
- │ │
276
- │ 所有模型额度 │
277
- │ general 33% — OK │
278
- │ video 0% 0/3 OK │
279
- │ ... │
280
- │ │
281
- │ 状态: 正常使用 │
282
- └──────────────────────────────────────────────────────┘
283
- ```
284
-
285
- > 自 1.2.2 起:移除"当前模型"和"时间窗口"行(冗余信息),去除 emoji(`📊` `📋` `✓` `⚡` `⛔`),`total=0` 时不显示 `(X/Y)` 段。
286
-
287
- ### 紧凑模式
288
-
289
- ```
290
- general 33% 3h17m W 5% 剩291天
291
- ```
292
-
293
- > 紧凑模式直接调用 `minimax status --compact`。字段顺序:`已用% 倒计时 周限额% 剩N天`。
294
- ```
295
-
296
- ### 持续状态栏模式
297
-
298
- ```
299
- OK MiniMax 状态栏已启动
300
- 按 Ctrl+C 退出
301
-
302
- [general 27% 1h26m W 5%
303
- ```
304
-
305
- ## 截图演示
306
-
307
- ### Claude Code 集成
308
-
309
- ![Claude Code StatusBar](./images/claude%20code.png)
310
-
311
- ### Droid 集成
312
-
313
- ![Droid StatusBar](./images/droid.png)
314
-
315
- ## 命令说明
316
-
317
- | 命令 | 描述 | 示例 |
318
- | --------------------- | ------------------------------------------- | ----------------------------- |
319
- | `minimax auth` | 设置认证凭据(只需要 token,不需要 groupId) | `minimax auth <token>` |
320
- | `minimax status` | 显示当前使用状态(支持 --compact、--watch) | `minimax status` |
321
- | `minimax list` | 列出所有模型用量 | `minimax list` |
322
- | `minimax health` | 检查配置和连接状态 | `minimax health` |
323
- | `minimax bar` | 终端底部持续状态栏 | `minimax bar` |
324
- | `minimax statusline` | Claude Code 状态栏集成 | 用于 Claude Code 配置 |
325
- | `minimax droid-statusline` | Droid 状态栏集成 | 用于 Droid 配置 |
326
-
327
- ## 状态说明
328
-
329
- ### 显示元素
330
-
331
- | 元素 | 说明 |
332
- | ------ | ---------------------------------- |
333
- | 目录 | 当前工作目录 |
334
- | 分支 | Git 分支名称(含未提交状态) |
335
- | 模型 | MiniMax 模型名称(实时) |
336
- | 上下文 | 上下文窗口使用 % + tokens |
337
- | 5h 限额 | 5h 限额使用 %(即使 total=0 也显示)|
338
- | 周限额 | 周配额使用情况,∞ 表示无限制 |
339
- | 倒计时 | 5h 限额重置倒计时 |
340
- | 到期 | 订阅到期时间(颜色动态变化) |
341
-
342
- ### 颜色规则
343
-
344
- | 场景 | 颜色 | 说明 |
345
- | ------------- | ---- | -------- |
346
- | 5h 限额 ≥85% | 红色 | 危险状态 |
347
- | 5h 限额 60-85% | 黄色 | 注意使用 |
348
- | 5h 限额 <60% | 绿色 | 正常使用 |
349
- | 上下文 ≥85% | 红色 | 危险状态 |
350
- | 上下文 60-85% | 黄色 | 注意使用 |
351
- | 上下文 <60% | 绿色 | 正常使用 |
352
- | 到期 ≤ 3天 | 红色 | 即将到期 |
353
- | 到期 ≤ 7天 | 黄色 | 即将到期 |
354
- | 到期 > 7天 | 绿色 | 订阅正常 |
355
-
356
- ## VSCode 扩展说明
357
-
358
- 自 1.4.0 起,VSCode 扩展 Tooltip 改用**套餐卡**布局(跟官网 platform.minimaxi.com/console/usage 一致),不再用统一表格。
359
-
360
- ### 套餐卡布局
361
-
362
- 每张套餐独立卡片:
363
-
364
- ```
365
- MINIMAX · 配额面板 周期: 2026-06-01 — 2026-06-07
366
- ─────────────────────────────────────────
367
-
368
- ▍ 5h 限额 · 4h 12m 后重置
369
- ▰▰▰░░░░░░░░░░░░░ 18%
370
-
371
- ▍ 周限额 · 6天 12h 后重置
372
- ▰░░░░░░░░░░░░░░░ 3%
373
-
374
- ▍ 视频赠送 · 13h 18m 后重置
375
- ░░░░░░░░░░░░░░░░ 0% 0/3
376
-
377
- ─────────────────────────────────────────
378
- Token 消耗
379
- 昨日消耗 近 7 天 当月消耗
380
- 766.3万 1039.9万 0
381
- ─────────────────────────────────────────
382
- 到期 291天 · 更新于 11:09:40 · 点击刷新
383
- ```
384
-
385
- > **进度条字符** `▰` `▱` (U+25B0 / U+25B1):在中文 fallback 字体(Microsoft YaHei)下渲染为斜方块纹理。在 Cascadia Code / Consolas 等宽字体下渲染为实心方块。
386
-
387
- ### 套餐卡字段
388
-
389
- | 套餐 | 数据来源 | 示例 |
390
- |------|----------|------|
391
- | 5h 限额 | `general` 模型 `current_interval_*` | `▰▰▰░░░ 18%` |
392
- | 周限额 | `general` 模型 `current_weekly_*` | `▰░░░░░ 3%` |
393
- | 视频赠送 | `video` 模型 `current_interval_*` | `░░░░░░ 0% 0/3` |
394
- | Hailuo | `Hailuo-*` 模型 | `▰▰░░░░░ 33% 1/3` |
395
- | music | `music-*` 模型 | `░░░░░░ 0% 0/10` |
396
- | image | `image-*` 模型 | `░░░░░░ 0% 0/20` |
397
- | speech | `speech-*` 模型 | `░░░░░░ 0% 0/100` |
398
-
399
- > **多模型数据过滤规则**:保留有 `remaining_percent` 数据的模型(即使 `total=0`)。`status != 1` 的模型视为废弃,不显示。
400
-
401
- ### 已知限制:积分余额不在 VSCode 中显示
402
-
403
- MiniMax 官方积分余额接口(`/backend/account/token_plan_credit`)**仅支持 Cookie 鉴权**:
404
-
405
- - ✅ 浏览器(带 Cookie):能调通
406
- - ❌ VSCode 扩展(纯后端 Bearer sk-cp-...):401 not login
407
-
408
- 如需查看积分余额,请前往 [platform.minimaxi.com/console/usage](https://platform.minimaxi.com/console/usage)。本工具**未实现**积分余额的本地展示,**因为**让用户在 VSCode 设置里手动粘贴 Cookie 字符串得不偿失。
409
-
410
- ## 配置文件
411
-
412
- ### 默认位置
413
-
414
- - 独立配置文件: `~/.minimax-config.json`
415
-
416
- ### 配置示例
417
-
418
- ```json
419
- {
420
- "token": "your_access_token_here"
421
- }
422
- ```
423
-
424
- ### Claude Code 配置
425
-
426
- Claude Code 只需要配置状态栏命令:
427
-
428
- ```json
429
- // ~/.claude/settings.json
430
- {
431
- "statusLine": {
432
- "type": "command",
433
- "command": "minimax statusline"
434
- }
435
- }
436
- ```
437
-
438
- ### 安全说明
439
-
440
- 凭据仅存储在本地,不会上传到任何服务器。
441
-
442
- ## 故障排除
443
-
444
- ### 命令未找到
445
-
446
- ```bash
447
- # 确保已全局安装
448
- npm install -g minimax-status
449
-
450
- # 重新打开终端
451
- ```
452
-
453
- ### 认证失败
454
-
455
- ```bash
456
- # 检查令牌
457
- minimax status
458
-
459
- # 重新设置认证
460
- minimax auth <new_token>
461
- ```
462
-
463
- ### 状态栏不显示
464
-
465
- 1. 检查 Claude Code 配置
466
- 2. 重启 Claude Code
467
- 3. 手动测试: `minimax statusline`
468
-
469
- ## 开发
470
-
471
- ### 构建项目
472
-
473
- ```bash
474
- git clone <repository>
475
- cd minimax-status
476
- npm install
477
- ```
478
-
479
- ### 测试
480
-
481
- ```bash
482
- # 运行示例
483
- node cli/example.js
484
-
485
- # 测试 CLI 命令
486
- node cli/index.js status
487
- ```
488
-
489
- ## 许可证
490
-
491
- MIT License - 详见 [LICENSE](LICENSE) 文件
492
-
493
- ## 贡献
494
-
495
- 欢迎提交 Issue 和 Pull Request!
496
-
497
- ## 导航
498
-
499
- | 客户端 | 路径 | 说明 |
500
- |--------|------|------|
501
- | **CLI** | [`cli/`](cli/) | 命令行工具,npm 全局包 |
502
- | **VSCode** | [`vscode-extension/`](vscode-extension/) | VSCode 状态栏集成 |
503
-
504
- ---
505
-
506
- ## 相关链接
507
-
508
- - [MiniMax 开放平台](https://platform.minimaxi.com/)
509
-
510
- ---
511
-
512
- **注意**: 本工具仅用于监控 MiniMax Token-Plan 用量使用状态,不存储或传输任何用户数据。
1
+ # MiniMax StatusBar
2
+
3
+ [![npm version](https://img.shields.io/npm/v/minimax-status.svg)](https://www.npmjs.com/package/minimax-status)
4
+ [![npm downloads](https://img.shields.io/npm/dm/minimax-status.svg)](https://www.npmjs.com/package/minimax-status)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![VSCode Extension](https://img.shields.io/badge/VSCode-MiniMax-blue?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=JochenYang.minimax-status-vscode)
7
+
8
+ MiniMax Token-Plan 用量监控工具,支持 CLI Claude Code / Droid 状态栏集成。
9
+
10
+ ## 版本
11
+
12
+ | 插件 | 版本 | 安装方式 |
13
+ |------------|-------|------------------------------------------------------------------------------------------------------------|
14
+ | **CLI** | 1.2.5 | `npm install -g minimax-status` |
15
+ | **VSCode** | 1.5.0 | [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=JochenYang.minimax-status-vscode) |
16
+
17
+ ## 特性
18
+
19
+ - ✅ **套餐卡显示**(VSCode Tooltip)— 5h 限额 / 周限额 / 视频赠送 / Hailuo / music / image / speech 各自独立卡片,跟官网 platform.minimaxi.com/console/usage 一致
20
+ - ✅ **剩余%语义**(VSCode 1.5.0+ / CLI 1.2.5+)— 所有显示都按"剩余%",避免歧义(剩得多绿、剩得少红)
21
+ - ✅ **Claude Code / Droid 集成** — 状态栏实时显示用量,powerline 风格
22
+ - ✅ **CLI 多种模式** — 详细 / 紧凑 / 持续监控
23
+ - ✅ **上下文窗口跟踪** Claude Code 实时上下文用量
24
+ - ✅ **Token 消耗统计** — 昨日 / 近 7 天 / 当月
25
+
26
+ > VSCode 1.5.0 / CLI 1.2.5 起,所有用量数据按"剩余%"显示,跟 MiniMax 官方 platform.minimaxi.com/console/usage 平台一致。
27
+
28
+ ## 快速开始
29
+
30
+ ### 1. 安装
31
+
32
+ ```bash
33
+ npm install -g minimax-status
34
+ ```
35
+
36
+ ### 2. 更新(已安装用户)
37
+
38
+ ```bash
39
+ npm update -g minimax-status
40
+ ```
41
+
42
+ ### 3. 配置认证
43
+
44
+ ```bash
45
+ minimax auth <token>
46
+ ```
47
+
48
+ 配置信息保存在 `~/.minimax-config.json`。自 1.2.6 起 CLI 不需要 GroupId(用量接口从 token JWT 自动解析)。
49
+
50
+ 获取令牌:访问 [MiniMax 开放平台](https://platform.minimaxi.com/console/plan) → 套餐详情 → 创建或获取复制 API Key。
51
+
52
+ ### 4. 查看状态
53
+
54
+ ```bash
55
+ minimax status # 详细模式
56
+ minimax status --compact # 紧凑模式
57
+ minimax status --watch # 持续监控
58
+ minimax list # 所有模型
59
+ minimax health # 配置和连接检查
60
+ ```
61
+
62
+ ## Claude Code 集成
63
+
64
+ 编辑 `~/.claude/settings.json`:
65
+
66
+ ```json
67
+ {
68
+ "statusLine": {
69
+ "type": "command",
70
+ "command": "minimax statusline"
71
+ }
72
+ }
73
+ ```
74
+
75
+ 重启 Claude Code 后,状态栏会显示:
76
+
77
+ ```
78
+ cli main * MiniMax-M3[1M] 25% · 249.5k 5h 41% · W 94% 2h59m 剩291天
79
+ ```
80
+
81
+ 字段说明:
82
+
83
+ | 字段 | 示例 | 含义 |
84
+ |--------------------|-------------------------------------|-----------------------------------------------------------|
85
+ | 目录 / 分支 / 模型 | `cli` / `main *` / `MiniMax-M3[1M]` | 工作目录 / Git 分支 / 实时模型 |
86
+ | 上下文 | `25% · 249.5k` | 当前会话上下文使用 % + token 数 |
87
+ | 5h 剩余 | `5h 41% · W 94%` | 5h 限额剩余 % + 周限额剩余 %(绿色 = 充裕,红色 = 即将用完) |
88
+ | 倒计时 | `2h59m` | 5h 限额重置倒计时 |
89
+ | 到期 | `剩291天` | 套餐到期剩余天数 |
90
+
91
+ ## Droid 集成
92
+
93
+ Claude Code 一样,编辑 `~/.factory/settings.json`:
94
+
95
+ ```json
96
+ {
97
+ "statusLine": {
98
+ "type": "command",
99
+ "command": "minimax droid-statusline"
100
+ }
101
+ }
102
+ ```
103
+
104
+ ## VSCode 扩展
105
+
106
+ ### 安装
107
+
108
+ - 扩展市场搜索 "MiniMax Status" 一键安装
109
+ - 或下载 `.vsix`:[GitHub Releases](https://github.com/JochenYang/minimax-status/releases)
110
+
111
+ ### Tooltip 套餐卡布局
112
+
113
+ VSCode 扩展 hover 时显示套餐卡(每套餐独立卡片):
114
+
115
+ ```
116
+ MINIMAX · 配额面板 周期: 2026-06-01 — 2026-06-07
117
+
118
+ ▍ 5h 剩余 · 4h 12m 后重置
119
+ ▰▰▰░░░░░░░░░░░░░ 18%
120
+
121
+ ▍ 周剩余 · 6天 12h 后重置
122
+ ▰░░░░░░░░░░░░░░░ 94%
123
+
124
+ ▍ 视频赠送 · 13h 18m 后重置
125
+ ░░░░░░░░░░░░░░░░ 100% 3/3 剩余
126
+
127
+ ─────────
128
+ Token 消耗
129
+ 昨日消耗 近 7 天 当月消耗
130
+ 766.3万 1039.9万 0
131
+ ─────────
132
+ 到期 291天 · 更新于 11:09:40 · 点击刷新
133
+ ```
134
+
135
+ 字段说明:
136
+
137
+ - **套餐标签**(行 1):套餐名 + `X/Y 剩余`(总配额和剩余次数)+ 重置时间
138
+ - **进度条 + 百分比**(行 2):按"剩余%"显示(剩 ≥60% 绿、剩 30-60% 橙、剩 <30% 红)
139
+ - 套餐类型:5h 限额 / 周限额 / 视频赠送 / Hailuo / music / image / speech
140
+
141
+ ### VSCode 状态栏
142
+
143
+ `5h 5% · 周剩 94% · 剩291天` — 5h 已用% + 周剩余% + 套餐到期天数。
144
+
145
+ ## CLI 显示示例
146
+
147
+ ### 详细模式
148
+
149
+ ```
150
+ ┌──────────────────────────────────────────────────────┐
151
+ MiniMax Claude Code 使用状态 │
152
+ │ │
153
+ 剩余时间: 4 小时 48 分钟后重置 │
154
+ │ │
155
+ 5h 剩余: ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 97% │
156
+ │ │
157
+ 周剩余: ░░░░░░░░░░░░░░░ 100% · 5天 23小时后重置 │
158
+ │ │
159
+ 套餐到期: 03/19/2027 (还剩 290 天) │
160
+ │ │
161
+ Token 消耗统计 │
162
+ │ 昨日消耗: 0 │
163
+ │ 近7天消耗: 1039.9万 │
164
+ │ 当月消耗: 0 │
165
+ │ │
166
+ 所有模型额度 │
167
+ │ general 98% — OK │
168
+ │ video 100% 3/3 OK │
169
+ │ │
170
+ 状态: 正常使用 │
171
+ └──────────────────────────────────────────────────────┘
172
+ ```
173
+
174
+ - 5h 限额 / 周限额 全部按"剩余%"显示(跟平台官网一致)
175
+ - 视频赠送等小额度套餐:`3/3 剩余`(剩余 3 / 总额 3)
176
+
177
+ ### 紧凑模式
178
+
179
+ ```
180
+ general 98% 4h48m W 100% 剩290天
181
+ ```
182
+
183
+ ### 持续监控
184
+
185
+ ```
186
+ OK MiniMax 状态栏已启动
187
+ Ctrl+C 退出
188
+
189
+ general 27% 1h26m W 5%
190
+ ```
191
+
192
+ ## 命令说明
193
+
194
+ | 命令 | 描述 |
195
+ |----------------------------|------------------------------------------------|
196
+ | `minimax auth <token>` | 设置认证凭据(只需要 token) |
197
+ | `minimax status` | 显示详细使用状态(支持 `--compact` / `--watch`) |
198
+ | `minimax list` | 列出所有模型用量 |
199
+ | `minimax health` | 检查配置和连接(配置文件、Token、API 连接) |
200
+ | `minimax bar` | 终端底部持续状态栏 |
201
+ | `minimax statusline` | Claude Code 状态栏集成 |
202
+ | `minimax droid-statusline` | Droid 状态栏集成 |
203
+
204
+ ## 颜色规则
205
+
206
+ CLI 端按"剩余%"判断颜色(剩 ≥60% 绿、剩 30-60% 橙、剩 <30% 红),跟 platform.minimaxi.com/console/usage 平台一致。
207
+
208
+ VSCode 状态栏按"已用%"判断(已用 <60% 绿、<85% 橙、≥85% 红),符合"用得少=充裕"直觉。
209
+
210
+ ## 已知限制
211
+
212
+ **积分余额(充值/赠送)**不在本工具中显示。MiniMax 官方积分接口(`/backend/account/token_plan_credit`)仅支持 Cookie 鉴权,纯后端工具(VSCode 扩展 / CLI)无法调用。如需查看请前往 [platform.minimaxi.com](https://platform.minimaxi.com/console/usage)。
213
+
214
+ ## 故障排除
215
+
216
+ **状态栏不显示**:检查 Claude Code / Droid 配置 → 重启 → 手动测试 `minimax statusline`
217
+
218
+ **认证失败**:`minimax status` 看错误信息 → `minimax auth <new_token>` 重新设置
219
+
220
+ **命令未找到**:`npm install -g minimax-status` 重装
221
+
222
+ ## 许可证
223
+
224
+ MIT - 详见 [LICENSE](LICENSE) 文件
@@ -0,0 +1,19 @@
1
+ # 更新日志
2
+
3
+ ## [1.2.5] - 2026-06-01
4
+
5
+ ### 优化
6
+
7
+ - **CLI 状态显示统一为"剩余"语义**(跟平台官网 platform.minimaxi.com/console/usage 对齐):
8
+ - 5h 限额 / 周限额 字段全部按"剩余%"显示,跟平台官网一致
9
+ - 主面板"已用额度"标签改为"5h 剩余","周限额"改为"周剩余"
10
+ - 视频赠送等小额度套餐副文本显示"X/Y 剩余"(之前显示"已用/总额",**反**了)
11
+ - 状态颜色按"剩余%"映射:剩 ≥60% 绿 / 剩 <60% 橙 / 剩 <30% 红
12
+ - **进度条按"已用%"填充**(剩得多→填得少),颜色按"剩余%"判断
13
+ - 之前 1.2.2 改动错误地按"已用%"显示(`100 - remaining_percent`),这次**纠正字段语义**直接用 `remaining_percent`
14
+
15
+ ## [1.2.4] - 2026-05-31
16
+
17
+ ### 修复
18
+
19
+ - `minimax health` 移除 GroupID 字段检查(避免 1.2.6 后 GroupId 不再需要但仍报错"未配置"假阳性)
package/cli/api.js CHANGED
@@ -297,32 +297,39 @@ class MinimaxAPI {
297
297
  const endTime = new Date(modelData.end_time);
298
298
 
299
299
  // Calculate counts
300
- // ⚠ 新接口 usage_count video 上语义不一致(usage=3/total=3 但 remaining_percent=100
301
- // 表示 0% 已用),用 usedPercentage 反算 used(用户视角 = 基于官网显示的已用%)。
302
- // 这让 video: total=3, usedPercentage=0 → used=0, remaining=3("3/3 剩余"),跟官网一致。
300
+ // ⚠ 1.2.5 字段语义修正:跟 vscode 1.2.5 对齐,`*_remaining_percent` 字面就是"剩余%"。
301
+ // 直接用 `remaining_percent` 当"剩余%"显示,不再反转算"已用%"。
302
+ // 进度条颜色按"剩余%"映射(剩 ≥60% 绿、30-60% 黄、<30% 红)。
303
+ // 副文本 "X/Y 剩余" 基于 `total × (remainingPercent/100)` 算剩余次数。
303
304
  const totalCount = modelData.current_interval_total_count;
304
305
  const remainingPct = modelData.current_interval_remaining_percent;
305
- const usedPercentage = remainingPct !== undefined && remainingPct !== null
306
- ? Math.round(100 - remainingPct)
307
- : (totalCount > 0 ? Math.round((modelData.current_interval_usage_count / totalCount) * 100) : 0);
308
- const usedCount = totalCount > 0 ? Math.round((totalCount * usedPercentage) / 100) : 0;
309
- const remainingCount = totalCount - usedCount;
306
+ const percentage = remainingPct !== undefined && remainingPct !== null
307
+ ? Math.round(remainingPct)
308
+ : null;
309
+ // 剩余次数 = total × (remainingPercent / 100)
310
+ const remainingCount = (totalCount > 0 && percentage !== null)
311
+ ? Math.round((totalCount * percentage) / 100)
312
+ : 0;
313
+ // 保留 usedCount 字段名(向后兼容),但语义是"剩余次数"
314
+ const usedCount = remainingCount;
310
315
 
311
316
  // Calculate remaining time in human-readable format
312
317
  const remainingMs = modelData.remains_time;
313
318
  const hours = Math.floor(remainingMs / (1000 * 60 * 60));
314
319
  const minutes = Math.floor((remainingMs % (1000 * 60 * 60)) / (1000 * 60));
315
320
 
316
- // Calculate weekly usage data — 同样基于 remaining_percent 反转
317
- const weeklyUsed = modelData.current_weekly_usage_count;
321
+ // Calculate weekly usage data — 同样直接用 remaining_percent 字面
318
322
  const weeklyTotal = modelData.current_weekly_total_count;
319
323
  const weeklyRemainingPct = modelData.current_weekly_remaining_percent;
320
324
  const weeklyPercentage = weeklyRemainingPct !== undefined && weeklyRemainingPct !== null
321
- ? Math.round(100 - weeklyRemainingPct)
322
- : (weeklyTotal > 0 ? Math.floor((weeklyUsed / weeklyTotal) * 100) : 0);
323
- // Bug fix: 旧逻辑 weeklyTotal === 0 unlimited,但主人账号的 `general`
324
- // 模型 weekly_total=0、weekly_remaining_percent=97(3% 已用,有数据)。
325
- // 真正的"无限"应当是 total=0 **且** remaining_percent 也没返回。
325
+ ? Math.round(weeklyRemainingPct)
326
+ : null;
327
+ const weeklyRemainingCount = (weeklyTotal > 0 && weeklyPercentage !== null)
328
+ ? Math.round((weeklyTotal * weeklyPercentage) / 100)
329
+ : 0;
330
+ // 字段名保留 weeklyUsed,但语义是"剩余次数"
331
+ const weeklyUsed = weeklyRemainingCount;
332
+ // ⚠ "无周限"判定:周总额=0 **且** remaining_percent 也没返回(极少见)
326
333
  const weeklyUnlimited = weeklyTotal === 0 && (modelData.current_weekly_remaining_percent == null);
327
334
  const weeklyRemainingMs = modelData.weekly_remains_time;
328
335
  const weeklyDays = Math.floor(weeklyRemainingMs / (1000 * 60 * 60 * 24));
@@ -394,15 +401,17 @@ class MinimaxAPI {
394
401
  : `${minutes} 分钟后重置`,
395
402
  },
396
403
  usage: {
397
- used: usedCount,
404
+ // ⚠ 1.2.5 字段语义修正:`usage.percentage` 现在是"剩余%"(不是"已用%")
405
+ used: usedCount, // 字段名保留(向后兼容),语义是"剩余次数"
398
406
  remaining: remainingCount,
399
407
  total: modelData.current_interval_total_count,
400
- percentage: usedPercentage,
408
+ percentage: percentage, // "剩余%"(100-remaining_percent 反转算的)
401
409
  },
402
410
  weekly: {
403
- used: weeklyUsed,
411
+ // ⚠ 1.2.5 字段语义修正:`weekly.percentage` 现在是"剩余%"
412
+ used: weeklyUsed, // 字段名保留(向后兼容),语义是"剩余次数"
404
413
  total: weeklyTotal,
405
- percentage: weeklyPercentage,
414
+ percentage: weeklyPercentage, // "剩余%"
406
415
  days: weeklyDays,
407
416
  hours: weeklyHours,
408
417
  unlimited: weeklyUnlimited,
@@ -426,35 +435,43 @@ class MinimaxAPI {
426
435
  }
427
436
 
428
437
  return apiData.model_remains.map(modelData => {
438
+ // ⚠ 1.2.5 字段语义修正:`percentage` 现在是"剩余%"(直接用 `remaining_percent`,不反转)
429
439
  const totalCount = modelData.current_interval_total_count;
430
- // ⚠ 新接口 usage_count 在 video 上语义不一致;用 usedPercentage 反算 used
431
- // 跟官网一致:video total=3, used%=0 → used=0, remaining=3("3/3 剩余")
432
440
  const remainingPct = modelData.current_interval_remaining_percent;
433
- const usedPercentage = remainingPct !== undefined && remainingPct !== null
434
- ? Math.round(100 - remainingPct)
435
- : (totalCount > 0 ? Math.round((modelData.current_interval_usage_count / totalCount) * 100) : 0);
436
- const usedCount = totalCount > 0 ? Math.round((totalCount * usedPercentage) / 100) : 0;
437
- const remainingCount = totalCount - usedCount;
438
-
439
- // Weekly data — 同样基于 remaining_percent 反转
441
+ const percentage = remainingPct !== undefined && remainingPct !== null
442
+ ? Math.round(remainingPct)
443
+ : null;
444
+ // 剩余次数 = total × (remainingPercent / 100)
445
+ const remainingCount = (totalCount > 0 && percentage !== null)
446
+ ? Math.round((totalCount * percentage) / 100)
447
+ : 0;
448
+ // 保留 used 字段名(向后兼容),但语义是"剩余次数"
449
+ const usedCount = remainingCount;
450
+
451
+ // Weekly data — 同样直接用 remaining_percent 字面(不反转)
440
452
  const weeklyTotal = modelData.current_weekly_total_count || 0;
441
- const weeklyUsed = modelData.current_weekly_usage_count || 0;
442
- const weeklyRemainingCount = weeklyTotal - weeklyUsed;
443
453
  const weeklyRemainingPct = modelData.current_weekly_remaining_percent;
444
454
  const weeklyPercentage = weeklyRemainingPct !== undefined && weeklyRemainingPct !== null
445
- ? Math.round(100 - weeklyRemainingPct)
446
- : (weeklyTotal > 0 ? Math.floor((weeklyUsed / weeklyTotal) * 100) : 0);
455
+ ? Math.round(weeklyRemainingPct)
456
+ : null;
457
+ // 剩余次数 = weeklyTotal × (remainingPercent / 100)
458
+ const weeklyRemainingCount = (weeklyTotal > 0 && weeklyPercentage !== null)
459
+ ? Math.round((weeklyTotal * weeklyPercentage) / 100)
460
+ : 0;
461
+ // 字段名保留 weeklyUsed,但语义是"剩余次数"
462
+ const weeklyUsed = weeklyRemainingCount;
447
463
  // Bug fix: 同 parseUsageData — 真正"无限"是 total=0 且 remaining_percent 也没
448
464
  const weeklyUnlimited = weeklyTotal === 0 && (modelData.current_weekly_remaining_percent == null);
449
465
 
450
466
  return {
451
467
  name: modelData.model_name,
452
- used: usedCount,
468
+ // ⚠ 1.2.5 字段语义修正:`percentage` 现在是"剩余%"
469
+ used: usedCount, // 字段名保留(向后兼容),语义是"剩余次数"
453
470
  remaining: remainingCount,
454
471
  total: totalCount,
455
- percentage: usedPercentage,
472
+ percentage: percentage, // "剩余%"
456
473
  unlimited: weeklyUnlimited,
457
- weeklyPercentage,
474
+ weeklyPercentage, // "剩余%"
458
475
  weeklyTotal,
459
476
  weeklyRemainingCount,
460
477
  };
package/cli/index.js CHANGED
@@ -45,7 +45,6 @@ program
45
45
  let checks = {
46
46
  config: false,
47
47
  token: false,
48
- groupId: false,
49
48
  api: false,
50
49
  };
51
50
 
@@ -71,16 +70,10 @@ program
71
70
  console.log(chalk.red("✗ Token: ") + chalk.gray("未配置"));
72
71
  }
73
72
 
74
- // 检查GroupID
75
- if (api.groupId) {
76
- checks.groupId = true;
77
- console.log(chalk.green("✓ GroupID: ") + chalk.gray("已配置"));
78
- } else {
79
- console.log(chalk.red("✗ GroupID: ") + chalk.gray("未配置"));
80
- }
73
+ // ⚠ 不再检查 GroupID — 用量接口从 token JWT 自动解析 group_id,不需要手动配置
81
74
 
82
75
  // 测试API连接
83
- if (checks.token && checks.groupId) {
76
+ if (checks.token) {
84
77
  try {
85
78
  await api.getUsageStatus();
86
79
  checks.api = true;
package/cli/renderer.js CHANGED
@@ -101,20 +101,22 @@ class Renderer {
101
101
  }
102
102
 
103
103
  // 5h 限额 block — 总是显示(即使 total=0 也要显示百分比 + 5h 前缀)
104
- // ⚠ 不再用 usage.total > 0 过滤(5h 限额数据对 general 模型 total=0 也要显示)
104
+ // ⚠ 1.2.5 字段语义修正:`usage.percentage` 现在是"剩余%"(不是"已用%")
105
+ // 颜色按"剩余%"映射:剩 <30% 红 / 剩 <60% 橙 / 剩 ≥60% 绿
105
106
  if (usage && usage.percentage !== undefined && usage.percentage !== null) {
106
107
  let bg = '#065F46'; // safe (Emerald 800 - dark enough for white text)
107
- if (usagePercentage >= 95) bg = '#991B1B'; // danger (Red 800)
108
- else if (usagePercentage >= 75) bg = '#9A3412'; // warn (Orange 800)
108
+ if (usage.percentage < 30) bg = '#991B1B'; // danger (Red 800)
109
+ else if (usage.percentage < 60) bg = '#9A3412'; // warn (Orange 800)
109
110
 
110
111
  // total=0 时不显示 (X/Y) 段
111
112
  const usedTotalSuffix = usage.total > 0 ? ` (${usage.remaining}/${usage.total})` : '';
112
- let usageText = ` 5h ${usagePercentage}%${usedTotalSuffix} `;
113
+ let usageText = ` 5h ${usage.percentage}%${usedTotalSuffix} `;
113
114
 
114
115
  if (weekly) {
115
116
  if (weekly.unlimited) {
116
117
  usageText += `· W ∞ `;
117
118
  } else {
119
+ // 1.2.5:`weekly.percentage` 现在是"剩余%"
118
120
  usageText += `· W ${weekly.percentage}% `;
119
121
  }
120
122
  }
package/cli/status.js CHANGED
@@ -77,17 +77,18 @@ class StatusBar {
77
77
  return name.length > 15 ? name.substring(0, 12) + '...' : name;
78
78
  };
79
79
 
80
- // 获取状态颜色
80
+ // 获取状态颜色(按"剩余%"映射 — 1.2.5)
81
+ // 剩 <30% 红 / 剩 <60% 橙 / 剩 ≥60% 绿
81
82
  const getStatusColor = (percentage) => {
82
- if (percentage >= 85) return chalk.hex('#EF4444');
83
- if (percentage >= 60) return chalk.hex('#F59E0B');
83
+ if (percentage < 30) return chalk.hex('#EF4444');
84
+ if (percentage < 60) return chalk.hex('#F59E0B');
84
85
  return chalk.hex('#10B981');
85
86
  };
86
87
 
87
88
  // 显示状态
88
89
  const getStatusText = (percentage) => {
89
- if (percentage >= 85) return 'X';
90
- if (percentage >= 60) return '!';
90
+ if (percentage < 30) return 'X';
91
+ if (percentage < 60) return '!';
91
92
  return 'OK';
92
93
  };
93
94
 
@@ -97,7 +98,7 @@ class StatusBar {
97
98
  const color = getStatusColor(model.percentage);
98
99
  const status = getStatusText(model.percentage);
99
100
  const pct = `${model.percentage}%`;
100
- // total=0 时不显示 X/Y(避免 0/0 这种无数据展示)
101
+ // 1.2.5:标签"剩余/总额"(语义是"剩余次数/总额")
101
102
  const usedTotal = model.total > 0 ? `${model.used}/${model.total}` : '—';
102
103
 
103
104
  lines.push(` ${color(short.padEnd(15))} ${color(pct.padEnd(5))} ${color(usedTotal.padEnd(12))} ${color(status)}`);
@@ -129,11 +130,15 @@ class StatusBar {
129
130
  const { modelName, timeWindow, remaining, usage, weekly, expiry } = this.data;
130
131
 
131
132
  // Calculate progress bar width
133
+ // ⚠ 1.2.5 字段语义修正:`usage.percentage` 现在是"剩余%"。进度条按"剩余%"画:
134
+ // filled = (1 - 剩余/100) * width,即"已用%"对应填充。
132
135
  const width = 30;
133
- const filled = Math.floor((usage.percentage / 100) * width);
136
+ const usedPct = 100 - usage.percentage;
137
+ const filled = Math.floor((usedPct / 100) * width);
134
138
  const empty = width - filled;
135
139
 
136
- // Create progress bar with colors based on usage percentage
140
+ // Create progress bar with colors based on remaining percentage
141
+ // 剩 ≥60% 绿 / 剩 <60% 橙 / 剩 <30% 红
137
142
  const progressBar = this.createProgressBar(filled, empty, usage.percentage);
138
143
 
139
144
  // 构建内容行
@@ -149,8 +154,8 @@ class StatusBar {
149
154
 
150
155
  contentLines.push('');
151
156
 
152
- // 使用百分比与进度条
153
- contentLines.push(`${chalk.cyan('已用额度:')} ${progressBar} ${usage.percentage}%`);
157
+ // 5h 剩余百分比与进度条(按"剩余%"语义)
158
+ contentLines.push(`${chalk.cyan('5h 剩余:')} ${progressBar} ${usage.percentage}%`);
154
159
 
155
160
  // 剩余次数(total=0 时不显示)
156
161
  if (usage.total > 0) {
@@ -162,20 +167,24 @@ class StatusBar {
162
167
  contentLines.push('');
163
168
  if (weekly.unlimited) {
164
169
  // 不受限制
165
- contentLines.push(`${chalk.cyan('周限额:')} ${chalk.hex('#10B981')('不受限制')}`);
170
+ contentLines.push(`${chalk.cyan('周剩余:')} ${chalk.hex('#10B981')('不受限制')}`);
166
171
  } else {
167
172
  // 有限制,显示具体数据
168
- const weeklyPercent = weekly.percentage;
169
- const weeklyColor = weeklyPercent >= 85 ? chalk.hex('#EF4444') : weeklyPercent >= 60 ? chalk.hex('#F59E0B') : chalk.hex('#10B981');
173
+ // 1.2.5:`weekly.percentage` 现在是"剩余%",颜色按剩余%映射
174
+ const weeklyRemainingPct = weekly.percentage;
175
+ const weeklyColor = weeklyRemainingPct < 30 ? chalk.hex('#EF4444') : weeklyRemainingPct < 60 ? chalk.hex('#F59E0B') : chalk.hex('#10B981');
176
+ // 进度条按"已用%"画(剩得多→填得少)
177
+ const weeklyUsedPct = 100 - weeklyRemainingPct;
170
178
  const weeklyProgress = this.createProgressBar(
171
- Math.floor((weeklyPercent / 100) * 15),
172
- 15 - Math.floor((weeklyPercent / 100) * 15),
173
- weeklyPercent
179
+ Math.floor((weeklyUsedPct / 100) * 15),
180
+ 15 - Math.floor((weeklyUsedPct / 100) * 15),
181
+ weeklyRemainingPct
174
182
  );
175
- // total=0 时不显示 (X/Y)
183
+ // total=0 时不显示 (X/Y);重置时间作为副文本**同行**(跟 5h 风格一致)
176
184
  const weeklyUsedTotal = weekly.total > 0 ? ` (${weekly.used}/${weekly.total})` : '';
177
- contentLines.push(`${chalk.cyan('周限额:')} ${weeklyColor(weeklyProgress)} ${weeklyColor(weekly.percentage + '%')}${weeklyUsedTotal}`);
178
- contentLines.push(`${chalk.dim(' 重置:')} ${weekly.text}`);
185
+ // 副文本不染色(用默认前景色,跟进度条"未填充"色一致;主人反馈不要灰色)
186
+ const weeklyResetSuffix = ` · ${weekly.text}`;
187
+ contentLines.push(`${chalk.cyan('周剩余:')} ${weeklyColor(weeklyProgress)} ${weeklyColor(weekly.percentage + '%')}${weeklyUsedTotal}${weeklyResetSuffix}`);
179
188
  }
180
189
  }
181
190
 
@@ -218,10 +227,11 @@ class StatusBar {
218
227
  const remainingBar = '░'.repeat(empty);
219
228
  const bar = `${usedBar}${remainingBar}`;
220
229
 
221
- // 进度条颜色基于已使用百分比:使用越多越危险(红色)
222
- if (percentage >= 85) {
230
+ // ⚠ 1.2.5 字段语义修正:`percentage` 现在是"剩余%",颜色按"剩余%"映射
231
+ // <30% 红(即将用完警告)/ 剩 <60% 橙(注意使用)/ 剩 ≥60% 绿(正常使用)
232
+ if (percentage < 30) {
223
233
  return chalk.hex('#EF4444')(bar);
224
- } else if (percentage >= 60) {
234
+ } else if (percentage < 60) {
225
235
  return chalk.hex('#F59E0B')(bar);
226
236
  } else {
227
237
  return chalk.hex('#10B981')(bar);
@@ -247,10 +257,11 @@ class StatusBar {
247
257
  }
248
258
 
249
259
  getStatus(percentage) {
250
- // 基于已使用百分比(去 emoji 跟 vscode 1.0.7 风格一致)
251
- if (percentage >= 85) {
260
+ // 1.2.5 字段语义修正:`percentage` 现在是"剩余%",状态按"剩余%"判断
261
+ // <30% 即将用完 / 剩 <60% 注意使用 / 剩 ≥60% 正常使用
262
+ if (percentage < 30) {
252
263
  return '即将用完';
253
- } else if (percentage >= 60) {
264
+ } else if (percentage < 60) {
254
265
  return '注意使用';
255
266
  } else {
256
267
  return '正常使用';
@@ -261,11 +272,11 @@ class StatusBar {
261
272
  const { usage, remaining, modelName, expiry } = this.data;
262
273
  const status = this.getStatus(usage.percentage);
263
274
 
264
- // 颜色基于已使用百分比:使用越多越危险
275
+ // ⚠ 1.2.5:颜色按"剩余%"映射(剩 <30 红、剩 <60 橙、剩 ≥60 绿)
265
276
  let color;
266
- if (usage.percentage >= 85) {
277
+ if (usage.percentage < 30) {
267
278
  color = chalk.hex('#EF4444');
268
- } else if (usage.percentage >= 60) {
279
+ } else if (usage.percentage < 60) {
269
280
  color = chalk.hex('#F59E0B');
270
281
  } else {
271
282
  color = chalk.hex('#10B981');
package/cli/statusbar.js CHANGED
@@ -11,13 +11,14 @@ class StatusBar {
11
11
 
12
12
  render() {
13
13
  const { usage, remaining, weekly, expiry } = this.data;
14
+ // ⚠ 1.2.5 字段语义修正:`usage.percentage` 现在是"剩余%"(不是"已用%")
14
15
  const percentage = usage.percentage;
15
16
 
16
- // 基于已使用百分比:使用越多越危险
17
+ // 基于"剩余%"判断颜色:剩得多绿、剩得少红
17
18
  let color = chalk.green;
18
- if (percentage >= 85) {
19
+ if (percentage < 30) {
19
20
  color = chalk.red;
20
- } else if (percentage >= 60) {
21
+ } else if (percentage < 60) {
21
22
  color = chalk.yellow;
22
23
  }
23
24
 
@@ -33,7 +34,8 @@ class StatusBar {
33
34
  if (weekly.unlimited) {
34
35
  weeklyStr = ` ${chalk.blue('W')} ∞`;
35
36
  } else {
36
- const weeklyColor = weekly.percentage >= 85 ? chalk.red : weekly.percentage >= 60 ? chalk.yellow : chalk.green;
37
+ // 1.2.5:`weekly.percentage` 现在是"剩余%",颜色按剩余%映射
38
+ const weeklyColor = weekly.percentage < 30 ? chalk.red : weekly.percentage < 60 ? chalk.yellow : chalk.green;
37
39
  // total=0 时不显示 (X/Y)
38
40
  const weeklySuffix = weekly.total > 0 ? ` (${weekly.used}/${weekly.total})` : '';
39
41
  weeklyStr = ` ${chalk.blue('W')} ${weeklyColor(weekly.percentage + '%')}${weeklySuffix}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minimax-status",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "MiniMax Claude Code 使用状态监控工具",
5
5
  "bin": {
6
6
  "minimax-status": "cli/index.js",