@ccusage/pi 17.2.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 +116 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6674 -0
- package/dist/prompt-B3KnGVky.js +843 -0
- package/package.json +46 -0
- package/src/index.ts +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/logo.svg" alt="ccusage logo" width="256" height="256">
|
|
3
|
+
<h1>@ccusage/pi</h1>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://socket.dev/api/npm/package/@ccusage/pi"><img src="https://socket.dev/api/badge/npm/package/@ccusage/pi" alt="Socket Badge" /></a>
|
|
8
|
+
<a href="https://npmjs.com/package/@ccusage/pi"><img src="https://img.shields.io/npm/v/@ccusage/pi?color=yellow" alt="npm version" /></a>
|
|
9
|
+
<a href="https://tanstack.com/stats/npm?packageGroups=%5B%7B%22packages%22:%5B%7B%22name%22:%22@ccusage/pi%22%7D%5D%7D%5D&range=30-days&transform=none&binType=daily&showDataMode=all&height=400"><img src="https://img.shields.io/npm/dt/@ccusage/pi" alt="NPM Downloads" /></a>
|
|
10
|
+
<a href="https://packagephobia.com/result?p=@ccusage/pi"><img src="https://packagephobia.com/badge?p=@ccusage/pi" alt="install size" /></a>
|
|
11
|
+
<a href="https://deepwiki.com/ryoppippi/ccusage"><img src="https://img.shields.io/badge/DeepWiki-ryoppippi%2Fccusage-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3d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
|
14
|
+
> Unified Claude Max usage tracking across Claude Code and [pi-agent](https://github.com/badlogic/pi-mono) with the same reporting experience as <code>ccusage</code>.
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Recommended - always include @latest
|
|
20
|
+
npx @ccusage/pi@latest --help
|
|
21
|
+
bunx @ccusage/pi@latest --help
|
|
22
|
+
|
|
23
|
+
# Alternative package runners
|
|
24
|
+
pnpm dlx @ccusage/pi
|
|
25
|
+
pnpx @ccusage/pi
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Recommended: Shell Alias
|
|
29
|
+
|
|
30
|
+
Since `npx @ccusage/pi@latest` is quite long to type repeatedly, we strongly recommend setting up a shell alias:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# bash/zsh: alias ccusage-pi='bunx @ccusage/pi@latest'
|
|
34
|
+
# fish: alias ccusage-pi 'bunx @ccusage/pi@latest'
|
|
35
|
+
|
|
36
|
+
# Then simply run:
|
|
37
|
+
ccusage-pi daily
|
|
38
|
+
ccusage-pi monthly --json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
> 💡 The CLI combines data from Claude Code (`~/.claude/projects/` or `~/.config/claude/projects/`) and pi-agent (`~/.pi/agent/sessions/`).
|
|
42
|
+
|
|
43
|
+
## Common Commands
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Daily combined usage (Claude Code + pi-agent)
|
|
47
|
+
npx @ccusage/pi@latest daily
|
|
48
|
+
|
|
49
|
+
# Monthly combined usage
|
|
50
|
+
npx @ccusage/pi@latest monthly
|
|
51
|
+
|
|
52
|
+
# Session-based usage
|
|
53
|
+
npx @ccusage/pi@latest session
|
|
54
|
+
|
|
55
|
+
# JSON output for scripting
|
|
56
|
+
npx @ccusage/pi@latest daily --json
|
|
57
|
+
|
|
58
|
+
# Custom pi-agent path
|
|
59
|
+
npx @ccusage/pi@latest daily --pi-path /path/to/sessions
|
|
60
|
+
|
|
61
|
+
# Filter by date range
|
|
62
|
+
npx @ccusage/pi@latest daily --since 2025-12-01 --until 2025-12-19
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Useful environment variables:
|
|
66
|
+
|
|
67
|
+
- `PI_AGENT_DIR` – override the pi-agent sessions directory (defaults to `~/.pi/agent/sessions`)
|
|
68
|
+
- `CLAUDE_CONFIG_DIR` – override the Claude Code data directory
|
|
69
|
+
- `LOG_LEVEL` – control log verbosity (0 silent … 5 trace)
|
|
70
|
+
|
|
71
|
+
## What is pi-agent?
|
|
72
|
+
|
|
73
|
+
[Pi-agent](https://github.com/badlogic/pi-mono) is an alternative Claude coding agent from [shittycodingagent.ai](https://shittycodingagent.ai). It stores usage data in a similar JSONL format to Claude Code but in a different directory structure.
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- 📊 **Combined Reports**: Unified view of Claude Code and pi-agent usage
|
|
78
|
+
- 🏷️ **Source Labels**: Clear labels (`[cc]` for Claude Code, `[pi]` for pi-agent)
|
|
79
|
+
- 📅 **Daily/Monthly/Session Reports**: Same reporting options as ccusage
|
|
80
|
+
- 💵 **Accurate Cost Calculation**: Uses LiteLLM pricing database
|
|
81
|
+
- 📄 **JSON Output**: Export data in structured JSON format with `--json`
|
|
82
|
+
|
|
83
|
+
## Data Sources
|
|
84
|
+
|
|
85
|
+
This package combines usage data from:
|
|
86
|
+
|
|
87
|
+
| Source | Directory | Label |
|
|
88
|
+
| ----------- | ----------------------------------------------------- | ------ |
|
|
89
|
+
| Claude Code | `~/.claude/projects/` or `~/.config/claude/projects/` | `[cc]` |
|
|
90
|
+
| Pi-agent | `~/.pi/agent/sessions/` | `[pi]` |
|
|
91
|
+
|
|
92
|
+
## Documentation
|
|
93
|
+
|
|
94
|
+
For detailed guides and examples, visit **[ccusage.com](https://ccusage.com/)**.
|
|
95
|
+
|
|
96
|
+
## Sponsors
|
|
97
|
+
|
|
98
|
+
### Featured Sponsor
|
|
99
|
+
|
|
100
|
+
Check out [ccusage: The Claude Code cost scorecard that went viral](https://www.youtube.com/watch?v=Ak6qpQ5qdgk)
|
|
101
|
+
|
|
102
|
+
<p align="center">
|
|
103
|
+
<a href="https://www.youtube.com/watch?v=Ak6qpQ5qdgk">
|
|
104
|
+
<img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/ccusage_thumbnail.png" alt="ccusage: The Claude Code cost scorecard that went viral" width="600">
|
|
105
|
+
</a>
|
|
106
|
+
</p>
|
|
107
|
+
|
|
108
|
+
<p align="center">
|
|
109
|
+
<a href="https://github.com/sponsors/ryoppippi">
|
|
110
|
+
<img src="https://cdn.jsdelivr.net/gh/ryoppippi/sponsors@main/sponsors.svg">
|
|
111
|
+
</a>
|
|
112
|
+
</p>
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
MIT © [@ryoppippi](https://github.com/ryoppippi)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|