tledger 0.1.2
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 +70 -0
- package/bin/token-ledger-terminal.mjs +693 -0
- package/bin/token-ledger-tui.mjs +95 -0
- package/bin/token-ledger.mjs +568 -0
- package/lib/token-ledger-collector.mjs +1248 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Token Ledger
|
|
2
|
+
|
|
3
|
+
Token Ledger is a lightweight, local-only terminal dashboard for Codex token
|
|
4
|
+
usage. It ranks projects, shows model and cache mix, and adds reset-cycle
|
|
5
|
+
context without sending usage data anywhere. Codex Auto Review is shown
|
|
6
|
+
separately with its token total, distinct-turn share, and cached-input share.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
_The screenshot is generated from an intentionally synthetic fixture._
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
Token Ledger requires Node.js 22.13 or newer and has no runtime npm
|
|
15
|
+
dependencies.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install --global tledger
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Use
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
tledger # current seven-day window
|
|
25
|
+
tledger week # same default, stated explicitly
|
|
26
|
+
tledger day # today
|
|
27
|
+
tledger day yesterday
|
|
28
|
+
tledger week 2026-08-05
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The local timezone and top 10 projects are selected automatically. The default
|
|
32
|
+
view is interactive in a terminal; use arrow keys or `j`/`k` to move and `q` or
|
|
33
|
+
Escape to exit.
|
|
34
|
+
|
|
35
|
+
Useful options:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
--tz <zone> Use another IANA timezone
|
|
39
|
+
--top <1-100> Change the project limit
|
|
40
|
+
--refresh Force a fresh local scan
|
|
41
|
+
--no-refresh Use the existing cache without a freshness check
|
|
42
|
+
--input <file> Read an explicit privacy-reduced snapshot
|
|
43
|
+
--codex-home <dir> Read another Codex data directory
|
|
44
|
+
--no-archived Skip archived sessions during collection
|
|
45
|
+
--raw-projects Keep singleton project labels separate
|
|
46
|
+
--static Print once instead of opening the interactive view
|
|
47
|
+
--plain Print once without ANSI color
|
|
48
|
+
--ascii Use ASCII bars
|
|
49
|
+
--width <40-200> Set the static layout width
|
|
50
|
+
--date <day> Set today, yesterday, or YYYY-MM-DD
|
|
51
|
+
--help Show complete CLI help
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
By default, Token Ledger reads `CODEX_HOME` or `~/.codex` and keeps a
|
|
55
|
+
privacy-reduced cache at `~/.token-ledger/token-ledger-snapshot.json`. It checks
|
|
56
|
+
source freshness automatically. Fresh scans use a bounded pool of up to four
|
|
57
|
+
workers; unchanged runs read the existing cache. Token Ledger makes no network
|
|
58
|
+
requests and excludes
|
|
59
|
+
message bodies, reasoning text, tool payloads, credentials, and full local
|
|
60
|
+
paths from the cache. Project labels can still reveal local context, so keep
|
|
61
|
+
snapshots private unless you have reviewed them. Reset-cycle burn
|
|
62
|
+
is an estimate, not official quota or billing data.
|
|
63
|
+
|
|
64
|
+
## Develop
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm test
|
|
68
|
+
npm run demo
|
|
69
|
+
npm pack --dry-run
|
|
70
|
+
```
|