ccusage 10.0.0 → 11.0.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 CHANGED
@@ -41,6 +41,7 @@ This tool helps you understand the value you're getting from your subscription b
41
41
  - 📊 **Daily Report**: View token usage and costs aggregated by date
42
42
  - 📅 **Monthly Report**: View token usage and costs aggregated by month
43
43
  - 💬 **Session Report**: View usage grouped by conversation sessions
44
+ - ⏰ **5-Hour Blocks Report**: Track usage within Claude's billing windows with active block monitoring
44
45
  - 🤖 **Model Tracking**: See which Claude models you're using (Opus, Sonnet, etc.)
45
46
  - 📊 **Model Breakdown**: View per-model cost breakdown with `--breakdown` flag
46
47
  - 📅 **Date Filtering**: Filter reports by date range using `--since` and `--until`
@@ -51,6 +52,7 @@ This tool helps you understand the value you're getting from your subscription b
51
52
  - 🔄 **Cache Token Support**: Tracks and displays cache creation and cache read tokens separately
52
53
  - 🌐 **Offline Mode**: Use pre-cached pricing data without network connectivity with `--offline` (Claude models only)
53
54
  - 📏 **Responsive Tables**: Automatic table width adjustment for narrow terminals with intelligent word wrapping
55
+ - 🔌 **MCP Integration**: Built-in Model Context Protocol server for integration with other tools
54
56
 
55
57
  ## Important Disclaimer
56
58
 
@@ -340,6 +342,8 @@ Available MCP tools:
340
342
 
341
343
  - `daily`: Returns daily usage reports (accepts `since`, `until`, `mode` parameters)
342
344
  - `session`: Returns session usage reports (accepts `since`, `until`, `mode` parameters)
345
+ - `monthly`: Returns monthly usage reports (accepts `since`, `until`, `mode` parameters)
346
+ - `blocks`: Returns 5-hour billing blocks usage reports (accepts `since`, `until`, `mode` parameters)
343
347
 
344
348
  #### Claude Desktop Configuration Example
345
349
 
@@ -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-C2GZVy1v.js";
4
- import { PricingFetcher } from "./pricing-fetcher-BxlbW4km.js";
3
+ import { logger } from "./logger-D3WD64Tx.js";
4
+ import { PricingFetcher } from "./pricing-fetcher-D-eJQBEJ.js";
5
5
  import fsPromises, { readFile } from "node:fs/promises";
6
6
  import { homedir } from "node:os";
7
7
  import path from "node:path";
@@ -1,6 +1,6 @@
1
- import { DailyUsageSchema, ModelBreakdownSchema, MonthlyUsageSchema, SessionUsageSchema, UsageDataSchema, calculateCostForEntry, createUniqueHash, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadFiveHourBlockData, loadMonthlyUsageData, loadSessionData, sortFilesByTimestamp } from "./data-loader-Bp9KV0_a.js";
1
+ import { DailyUsageSchema, ModelBreakdownSchema, MonthlyUsageSchema, SessionUsageSchema, UsageDataSchema, calculateCostForEntry, createUniqueHash, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadFiveHourBlockData, loadMonthlyUsageData, loadSessionData, sortFilesByTimestamp } from "./data-loader-BAoqS297.js";
2
2
  import "./dist-DCvt9hEv.js";
3
- import "./logger-C2GZVy1v.js";
4
- import "./pricing-fetcher-BxlbW4km.js";
3
+ import "./logger-D3WD64Tx.js";
4
+ import "./pricing-fetcher-D-eJQBEJ.js";
5
5
 
6
6
  export { DailyUsageSchema, ModelBreakdownSchema, MonthlyUsageSchema, SessionUsageSchema, UsageDataSchema, calculateCostForEntry, createUniqueHash, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadFiveHourBlockData, loadMonthlyUsageData, loadSessionData, sortFilesByTimestamp };
@@ -1,8 +1,8 @@
1
1
  import { __toESM } from "./chunk-BLXvPPr8.js";
2
- import { UsageDataSchema, glob, require_usingCtx } from "./data-loader-Bp9KV0_a.js";
2
+ import { UsageDataSchema, glob, require_usingCtx } from "./data-loader-BAoqS297.js";
3
3
  import { safeParse } from "./dist-DCvt9hEv.js";
4
- import { logger } from "./logger-C2GZVy1v.js";
5
- import { PricingFetcher } from "./pricing-fetcher-BxlbW4km.js";
4
+ import { logger } from "./logger-D3WD64Tx.js";
5
+ import { PricingFetcher } from "./pricing-fetcher-D-eJQBEJ.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-Bp9KV0_a.js";
1
+ import "./data-loader-BAoqS297.js";
2
2
  import "./dist-DCvt9hEv.js";
3
- import "./logger-C2GZVy1v.js";
4
- import "./pricing-fetcher-BxlbW4km.js";
5
- import { detectMismatches, printMismatchReport } from "./debug-bjc38_Gx.js";
3
+ import "./logger-D3WD64Tx.js";
4
+ import "./pricing-fetcher-D-eJQBEJ.js";
5
+ import { detectMismatches, printMismatchReport } from "./debug-DzFJHzM5.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 { calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadFiveHourBlockData, loadMonthlyUsageData, loadSessionData, projectBlockUsage } from "./data-loader-Bp9KV0_a.js";
4
+ import { calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadFiveHourBlockData, loadMonthlyUsageData, loadSessionData, projectBlockUsage } from "./data-loader-BAoqS297.js";
5
5
  import { safeParse } from "./dist-DCvt9hEv.js";
