ccusage 12.4.0 → 13.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/LICENSE +2 -0
- package/README.md +11 -2
- package/dist/{data-loader-BL0D1ClF.js → data-loader-B8gFJPfi.js} +2 -2
- package/dist/data-loader.js +3 -3
- package/dist/{debug-DzMUvq_R.js → debug-CL2Shx1n.js} +3 -3
- package/dist/debug.js +4 -4
- package/dist/index.js +5 -5
- package/dist/{logger-Cyt2-axs.js → logger-B4PJ298G.js} +1 -1
- package/dist/logger.js +1 -1
- package/dist/{mcp-Cx7Vxuva.js → mcp-Bw62xMEM.js} +3 -3
- package/dist/mcp.js +4 -4
- package/dist/{pricing-fetcher-5y05qfeL.js → pricing-fetcher-Cx71zrV9.js} +1 -1
- package/dist/pricing-fetcher.js +2 -2
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -2,6 +2,8 @@ MIT License
|
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2025 ryoppippi
|
|
4
4
|
|
|
5
|
+
Logo and brand assets created by nyatinte are also licensed under MIT License.
|
|
6
|
+
|
|
5
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
8
|
of this software and associated documentation files (the "Software"), to deal
|
|
7
9
|
in the Software without restriction, including without limitation the rights
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# ccusage
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="docs/logo.png" alt="ccusage logo" width="256" height="256">
|
|
5
|
+
</div>
|
|
4
6
|
|
|
5
7
|
[](https://npmjs.com/package/ccusage)
|
|
6
8
|
[](https://tanstack.com/stats/npm?packageGroups=%5B%7B%22packages%22:%5B%7B%22name%22:%22ccusage%22%7D%5D%7D%5D&range=30-days&transform=none&binType=daily&showDataMode=all&height=400)
|
|
@@ -12,6 +14,8 @@
|
|
|
12
14
|
<img src="https://github.com/ryoppippi/ccusage/blob/main/docs/screenshot.png?raw=true">
|
|
13
15
|
</div>
|
|
14
16
|
|
|
17
|
+
> **ccusage(claude-code-usage)**
|
|
18
|
+
|
|
15
19
|
A CLI tool for analyzing Claude Code usage from local JSONL files.
|
|
16
20
|
|
|
17
21
|
Inspired by [this article](https://note.com/milliondev/n/n1d018da2d769) about tracking Claude Code usage costs.
|
|
@@ -19,7 +23,7 @@ Inspired by [this article](https://note.com/milliondev/n/n1d018da2d769) about tr
|
|
|
19
23
|
## What is `ccusage` (by NotebookLM)
|
|
20
24
|
|
|
21
25
|
<details>
|
|
22
|
-
<summary>
|
|
26
|
+
<summary>Podcast</summary>
|
|
23
27
|
|
|
24
28
|
# English
|
|
25
29
|
|
|
@@ -477,6 +481,10 @@ With `--breakdown` flag:
|
|
|
477
481
|
|
|
478
482
|
MIT
|
|
479
483
|
|
|
484
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
485
|
+
|
|
486
|
+
The logo and brand assets are also licensed under the MIT License. Created by [@nyatinte](https://github.com/nyatinte).
|
|
487
|
+
|
|
480
488
|
## Author
|
|
481
489
|
|
|
482
490
|
[@ryoppippi](https://github.com/ryoppippi)
|
|
@@ -492,6 +500,7 @@ While the original approach uses DuckDB for analysis, this tool provides a more
|
|
|
492
500
|
some projects use `ccusage` internally and provide additional features:
|
|
493
501
|
|
|
494
502
|
- [claude-usage-tracker-for-mac](https://github.com/penicillin0/claude-usage-tracker-for-mac) – macOS menu bar app to visualize Claude Code usage costs by [@penicillin0](https://github.com/penicillin0).
|
|
503
|
+
- [ccusage Raycast Extension](https://www.raycast.com/nyatinte/ccusage) – Raycast extension to view Claude Code usage reports in Raycast by [@nyatinte](https://github.com/nyatinte).
|
|
495
504
|
|
|
496
505
|
## Acknowledgments
|
|
497
506
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CLAUDE_PROJECTS_DIR_NAME, DEFAULT_CLAUDE_CODE_PATH, DEFAULT_RECENT_DAYS, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __commonJSMin, __require, __toESM, require_usingCtx } from "./pricing-fetcher-
|
|
1
|
+
import { CLAUDE_PROJECTS_DIR_NAME, DEFAULT_CLAUDE_CODE_PATH, DEFAULT_RECENT_DAYS, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __commonJSMin, __require, __toESM, require_usingCtx } from "./pricing-fetcher-Cx71zrV9.js";
|
|
2
2
|
import { activityDateSchema, arrayType, createDailyDate, createMonthlyDate, createProjectPath, createSessionId, dailyDateSchema, isoTimestampSchema, messageIdSchema, modelNameSchema, monthlyDateSchema, numberType, objectType, projectPathSchema, requestIdSchema, sessionIdSchema, versionSchema } from "./types.internal-CX7kpidj.js";
|
|
3
|
-
import { logger } from "./logger-
|
|
3
|
+
import { logger } from "./logger-B4PJ298G.js";
|
|
4
4
|
import a, { readFile } from "node:fs/promises";
|
|
5
5
|
import F, { homedir } from "node:os";
|
|
6
6
|
import path, { posix } from "node:path";
|
package/dist/data-loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-Cx71zrV9.js";
|
|
2
2
|
import "./types.internal-CX7kpidj.js";
|
|
3
|
-
import { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema } from "./data-loader-
|
|
4
|
-
import "./logger-
|
|
3
|
+
import { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema } from "./data-loader-B8gFJPfi.js";
|
|
4
|
+
import "./logger-B4PJ298G.js";
|
|
5
5
|
export { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CLAUDE_PROJECTS_DIR_NAME, DEBUG_MATCH_THRESHOLD_PERCENT, DEFAULT_CLAUDE_CODE_PATH, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __toESM, require_usingCtx } from "./pricing-fetcher-
|
|
2
|
-
import { glob, usageDataSchema } from "./data-loader-
|
|
3
|
-
import { logger } from "./logger-
|
|
1
|
+
import { CLAUDE_PROJECTS_DIR_NAME, DEBUG_MATCH_THRESHOLD_PERCENT, DEFAULT_CLAUDE_CODE_PATH, PricingFetcher, USAGE_DATA_GLOB_PATTERN, USER_HOME_DIR, __toESM, require_usingCtx } from "./pricing-fetcher-Cx71zrV9.js";
|
|
2
|
+
import { glob, usageDataSchema } from "./data-loader-B8gFJPfi.js";
|
|
3
|
+
import { logger } from "./logger-B4PJ298G.js";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
var import_usingCtx = __toESM(require_usingCtx(), 1);
|
package/dist/debug.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-Cx71zrV9.js";
|
|
2
2
|
import "./types.internal-CX7kpidj.js";
|
|
3
|
-
import "./data-loader-
|
|
4
|
-
import "./logger-
|
|
5
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
3
|
+
import "./data-loader-B8gFJPfi.js";
|
|
4
|
+
import "./logger-B4PJ298G.js";
|
|
5
|
+
import { detectMismatches, printMismatchReport } from "./debug-CL2Shx1n.js";
|
|
6
6
|
export { detectMismatches, printMismatchReport };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { BLOCKS_COMPACT_WIDTH_THRESHOLD, BLOCKS_DEFAULT_TERMINAL_WIDTH, BLOCKS_WARNING_THRESHOLD, DEFAULT_RECENT_DAYS, MCP_DEFAULT_PORT, __commonJSMin, __require, __toESM } from "./pricing-fetcher-
|
|
2
|
+
import { BLOCKS_COMPACT_WIDTH_THRESHOLD, BLOCKS_DEFAULT_TERMINAL_WIDTH, BLOCKS_WARNING_THRESHOLD, DEFAULT_RECENT_DAYS, MCP_DEFAULT_PORT, __commonJSMin, __require, __toESM } from "./pricing-fetcher-Cx71zrV9.js";
|
|
3
3
|
import { CostModes, SortOrders, dateSchema } from "./types.internal-CX7kpidj.js";
|
|
4
4
|
import { calculateTotals, createTotalsObject, getTotalTokens } from "./calculate-cost-CoS7we68.js";
|
|
5
|
-
import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, projectBlockUsage, uniq } from "./data-loader-
|
|
6
|
-
import { description, log, logger, name, version } from "./logger-
|
|
7
|
-
import { detectMismatches, printMismatchReport } from "./debug-
|
|
8
|
-
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-
|
|
5
|
+
import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, projectBlockUsage, uniq } from "./data-loader-B8gFJPfi.js";
|
|
6
|
+
import { description, log, logger, name, version } from "./logger-B4PJ298G.js";
|
|
7
|
+
import { detectMismatches, printMismatchReport } from "./debug-CL2Shx1n.js";
|
|
8
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-Bw62xMEM.js";
|
|
9
9
|
import process$1 from "node:process";
|
|
10
10
|
import { createServer } from "node:http";
|
|
11
11
|
import { Http2ServerRequest } from "node:http2";
|
|
@@ -951,7 +951,7 @@ function _getDefaultLogLevel() {
|
|
|
951
951
|
}
|
|
952
952
|
const consola = createConsola$1();
|
|
953
953
|
var name = "ccusage";
|
|
954
|
-
var version = "
|
|
954
|
+
var version = "13.0.0";
|
|
955
955
|
var description = "Usage analysis tool for Claude Code";
|
|
956
956
|
/**
|
|
957
957
|
* Application logger instance with package name tag
|
package/dist/logger.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { log, logger } from "./logger-
|
|
1
|
+
import { log, logger } from "./logger-B4PJ298G.js";
|
|
2
2
|
export { log, logger };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __commonJSMin, __toESM, require_usingCtx } from "./pricing-fetcher-
|
|
1
|
+
import { __commonJSMin, __toESM, require_usingCtx } from "./pricing-fetcher-Cx71zrV9.js";
|
|
2
2
|
import { ZodFirstPartyTypeKind, ZodOptional, ZodType, arrayType, booleanType, dateSchema, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, stringType, unionType, unknownType } from "./types.internal-CX7kpidj.js";
|
|
3
|
-
import { getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-
|
|
4
|
-
import { name, version } from "./logger-
|
|
3
|
+
import { getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-B8gFJPfi.js";
|
|
4
|
+
import { name, version } from "./logger-B4PJ298G.js";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
const LATEST_PROTOCOL_VERSION = "2025-03-26";
|
|
7
7
|
const SUPPORTED_PROTOCOL_VERSIONS = [
|
package/dist/mcp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./pricing-fetcher-
|
|
1
|
+
import "./pricing-fetcher-Cx71zrV9.js";
|
|
2
2
|
import "./types.internal-CX7kpidj.js";
|
|
3
|
-
import "./data-loader-
|
|
4
|
-
import "./logger-
|
|
5
|
-
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-
|
|
3
|
+
import "./data-loader-B8gFJPfi.js";
|
|
4
|
+
import "./logger-B4PJ298G.js";
|
|
5
|
+
import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-Bw62xMEM.js";
|
|
6
6
|
export { createMcpHttpApp, createMcpServer, startMcpServerStdio };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { modelPricingSchema } from "./types.internal-CX7kpidj.js";
|
|
2
|
-
import { logger } from "./logger-
|
|
2
|
+
import { logger } from "./logger-B4PJ298G.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
var __create = Object.create;
|
package/dist/pricing-fetcher.js
CHANGED