Skip to content

Commit 1c9b7ed

Browse files
committed
Make reports all-time by default
1 parent 77b5b64 commit 1c9b7ed

18 files changed

Lines changed: 136 additions & 28 deletions

CHANGELOG.en.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Format follows [Keep a Changelog](https://keepachangelog.com/).
77

88
## [Unreleased]
99

10+
### Changed
11+
- **README now frames this fork more clearly as Codex-first**: clarified Codex as the primary path, Claude Code as optional, and documented the Project Usage all-time range.
12+
- **Reports now default to all-time**: the popover Analyze button and `usage_cli.py report` now generate all-data reports by default; use `--last30` in the CLI for the previous rolling 30-day range.
13+
1014
## [0.11.4+codex.2] - 2026-05-26
1115

1216
### Fixed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
## [Unreleased]
88

9+
### 變更
10+
- **README 改成更明確的 Codex-first fork 說明**:補清楚 Codex 是主要流程、Claude Code 是可選整合,並同步 Project Usage 的 all-time range。
11+
- **Report 預設改為 all-time**:popover 的「分析」與 `usage_cli.py report` 現在預設產生全部資料報告;CLI 需要近 30 天時可使用 `--last30`
12+
913
## [0.11.4+codex.2] - 2026-05-26
1014

1115
### 修正

README.en.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Platform](https://img.shields.io/badge/platform-macOS-lightgrey.svg)](https://www.apple.com/macos/)
99
[![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE)
1010

11-
`usage` is a macOS menu bar tool that pins your **Codex** usage to the top-right of your screen, while keeping **Claude Code** as an optional integration. Click the icon for a popover showing Session, Weekly, per-project usage (today / 7-day / monthly), and today's token usage and cost estimate.
11+
`usage` is a macOS menu bar tool that pins your **Codex** usage to the top-right of your screen, while keeping **Claude Code** as an optional integration. Click the icon for a popover showing Session, Weekly, per-project usage (today / 7-day / monthly / all-time), and today's token usage and cost estimate; click Analyze to generate an all-time HTML report.
1212

1313
It **never calls the Anthropic / OpenAI API** and **never reads the Keychain**, so it avoids the observer effect of "pinging once a minute counts as usage."
1414

@@ -185,13 +185,13 @@ source .venv/bin/activate
185185
python3 main.py
186186
```
187187
188-
- **Menu bar format:** `🐾 37%`. If Codex usage is also detected, a Codex suffix is appended: `🐾 37% · 📜 10%`.
188+
- **Menu bar format:** with Codex only, it shows `📜 10%`. If Claude Code usage is also detected, it shows `🐾 37% · 📜 10%`.
189189
190190
<img src="docs/menubar.png" alt="menu bar display" width="240">
191191
192192
- **Click the icon to expand the popover.** It has four sections:
193-
1. Two cards for Claude Code and Codex. Each shows Session and Weekly progress bars with reset countdowns.
194-
2. A projects card listing the top three projects by usage. Click the button in the top-right corner to cycle between today / 7-day / monthly views.
193+
1. Two cards for Claude Code and Codex. Codex is the primary path; Claude Code remains optional when it is not installed.
194+
2. A projects card listing the top three projects by usage. Click the button in the top-right corner to cycle between today / 7-day / monthly / all-time views.
195195
3. A footer card showing current rate, sync status, and today's token usage and cost estimate (Claude uses the actual `costUSD` from its log when available; Codex cost is estimated from token count × pricing table).
196196
4. Two buttons: "Refresh now" and "Quit".
197197
- **Panel**: click the **Switch Panel** button in the top-right corner to change panel styles. Nine built-in panels are available — **Classic** (clean light cards), **Matrix** (neon green digital rain), **Windows 95** (retro Win95 interface), **Newspaper** (aged newsprint), **Cloud Observation** (weather-station glass cards), **Midnight Aquarium** (deep-sea animation), **Prism Arcade** (rainbow holographic animation), **Black Hole** (rotating accretion disk), and the brand-new **World Cup 2026** — FIFA broadcast HUD with a green pitch, stick-figure players that chase and kick the ball, and bidirectional duel bars instead of standard progress bars.
@@ -223,9 +223,9 @@ python3 main.py --tui
223223
224224
Press `Ctrl+C` to exit.
225225
226-
## Reports and deep analytics (CLI)
226+
## Reports and deep analytics
227227
228-
Beyond the menu bar and TUI, there's an analytics CLI entrypoint `usage_cli.py` for exporting HTML reports or running an interactive terminal dashboard:
228+
Beyond the menu bar and TUI, the popover's **Analyze** button generates an **all-time HTML report**. If you want a specific range, the `usage_cli.py` analytics entrypoint can export HTML reports or run an interactive terminal dashboard:
229229
230230
<p align="center">
231231
<img src="docs/report.en.png" alt="HTML report screen: Your AI Usage Recap" width="520">
@@ -241,8 +241,9 @@ python3 usage_cli.py
241241
python3 usage_cli.py claude
242242
python3 usage_cli.py codex
243243
244-
# Generate an HTML report and open it in your default browser (default range: last 30 days)
244+
# Generate an HTML report and open it in your default browser (default range: all data)
245245
python3 usage_cli.py report
246+
python3 usage_cli.py report --last30 # last 30 days
246247
python3 usage_cli.py report --today # today
247248
python3 usage_cli.py report --week # this week
248249
python3 usage_cli.py report --month # this month

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Platform](https://img.shields.io/badge/platform-macOS-lightgrey.svg)](https://www.apple.com/macos/)
99
[![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE)
1010

11-
`usage` 是一個 macOS menu bar(螢幕右上角的選單列)小工具,把 **Codex** 的用量釘在你的螢幕右上角,並保留 **Claude Code** 作為可選整合。點開可以看到 Session、Weekly、各專案用量(今日 / 7 日 / 月),以及今日 token 用量與成本估算。
11+
`usage` 是一個 macOS menu bar(螢幕右上角的選單列)小工具,把 **Codex** 的用量釘在你的螢幕右上角,並保留 **Claude Code** 作為可選整合。點開可以看到 Session、Weekly、各專案用量(今日 / 7 日 / 月 / 全部),以及今日 token 用量與成本估算;按「分析」會產生 all-time HTML report
1212

1313
不呼叫 Anthropic / OpenAI 的 API(接口)、也不讀 Keychain(macOS 內建的密碼保險箱),所以不會發生「自己每分鐘 ping 一次也算用量」這種事。
1414

@@ -187,13 +187,13 @@ source .venv/bin/activate
187187
python3 main.py
188188
```
189189

190-
- **選單列那行字長這樣**`🐾 37%`;如果同時有 Codex 用量,會變成 `🐾 37% · 📜 10%`
190+
- **選單列那行字長這樣**只有 Codex 時是 `📜 10%`;如果同時有 Claude Code 用量,會變成 `🐾 37% · 📜 10%`
191191

192192
<img src="docs/menubar.png" alt="menu bar 上方顯示樣式" width="240">
193193

194194
- **點一下會展開 popover**,分四塊:
195-
1. 上面兩張卡片分別是 Claude Code 跟 Codex;每張各有 Session 跟 Weekly 兩條進度條
196-
2. 專案用量卡:列出近期用量前三名的專案,可點右上角按鈕在「今日 / 7 日 / 月」三段之間切換
195+
1. 上面兩張卡片分別是 Claude Code 跟 Codex;Codex 是主要流程,Claude Code 沒裝時會自然維持可選狀態
196+
2. 專案用量卡:列出近期用量前三名的專案,可點右上角按鈕在「今日 / 7 日 / 月 / 全部」之間切換
197197
3. 最下面那張小卡是目前速率、同步狀態、今日 token 用量與成本估算(Claude 若 log 有提供實際金額則直接顯示;Codex 成本為依 token 數估算)
198198
4. 兩顆按鈕:「立即更新」、「結束」
199199
- **面板**:點右上角「更換面板」按鈕可切換面板樣式。目前內建九款面板——「預設」(簡潔白色卡片)、「駭客任務」(黑底螢光綠+數位雨動畫)、「視窗 95」(Windows 95 復古介面)、「復古報紙」(米黃報紙風)、「雲圖觀測」(氣象風玻璃卡片)、「午夜水族箱」(深海動畫)、「稜鏡街機」(彩虹全息動畫)、「黑洞視界」(旋轉吸積盤)、以及全新「世界盃 2026」——FIFA 轉播 HUD 風格,鮮綠球場、棒人球員追球踢球互動動畫、雙向對戰記分條。
@@ -225,9 +225,9 @@ python3 main.py --tui
225225

226226
`Ctrl+C` 退出。
227227

228-
## 報告與深度分析(CLI)
228+
## 報告與深度分析
229229

230-
除了選單列跟 TUI,還有一個分析用的 CLI 進入點 `usage_cli.py`,可以匯出 HTML 報告、或在終端機開互動式 dashboard(儀表板,互動式統計面板):
230+
除了選單列跟 TUI,popover 裡的「分析」按鈕會直接產生 **all-time HTML report**。如果你想指定時間範圍,也可以用 CLI 進入點 `usage_cli.py` 匯出 HTML 報告、或在終端機開互動式 dashboard(儀表板,互動式統計面板):
231231

232232
<p align="center">
233233
<img src="docs/report.png" alt="HTML 報告畫面:你的 AI 用量回顧" width="520">
@@ -243,8 +243,9 @@ python3 usage_cli.py
243243
python3 usage_cli.py claude
244244
python3 usage_cli.py codex
245245

246-
# 產生 HTML 報告並用預設瀏覽器打開(預設範圍:近 30 天
246+
# 產生 HTML 報告並用預設瀏覽器打開(預設範圍:全部資料
247247
python3 usage_cli.py report
248+
python3 usage_cli.py report --last30 # 近 30 天
248249
python3 usage_cli.py report --today # 今日
249250
python3 usage_cli.py report --week # 本週
250251
python3 usage_cli.py report --month # 本月

assets/panels/aquarium.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,8 @@ <h1 data-i18n="projects_title">Project Usage</h1>
843843
}
844844
const bridge = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.usage;
845845
if (bridge && typeof bridge.postMessage === "function") {
846-
bridge.postMessage(button.dataset.action);
846+
const action = button.dataset.action === "analyze" && projectRange === "all" ? "analyze_all" : button.dataset.action;
847+
bridge.postMessage(action);
847848
}
848849
});
849850