6
- import { description, log, logger, name, version } from "./logger-C2GZVy1v.js";
7
- import { CostModes, SortOrders, dateSchema } from "./pricing-fetcher-BxlbW4km.js";
8
- import { detectMismatches, printMismatchReport } from "./debug-bjc38_Gx.js";
6
+ import { description, log, logger, name, version } from "./logger-D3WD64Tx.js";
7
+ import { CostModes, SortOrders, dateSchema } from "./pricing-fetcher-D-eJQBEJ.js";
8
+ import { detectMismatches, printMismatchReport } from "./debug-DzFJHzM5.js";
9
9
  import { ResponsiveTable } from "./utils.table-USks3NGv.js";
10
10
  import "./types-BlyCnKwN.js";
11
- import { createMcpServer } from "./mcp-DVjQeqCy.js";
11
+ import { createMcpServer } from "./mcp-1J7r1g6-.js";
12
12
  import "./index-CISmcbXk-CW1Gj6Ab.js";
13
13
  import process$1 from "node:process";
14
14
 
@@ -965,7 +965,7 @@ const consola = createConsola$1();
965
965
  //#endregion
966
966
  //#region package.json
967
967
  var name = "ccusage";
968
- var version = "10.0.0";
968
+ var version = "11.0.0";
969
969
  var description = "Usage analysis tool for Claude Code";
970
970
 
971
971
  //#endregion
package/dist/logger.js CHANGED
@@ -1,3 +1,3 @@
1
- import { log, logger } from "./logger-C2GZVy1v.js";
1
+ import { log, logger } from "./logger-D3WD64Tx.js";
2
2
 
3
3
  export { log, logger };
@@ -1,8 +1,8 @@
1
1
  import { __commonJS, __require, __toESM } from "./chunk-BLXvPPr8.js";
2
- import { getDefaultClaudePath, loadDailyUsageData, loadSessionData } from "./data-loader-Bp9KV0_a.js";
2
+ import { getDefaultClaudePath, loadDailyUsageData, loadFiveHourBlockData, loadMonthlyUsageData, loadSessionData } from "./data-loader-BAoqS297.js";
3
3
  import { description, literal, object, optional, pipe, union } from "./dist-DCvt9hEv.js";
4
- import { name, version } from "./logger-C2GZVy1v.js";
5
- import { CostModes, dateSchema } from "./pricing-fetcher-BxlbW4km.js";
4
+ import { name, version } from "./logger-D3WD64Tx.js";
5
+ import { CostModes, dateSchema } from "./pricing-fetcher-D-eJQBEJ.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";
@@ -37580,6 +37580,30 @@ function createMcpServer({ claudePath } = defaultOptions) {
37580
37580
  return JSON.stringify(sessionData);
37581
37581
  }
37582
37582
  });
37583
+ server.addTool({
37584
+ name: "monthly",
37585
+ description: "Show usage report grouped by month",
37586
+ parameters: parametersSchema,
37587
+ execute: async (args) => {
37588
+ const monthlyData = await loadMonthlyUsageData({
37589
+ ...args,
37590
+ claudePath
37591
+ });
37592
+ return JSON.stringify(monthlyData);
37593
+ }
37594
+ });
37595
+ server.addTool({
37596
+ name: "blocks",
37597
+ description: "Show usage report grouped by 5-hour billing blocks",
37598
+ parameters: parametersSchema,
37599
+ execute: async (args) => {
37600
+ const blocksData = await loadFiveHourBlockData({
37601
+ ...args,
37602
+ claudePath
37603
+ });
37604
+ return JSON.stringify(blocksData);
37605
+ }
37606
+ });
37583
37607
  return server;
37584
37608
  }
37585
37609
 
package/dist/mcp.js CHANGED
@@ -1,9 +1,9 @@
1
- import "./data-loader-Bp9KV0_a.js";
1
+ import "./data-loader-BAoqS297.js";
2
2
  import "./dist-DCvt9hEv.js";
3
- import "./logger-C2GZVy1v.js";
4
- import "./pricing-fetcher-BxlbW4km.js";
3
+ import "./logger-D3WD64Tx.js";
4
+ import "./pricing-fetcher-D-eJQBEJ.js";
5
5
  import "./types-BlyCnKwN.js";
6
- import { createMcpServer } from "./mcp-DVjQeqCy.js";
6
+ import { createMcpServer } from "./mcp-1J7r1g6-.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-C2GZVy1v.js";
2
+ import { logger } from "./logger-D3WD64Tx.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";
@@ -1,5 +1,5 @@
1
1
  import "./dist-DCvt9hEv.js";
2
- import "./logger-C2GZVy1v.js";
3
- import { PricingFetcher } from "./pricing-fetcher-BxlbW4km.js";
2
+ import "./logger-D3WD64Tx.js";
3
+ import { PricingFetcher } from "./pricing-fetcher-D-eJQBEJ.js";
4
4
 
5
5
  export { PricingFetcher };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccusage",
3
3
  "type": "module",
4
- "version": "10.0.0",
4
+ "version": "11.0.0",
5
5
  "description": "Usage analysis tool for Claude Code",
6
6
  "author": "ryoppippi",
7
7
  "license": "MIT",