@unravel-tech/ccusage-pi 18.0.5
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 +113 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6722 -0
- package/dist/prompt-B5khkcyF.js +843 -0
- package/package.json +48 -0
- package/src/index.ts +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
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/uv1saED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13
|
+
|
|
14
|
+
> Analyze [pi-agent](https://github.com/badlogic/pi-mono) session usage 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 reads pi-agent session data from `~/.pi/agent/sessions/` (configurable via `PI_AGENT_DIR`).
|
|
42
|
+
|
|
43
|
+
## Common Commands
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Daily usage grouped by date (default command)
|
|
47
|
+
npx @ccusage/pi@latest daily
|
|
48
|
+
|
|
49
|
+
# Monthly usage grouped by month
|
|
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
|
+
- `LOG_LEVEL` – control log verbosity (0 silent … 5 trace)
|
|
69
|
+
|
|
70
|
+
## What is pi-agent?
|
|
71
|
+
|
|
72
|
+
[Pi-agent](https://github.com/badlogic/pi-mono) is an alternative Claude coding agent. It stores usage data in a similar JSONL format to Claude Code but in a different directory structure.
|
|
73
|
+
|
|
74
|
+
## Features
|
|
75
|
+
|
|
76
|
+
- 📊 **Daily/Monthly/Session Reports**: Same reporting options as ccusage
|
|
77
|
+
- 💵 **Accurate Cost Calculation**: Uses LiteLLM pricing database
|
|
78
|
+
- 📄 **JSON Output**: Export data in structured JSON format with `--json`
|
|
79
|
+
- 📱 **Compact Mode**: Use `--compact` flag for narrow terminals
|
|
80
|
+
|
|
81
|
+
## Data Source
|
|
82
|
+
|
|
83
|
+
Pi-agent session data is read from:
|
|
84
|
+
|
|
85
|
+
| Directory | Default Path |
|
|
86
|
+
| ----------------- | ----------------------- |
|
|
87
|
+
| Pi-agent sessions | `~/.pi/agent/sessions/` |
|
|
88
|
+
|
|
89
|
+
## Documentation
|
|
90
|
+
|
|
91
|
+
For detailed guides and examples, visit **[ccusage.com](https://ccusage.com/)**.
|
|
92
|
+
|
|
93
|
+
## Sponsors
|
|
94
|
+
|
|
95
|
+
### Featured Sponsor
|
|
96
|
+
|
|
97
|
+
Check out [ccusage: The Claude Code cost scorecard that went viral](https://www.youtube.com/watch?v=Ak6qpQ5qdgk)
|
|
98
|
+
|
|
99
|
+
<p align="center">
|
|
100
|
+
<a href="https://www.youtube.com/watch?v=Ak6qpQ5qdgk">
|
|
101
|
+
<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">
|
|
102
|
+
</a>
|
|
103
|
+
</p>
|
|
104
|
+
|
|
105
|
+
<p align="center">
|
|
106
|
+
<a href="https://github.com/sponsors/ryoppippi">
|
|
107
|
+
<img src="https://cdn.jsdelivr.net/gh/ryoppippi/sponsors@main/sponsors.svg">
|
|
108
|
+
</a>
|
|
109
|
+
</p>
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT © [@ryoppippi](https://github.com/ryoppippi)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|