ccusage 0.8.0 → 9.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 +25 -5
- package/dist/calculate-cost.d.ts +2 -2
- package/dist/chunk-BLXvPPr8.js +30 -0
- package/dist/{data-loader-Bz6Vemxw.js → data-loader-Ca8k_uX0.js} +235 -294
- package/dist/{data-loader-amTZCtBR.d.ts → data-loader-OGaMjZTD.d.ts} +8 -80
- package/dist/data-loader.d.ts +3 -3
- package/dist/data-loader.js +5 -5
- package/dist/{debug-DQXeZIjf.js → debug-zCcXwR8p.js} +5 -4
- package/dist/debug.js +5 -5
- package/dist/{dist-DAarI-SJ.js → dist-BZzwBtZs.js} +1 -1
- package/dist/{effect-WSjEuzC9-ChJ5OQQf.js → effect-WSjEuzC9-DHMVzzyB.js} +1 -1
- package/dist/{esm-Dqsc1zmX.js → esm-BU3FhOe-.js} +1 -1
- package/dist/{index-CISmcbXk-x9eVmhGM.js → index-CISmcbXk-CW1Gj6Ab.js} +5 -5
- package/dist/index.js +199 -1760
- package/dist/{logger-DN-RT9jL.js → logger-DKw-DPXD.js} +3 -3
- package/dist/logger.js +1 -1
- package/dist/{mcp-DZXbfmbs.js → mcp-BRFYI5rd.js} +42 -50
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +7 -7
- package/dist/{pricing-fetcher-Dq-OLBp4.d.ts → pricing-fetcher-BkSZh4lR.d.ts} +83 -3
- package/dist/pricing-fetcher-BlxDpqFj.js +205 -0
- package/dist/pricing-fetcher.d.ts +2 -2
- package/dist/pricing-fetcher.js +3 -3
- package/dist/{sury-DmrZ3_Oj-l0qqtY-f.js → sury-DmrZ3_Oj-Cpjsc2Lm.js} +1 -1
- package/dist/utils.table-DRzF8vZJ.js +1838 -0
- package/dist/utils.table.d.ts +24 -0
- package/dist/utils.table.js +3 -0
- package/dist/valibot-CQk-M5rL-BcaCeUrF.js +10 -0
- package/dist/{zod-Db63SLXj-N1oN-yiY.js → zod-Db63SLXj-BIXn64AP.js} +3 -3
- package/package.json +2 -1
- package/dist/pricing-fetcher-DMNBE90M.js +0 -79
- package/dist/valibot-CQk-M5rL-BNHzwpA0.js +0 -10
- /package/dist/{arktype-C-GObzDh-Bx7Fdrqj.js → arktype-C-GObzDh-CNoBqQrr.js} +0 -0
- /package/dist/{core-B0ovMhJe.js → core-DHCbAXJf.js} +0 -0
- /package/dist/{dist-BEQ1tJCL.js → dist-DCvt9hEv.js} +0 -0
- /package/dist/{prompt-CUbwSrjo.js → prompt-DtZgx4wU.js} +0 -0
- /package/dist/{types-DS8M8QF_.js → types-BlyCnKwN.js} +0 -0
package/README.md
CHANGED
|
@@ -129,8 +129,9 @@ ccusage daily
|
|
|
129
129
|
# Filter by date range
|
|
130
130
|
ccusage daily --since 20250525 --until 20250530
|
|
131
131
|
|
|
132
|
-
#
|
|
133
|
-
|
|
132
|
+
# Set CLAUDE_CONFIG_DIR environment variable for custom data directory
|
|
133
|
+
export CLAUDE_CONFIG_DIR="/custom/path/to/.claude"
|
|
134
|
+
ccusage daily
|
|
134
135
|
|
|
135
136
|
# Output in JSON format
|
|
136
137
|
ccusage daily --json
|
|
@@ -164,6 +165,10 @@ ccusage monthly --since 20250101 --until 20250531
|
|
|
164
165
|
# Use custom Claude data directory
|
|
165
166
|
ccusage monthly --path /custom/path/to/.claude
|
|
166
167
|
|
|
168
|
+
# Or set CLAUDE_CONFIG_DIR environment variable
|
|
169
|
+
export CLAUDE_CONFIG_DIR="/custom/path/to/.claude"
|
|
170
|
+
ccusage monthly
|
|
171
|
+
|
|
167
172
|
# Output in JSON format
|
|
168
173
|
ccusage monthly --json
|
|
169
174
|
|
|
@@ -191,8 +196,9 @@ ccusage session
|
|
|
191
196
|
# Filter sessions by last activity date
|
|
192
197
|
ccusage session --since 20250525
|
|
193
198
|
|
|
194
|
-
# Combine filters
|
|
195
|
-
|
|
199
|
+
# Combine filters with environment variable
|
|
200
|
+
export CLAUDE_CONFIG_DIR="/custom/path"
|
|
201
|
+
ccusage session --since 20250525 --until 20250530
|
|
196
202
|
|
|
197
203
|
# Output in JSON format
|
|
198
204
|
ccusage session --json
|
|
@@ -216,7 +222,6 @@ All commands support the following options:
|
|
|
216
222
|
|
|
217
223
|
- `-s, --since <date>`: Filter from date (YYYYMMDD format)
|
|
218
224
|
- `-u, --until <date>`: Filter until date (YYYYMMDD format)
|
|
219
|
-
- `-p, --path <path>`: Custom path to Claude data directory (default: `~/.claude`)
|
|
220
225
|
- `-j, --json`: Output results in JSON format instead of table
|
|
221
226
|
- `-m, --mode <mode>`: Cost calculation mode: `auto` (default), `calculate`, or `display`
|
|
222
227
|
- `-o, --order <order>`: Sort order: `desc` (newest first, default) or `asc` (oldest first).
|
|
@@ -232,6 +237,21 @@ All commands support the following options:
|
|
|
232
237
|
- **`calculate`**: Always calculates costs from token counts using model pricing, ignores any pre-calculated `costUSD` values
|
|
233
238
|
- **`display`**: Always uses pre-calculated `costUSD` values only, shows $0.00 for entries without pre-calculated costs
|
|
234
239
|
|
|
240
|
+
#### Environment Variable Support
|
|
241
|
+
|
|
242
|
+
The tool supports the `CLAUDE_CONFIG_DIR` environment variable to specify the Claude data directory:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Set the environment variable to use a custom Claude directory
|
|
246
|
+
export CLAUDE_CONFIG_DIR="/path/to/custom/claude/directory"
|
|
247
|
+
ccusage daily
|
|
248
|
+
|
|
249
|
+
# The environment variable determines the Claude data directory
|
|
250
|
+
ccusage daily
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The tool will use the path specified in the `CLAUDE_CONFIG_DIR` environment variable, or fall back to the default `~/.claude` directory if not set.
|
|
254
|
+
|
|
235
255
|
### MCP (Model Context Protocol) Support
|
|
236
256
|
|
|
237
257
|
Exposes usage data through Model Context Protocol for integration with other tools:
|
package/dist/calculate-cost.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
1
|
+
import "./pricing-fetcher-BkSZh4lR.js";
|
|
2
|
+
import { DailyUsage, MonthlyUsage, SessionUsage } from "./data-loader-OGaMjZTD.js";
|
|
3
3
|
|
|
4
4
|
//#region src/calculate-cost.d.ts
|
|
5
5
|
type TokenData = {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJS = (cb, mod) => function() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { __commonJS, __require, __toESM };
|