assets/panels/black_hole.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,8 @@ <h1 data-i18n="projects_title">Project Usage</h1>
739739
}
740740
const bridge = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.usage;
741741
if (bridge && typeof bridge.postMessage === "function") {
742-
bridge.postMessage(button.dataset.action);
742+
const action = button.dataset.action === "analyze" && projectRange === "all" ? "analyze_all" : button.dataset.action;
743+
bridge.postMessage(action);
743744
}
744745
});
745746

assets/panels/classic.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ <h1 data-i18n="projects_title">Project Usage</h1>
587587
}
588588
const bridge = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.usage;
589589
if (bridge && typeof bridge.postMessage === "function") {
590-
bridge.postMessage(button.dataset.action);
590+
const action = button.dataset.action === "analyze" && projectRange === "all" ? "analyze_all" : button.dataset.action;
591+
bridge.postMessage(action);
591592
}
592593
});
593594

assets/panels/cloud_observation.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,8 @@ <h1 data-i18n="projects_title">Project Usage</h1>
825825
}
826826
const bridge = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.usage;
827827
if (bridge && typeof bridge.postMessage === "function") {
828-
bridge.postMessage(button.dataset.action);
828+
const action = button.dataset.action === "analyze" && projectRange === "all" ? "analyze_all" : button.dataset.action;
829+
bridge.postMessage(action);
829830
}
830831
});
831832

assets/panels/matrix.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,8 @@ <h1 data-i18n="projects_title"></h1>
689689
}
690690
const bridge = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.usage;
691691
if (bridge && typeof bridge.postMessage === "function") {
692-
bridge.postMessage(button.dataset.action);
692+
const action = button.dataset.action === "analyze" && projectRange === "all" ? "analyze_all" : button.dataset.action;
693+
bridge.postMessage(action);
693694
}
694695
});
695696

assets/panels/newspaper.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,8 @@ <h1 data-i18n="projects_title">Project Usage</h1>
652652
}
653653
const bridge = window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.usage;
654654
if (bridge && typeof bridge.postMessage === "function") {
655-
bridge.postMessage(button.dataset.action);
655+
const action = button.dataset.action === "analyze" && projectRange === "all" ? "analyze_all" : button.dataset.action;
656+
bridge.postMessage(action);
656657
}
657658
});
658659

0 commit comments

Comments
 (0)