minimax-status 1.0.1 → 1.0.3
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/LICENSE +21 -0
- package/README.md +14 -14
- package/cli/index.js +15 -12
- package/cli/statusbar.js +2 -2
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jochen Yang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/minimax-status)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
|
|
7
|
-
MiniMax
|
|
7
|
+
MiniMax coding-plan 使用状态监控工具,支持 CLI 命令和 Claude Code 状态栏集成。
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
11
|
## 特性
|
|
12
12
|
|
|
13
|
-
- ✅ **实时状态监控**: 显示 MiniMax
|
|
13
|
+
- ✅ **实时状态监控**: 显示 MiniMax coding-plan 使用额度、剩余次数、重置时间
|
|
14
14
|
- ✅ **多种显示模式**: 详细模式、紧凑模式、持续状态栏
|
|
15
15
|
- ✅ **Claude Code 集成**: 可在 Claude Code 底部状态栏显示
|
|
16
16
|
- ✅ **智能颜色编码**: 根据使用率自动切换颜色和图标
|
|
@@ -126,22 +126,22 @@ minimax status --watch
|
|
|
126
126
|
|
|
127
127
|
## 命令说明
|
|
128
128
|
|
|
129
|
-
| 命令
|
|
130
|
-
|
|
|
131
|
-
| `minimax auth`
|
|
132
|
-
| `minimax status`
|
|
133
|
-
| `minimax bar`
|
|
134
|
-
| `minimax statusline` | Claude Code 状态栏集成
|
|
129
|
+
| 命令 | 描述 | 示例 |
|
|
130
|
+
| -------------------- | ------------------------------------------- | -------------------------------- |
|
|
131
|
+
| `minimax auth` | 设置认证凭据 | `minimax auth <token> <groupId>` |
|
|
132
|
+
| `minimax status` | 显示当前使用状态(支持 --compact、--watch) | `minimax status` |
|
|
133
|
+
| `minimax bar` | 终端底部持续状态栏 | `minimax bar` |
|
|
134
|
+
| `minimax statusline` | Claude Code 状态栏集成 | 用于 Claude Code 配置 |
|
|
135
135
|
|
|
136
136
|
## 状态说明
|
|
137
137
|
|
|
138
138
|
### 状态图标
|
|
139
139
|
|
|
140
|
-
| 使用率 | 图标 | 含义
|
|
141
|
-
| ------ | ---- |
|
|
142
|
-
| < 60% | ✓ | 正常使用
|
|
143
|
-
| 60-85% | ⚡ | 注意使用
|
|
144
|
-
| ≥ 85% | ⚠ | 危险状态
|
|
140
|
+
| 使用率 | 图标 | 含义 |
|
|
141
|
+
| ------ | ---- | -------- |
|
|
142
|
+
| < 60% | ✓ | 正常使用 |
|
|
143
|
+
| 60-85% | ⚡ | 注意使用 |
|
|
144
|
+
| ≥ 85% | ⚠ | 危险状态 |
|
|
145
145
|
|
|
146
146
|
## 配置文件
|
|
147
147
|
|
|
@@ -236,4 +236,4 @@ MIT License - 详见 [LICENSE](LICENSE) 文件
|
|
|
236
236
|
|
|
237
237
|
---
|
|
238
238
|
|
|
239
|
-
**注意**: 本工具仅用于监控 MiniMax
|
|
239
|
+
**注意**: 本工具仅用于监控 MiniMax coding-plan 用量使用状态,不存储或传输任何用户数据。
|
package/cli/index.js
CHANGED
|
@@ -278,30 +278,33 @@ program
|
|
|
278
278
|
// 显示目录(优先使用Claude Code的目录,否则显示CLI当前目录)
|
|
279
279
|
const displayDir = currentDir || cliCurrentDir || '';
|
|
280
280
|
if (displayDir) {
|
|
281
|
-
statusLine +=
|
|
281
|
+
statusLine += `${chalk.blue('📁')} ${chalk.cyan(displayDir)} | `;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
// 模型信息
|
|
285
|
-
statusLine +=
|
|
285
|
+
statusLine += `${chalk.magenta('🤖')} ${chalk.magenta(displayModel)} | `;
|
|
286
286
|
|
|
287
|
-
//
|
|
288
|
-
|
|
287
|
+
// 账户使用额度百分比(根据使用率变色)
|
|
288
|
+
const usageColor = percentage >= 85 ? chalk.red : percentage >= 60 ? chalk.yellow : chalk.green;
|
|
289
|
+
statusLine += `${usageColor(percentage + '%')} | `;
|
|
289
290
|
|
|
290
|
-
// 剩余次数
|
|
291
|
-
statusLine +=
|
|
291
|
+
// 剩余次数
|
|
292
|
+
statusLine += `${chalk.yellow('↻')} ${chalk.white(usage.used + '/' + usage.total)} | `;
|
|
292
293
|
|
|
293
294
|
// 上下文使用情况(参考ccline:⚡ 百分比 · token数/总大小)
|
|
294
295
|
if (contextUsageTokens) {
|
|
295
|
-
|
|
296
|
+
const contextColor = displayPercentage >= 85 ? chalk.red : displayPercentage >= 60 ? chalk.yellow : chalk.green;
|
|
297
|
+
statusLine += `${contextColor('⚡')} ${contextColor(displayPercentage + '%')} ${chalk.gray('·')} ${chalk.white(formatTokens(contextUsageTokens) + '/' + contextSizeText)} | `;
|
|
296
298
|
} else {
|
|
297
299
|
// 没有转录数据时,显示上下文窗口大小
|
|
298
|
-
statusLine += `${contextSizeText} | `;
|
|
300
|
+
statusLine += `${chalk.gray(contextSizeText)} | `;
|
|
299
301
|
}
|
|
300
302
|
|
|
301
303
|
// 剩余时间和状态图标
|
|
302
|
-
|
|
304
|
+
const statusColor = displayPercentage >= 85 ? chalk.red : displayPercentage >= 60 ? chalk.yellow : chalk.green;
|
|
305
|
+
statusLine += `${chalk.gray('⏱')} ${chalk.white(remainingText)} ${statusColor(statusIcon)}`;
|
|
303
306
|
|
|
304
|
-
//
|
|
307
|
+
// 输出单行状态(带颜色)
|
|
305
308
|
console.log(statusLine);
|
|
306
309
|
} catch (error) {
|
|
307
310
|
// 输出错误状态(纯文本)
|
|
@@ -332,8 +335,8 @@ function startWatching(api, statusBar) {
|
|
|
332
335
|
// Initial update
|
|
333
336
|
update();
|
|
334
337
|
|
|
335
|
-
// Update every
|
|
336
|
-
intervalId = setInterval(update,
|
|
338
|
+
// Update every 10 seconds for near real-time updates
|
|
339
|
+
intervalId = setInterval(update, 10000);
|
|
337
340
|
|
|
338
341
|
// Handle Ctrl+C
|
|
339
342
|
process.on("SIGINT", () => {
|
package/cli/statusbar.js
CHANGED