ccusage 9.0.0 → 9.0.1
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 +16 -1
- package/dist/{data-loader-Ca8k_uX0.js → data-loader-CotJGlGF.js} +2 -2
- package/dist/data-loader.js +3 -3
- package/dist/{debug-zCcXwR8p.js → debug-DH_5GWYh.js} +3 -3
- package/dist/debug.js +4 -4
- package/dist/index.js +6 -6
- package/dist/{logger-DKw-DPXD.js → logger-BgKOQAEs.js} +1 -1
- package/dist/logger.js +1 -1
- package/dist/{mcp-BRFYI5rd.js → mcp-BUmEAQZm.js} +3 -3
- package/dist/mcp.js +4 -4
- package/dist/{pricing-fetcher-BlxDpqFj.js → pricing-fetcher-1KHPTXC3.js} +1 -1
- package/dist/pricing-fetcher.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,10 +45,12 @@ This tool helps you understand the value you're getting from your subscription b
|
|
|
45
45
|
- 📊 **Model Breakdown**: View per-model cost breakdown with `--breakdown` flag
|
|
46
46
|
- 📅 **Date Filtering**: Filter reports by date range using `--since` and `--until`
|
|
47
47
|
- 📁 **Custom Path**: Support for custom Claude data directory locations
|
|
48
|
-
- 🎨 **Beautiful Output**: Colorful table-formatted display
|
|
48
|
+
- 🎨 **Beautiful Output**: Colorful table-formatted display with responsive width adjustment
|
|
49
49
|
- 📄 **JSON Output**: Export data in structured JSON format with `--json`
|
|
50
50
|
- 💰 **Cost Tracking**: Shows costs in USD for each day/month/session
|
|
51
51
|
- 🔄 **Cache Token Support**: Tracks and displays cache creation and cache read tokens separately
|
|
52
|
+
- 🌐 **Offline Mode**: Use pre-cached pricing data without network connectivity with `--offline` (Claude models only)
|
|
53
|
+
- 📏 **Responsive Tables**: Automatic table width adjustment for narrow terminals with intelligent word wrapping
|
|
52
54
|
|
|
53
55
|
## Important Disclaimer
|
|
54
56
|
|
|
@@ -147,6 +149,10 @@ ccusage daily --order desc # Show newest dates first (default)
|
|
|
147
149
|
|
|
148
150
|
# Show per-model cost breakdown
|
|
149
151
|
ccusage daily --breakdown # Show cost breakdown by model (opus-4, sonnet-4, etc.)
|
|
152
|
+
|
|
153
|
+
# Use offline mode (no network required)
|
|
154
|
+
ccusage daily --offline # Use pre-cached pricing data
|
|
155
|
+
ccusage daily -O # Short alias for --offline
|
|
150
156
|
```
|
|
151
157
|
|
|
152
158
|
`ccusage` is an alias for `ccusage daily`, so you can run it without specifying the subcommand.
|
|
@@ -183,6 +189,10 @@ ccusage monthly --order desc # Show newest months first (default)
|
|
|
183
189
|
|
|
184
190
|
# Show per-model cost breakdown
|
|
185
191
|
ccusage monthly --breakdown # Show cost breakdown by model
|
|
192
|
+
|
|
193
|
+
# Use offline mode (no network required)
|
|
194
|
+
ccusage monthly --offline # Use pre-cached pricing data
|
|
195
|
+
ccusage monthly -O # Short alias for --offline
|
|
186
196
|
```
|
|
187
197
|
|
|
188
198
|
### Session Report
|
|
@@ -214,6 +224,10 @@ ccusage session --order desc # Show newest sessions first (default)
|
|
|
214
224
|
|
|
215
225
|
# Show per-model cost breakdown
|
|
216
226
|
ccusage session --breakdown # Show cost breakdown by model
|
|
227
|
+
|
|
228
|
+
# Use offline mode (no network required)
|
|
229
|
+
ccusage session --offline # Use pre-cached pricing data
|
|
230
|
+
ccusage session -O # Short alias for --offline
|
|
217
231
|
```
|
|
218
232
|
|
|
219
233
|
### Options
|
|
@@ -226,6 +240,7 @@ All commands support the following options:
|
|
|
226
240
|
- `-m, --mode <mode>`: Cost calculation mode: `auto` (default), `calculate`, or `display`
|
|
227
241
|
- `-o, --order <order>`: Sort order: `desc` (newest first, default) or `asc` (oldest first).
|
|
228
242
|
- `-b, --breakdown`: Show per-model cost breakdown (splits usage by Opus, Sonnet, etc.)
|
|
243
|
+
- `-O, --offline`: Use pre-cached pricing data for Claude models (no network connection required)
|
|
229
244
|
- `-d, --debug`: Show pricing mismatch information for debugging
|
|
230
245
|
- `--debug-samples <number>`: Number of sample discrepancies to show in debug output (default: 5)
|
|
231
246
|
- `-h, --help`: Display help message
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __commonJS, __require, __toESM } from "./chunk-BLXvPPr8.js";
|
|
2
2
|
import { array, number, object, optional, pipe, regex, safeParse, string } from "./dist-DCvt9hEv.js";
|
|
3
|
-
import { logger } from "./logger-
|
|
4
|
-
import { PricingFetcher } from "./pricing-fetcher-
|
|
3
|
+
import { logger } from "./logger-BgKOQAEs.js";
|
|
4
|
+
import { PricingFetcher } from "./pricing-fetcher-1KHPTXC3.js";
|
|
5
5
|
import fsPromises, { readFile } from "node:fs/promises";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import path from "node:path";
|
package/dist/data-loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DailyUsageSchema, ModelBreakdownSchema, MonthlyUsageSchema, SessionUsageSchema, UsageDataSchema, calculateCostForEntry, createUniqueHash, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionData, sortFilesByTimestamp } from "./data-loader-
|
|
1
|
+
import { DailyUsageSchema, ModelBreakdownSchema, MonthlyUsageSchema, SessionUsageSchema, UsageDataSchema, calculateCostForEntry, createUniqueHash, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionData, sortFilesByTimestamp } from "./data-loader-CotJGlGF.js";
|
|
2
2
|
import "./dist-DCvt9hEv.js";
|
|
3
|
-
import "./logger-
|
|
4
|
-
import "./pricing-fetcher-
|
|
3
|
+
import "./logger-BgKOQAEs.js";
|
|
4
|
+
import "./pricing-fetcher-1KHPTXC3.js";
|
|
5
5
|
|
|
6
6
|
export { DailyUsageSchema, ModelBreakdownSchema, MonthlyUsageSchema, SessionUsageSchema, UsageDataSchema, calculateCostForEntry, createUniqueHash, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionData, sortFilesByTimestamp };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __toESM } from "./chunk-BLXvPPr8.js";
|
|
2
|
-
import { UsageDataSchema, glob, require_usingCtx } from "./data-loader-
|
|
2
|
+
import { UsageDataSchema, glob, require_usingCtx } from "./data-loader-CotJGlGF.js";
|
|
3
3
|
import { safeParse } from "./dist-DCvt9hEv.js";
|
|
4
|
-
import { logger } from "./logger-
|
|
5
|
-
import { PricingFetcher } from "./pricing-fetcher-
|
|
4
|
+
import { logger } from "./logger-BgKOQAEs.js";
|
|
5
|
+
import { PricingFetcher } from "./pricing-fetcher-1KHPTXC3.js";
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import path from "node:path";
|
package/dist/debug.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./data-loader-
|
|
1
|
+
import "./data-loader-CotJGlGF.js";
|
|
2
2
|
import "./dist-DCvt9hEv.js";
|
|
3
|
-
import "./logger-
|
|
4
|
-
import "./pricing-fetcher-
|
|
5
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
3
|
+
import "./logger-BgKOQAEs.js";
|
|
4
|
+
import "./pricing-fetcher-1KHPTXC3.js";
|
|
5
|
+
import { detectMismatches, printMismatchReport } from "./debug-DH_5GWYh.js";
|
|
6
6
|
|
|
7
7
|
export { detectMismatches, printMismatchReport };
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { __commonJS, __toESM } from "./chunk-BLXvPPr8.js";
|
|
3
3
|
import { calculateTotals, createTotalsObject, getTotalTokens } from "./calculate-cost-2IwHSzmi.js";
|
|
4
|
-
import { formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionData } from "./data-loader-
|
|
4
|
+
import { formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionData } from "./data-loader-CotJGlGF.js";
|
|
5
5
|
import { safeParse } from "./dist-DCvt9hEv.js";
|
|
6
|
-
import { description, log, logger, name, version } from "./logger-
|
|
7
|
-
import { CostModes, SortOrders, dateSchema } from "./pricing-fetcher-
|
|
8
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
6
|
+
import { description, log, logger, name, version } from "./logger-BgKOQAEs.js";
|
|
7
|
+
import { CostModes, SortOrders, dateSchema } from "./pricing-fetcher-1KHPTXC3.js";
|
|
8
|
+
import { detectMismatches, printMismatchReport } from "./debug-DH_5GWYh.js";
|
|
9
9
|
import { ResponsiveTable } from "./utils.table-DRzF8vZJ.js";
|
|
10
10
|
import "./types-BlyCnKwN.js";
|
|
11
|
-
import { createMcpServer } from "./mcp-
|
|
11
|
+
import { createMcpServer } from "./mcp-BUmEAQZm.js";
|
|
12
12
|
import "./index-CISmcbXk-CW1Gj6Ab.js";
|
|
13
13
|
import process$1 from "node:process";
|
|
14
14
|
|
|
@@ -1273,7 +1273,7 @@ const sharedArgs = {
|
|
|
1273
1273
|
type: "boolean",
|
|
1274
1274
|
negatable: true,
|
|
1275
1275
|
short: "O",
|
|
1276
|
-
description: "Use cached data instead of fetching from API",
|
|
1276
|
+
description: "Use cached pricing data for Claude models instead of fetching from API",
|
|
1277
1277
|
default: false
|
|
1278
1278
|
}
|
|
1279
1279
|
};
|
package/dist/logger.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __commonJS, __require, __toESM } from "./chunk-BLXvPPr8.js";
|
|
2
|
-
import { getDefaultClaudePath, loadDailyUsageData, loadSessionData } from "./data-loader-
|
|
2
|
+
import { getDefaultClaudePath, loadDailyUsageData, loadSessionData } from "./data-loader-CotJGlGF.js";
|
|
3
3
|
import { description, literal, object, optional, pipe, union } from "./dist-DCvt9hEv.js";
|
|
4
|
-
import { name, version } from "./logger-
|
|
5
|
-
import { CostModes, dateSchema } from "./pricing-fetcher-
|
|
4
|
+
import { name, version } from "./logger-BgKOQAEs.js";
|
|
5
|
+
import { CostModes, dateSchema } from "./pricing-fetcher-1KHPTXC3.js";
|
|
6
6
|
import { anyType, arrayType, booleanType, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, stringType, unionType, unknownType } from "./types-BlyCnKwN.js";
|
|
7
7
|
import { toJsonSchema } from "./index-CISmcbXk-CW1Gj6Ab.js";
|
|
8
8
|
import process$1 from "node:process";
|
package/dist/mcp.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./data-loader-
|
|
1
|
+
import "./data-loader-CotJGlGF.js";
|
|
2
2
|
import "./dist-DCvt9hEv.js";
|
|
3
|
-
import "./logger-
|
|
4
|
-
import "./pricing-fetcher-
|
|
3
|
+
import "./logger-BgKOQAEs.js";
|
|
4
|
+
import "./pricing-fetcher-1KHPTXC3.js";
|
|
5
5
|
import "./types-BlyCnKwN.js";
|
|
6
|
-
import { createMcpServer } from "./mcp-
|
|
6
|
+
import { createMcpServer } from "./mcp-BUmEAQZm.js";
|
|
7
7
|
import "./index-CISmcbXk-CW1Gj6Ab.js";
|
|
8
8
|
|
|
9
9
|
export { createMcpServer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { number, object, optional, pipe, regex, safeParse, string } from "./dist-DCvt9hEv.js";
|
|
2
|
-
import { logger } from "./logger-
|
|
2
|
+
import { logger } from "./logger-BgKOQAEs.js";
|
|
3
3
|
|
|
4
4
|
//#region src/consts.internal.ts
|
|
5
5
|
const LITELLM_PRICING_URL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
|
package/dist/pricing-fetcher.js
CHANGED