From b44533c8a683158f55bfe5e2ad1ddbf41de874a3 Mon Sep 17 00:00:00 2001 From: mmx-cli contributor Date: Sun, 12 Apr 2026 18:44:42 +0400 Subject: [PATCH] fix(quota): correct column order in --quiet output The API field 'current_interval_usage_count' actually contains the remaining quota (not usage). The --quiet output was displaying the columns in misleading order: name | remaining | total | used This fix renames the variable for clarity and reorders the output: name | used | total | remaining Fixes: MiniMax-AI/cli#91 --- src/commands/quota/show.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/quota/show.ts b/src/commands/quota/show.ts index 958ee71..8c2ec87 100644 --- a/src/commands/quota/show.ts +++ b/src/commands/quota/show.ts @@ -37,8 +37,12 @@ export default defineCommand({ if (config.quiet) { for (const m of models) { - const remaining = m.current_interval_total_count - m.current_interval_usage_count; - console.log(`${m.model_name}\t${m.current_interval_usage_count}\t${m.current_interval_total_count}\t${remaining}`); + // NOTE: current_interval_usage_count from the API actually contains the REMAINING value, not usage. + // We rename it here for clarity and compute the actual used amount. + const remaining = m.current_interval_usage_count; + const total = m.current_interval_total_count; + const used = Math.max(0, total - remaining); + console.log(`${m.model_name}\t${used}\t${total}\t${remaining}`); } return; }