Skip to content

Commit eae1b7a

Browse files
committed
Sync upstream 0.11.5 into Codex-first fork
1 parent e5e14c2 commit eae1b7a

36 files changed

Lines changed: 929 additions & 96 deletions

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ labels: bug
2323

2424
**Logs**
2525
Run with `USAGE_DEBUG=1 python3 main.py` and paste any warnings here.
26-
Redact paths or identifiers as needed.
26+
27+
> ⚠️ **Privacy**: usage reads files under `~/.claude/` and `~/.codex/`. **Do not paste**:
28+
> - the contents of `~/.claude/usage-status.json` or any `tt-status.json` / `usag-status.json`
29+
> - any `~/.codex/sessions/**/*.jsonl` (these may include prompts, project names, and absolute paths)
30+
> - absolute paths, project / repo names, session IDs, or cost figures
31+
>
32+
> Trim to the smallest snippet that reproduces the issue. When in doubt, replace identifiers with `<redacted>`.
2733
2834
```
2935

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
runs-on: macos-latest
1414

1515
steps:
16-
- uses: actions/checkout@v5
16+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
1717

18-
- uses: astral-sh/setup-uv@v6
18+
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
1919

2020
- run: uv python install 3.13
2121

CHANGELOG.en.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ Format follows [Keep a Changelog](https://keepachangelog.com/).
1111
- **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.
1212
- **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.
1313

14+
## [0.11.5+codex.1] - 2026-05-27
15+
16+
### Changed
17+
- **Version base now matches upstream 0.11.5**: this fork build now uses `0.11.5+codex.1`, bringing over upstream v0.11.5 language detection, report opening, docs, and privacy fixes while preserving Codex-first behavior.
18+
- **Added the GitHub Pages landing page**: synced upstream's multilingual landing page and latest panel screenshots, then retargeted it to `ericweichun/usage` and Codex-first messaging.
19+
- **Popover labels now match upstream wording**: "Analyze" is now "Report", and "CLI" is now "Terminal".
20+
21+
### Fixed
22+
- **Reports follow the app language**: menubar now passes the active UI language into the HTML report renderer.
23+
- **statusLine update hints no longer pollute status JSON**: update hints are appended only when rendering statusLine text, avoiding accidental text in the JSON payload read by the app.
24+
- **Language detection is centralized through `usage_lang.detect_lang()`**: `.app` launches from Finder / launchd now honor macOS preferred languages.
25+
- **Privacy and CI hygiene**: issue templates now warn against pasting `~/.codex/sessions/**/*.jsonl` or Claude status files; CI actions are pinned by SHA; an unused Antigravity icon asset was removed.
26+
1427
## [0.11.4+codex.2] - 2026-05-26
1528

1629
### Fixed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
- **README 改成更明確的 Codex-first fork 說明**:補清楚 Codex 是主要流程、Claude Code 是可選整合,並同步 Project Usage 的 all-time range。
1111
- **Report 預設改為 all-time**:popover 的「分析」與 `usage_cli.py report` 現在預設產生全部資料報告;CLI 需要近 30 天時可使用 `--last30`
1212

13+
## [0.11.5+codex.1] - 2026-05-27
14+
15+
### 變更
16+
- **版本基底對齊 upstream 0.11.5**:fork build 改用 `0.11.5+codex.1`,同步 upstream v0.11.5 的語言偵測、report 開啟與文件/隱私修正,同時保留 Codex-first 行為。
17+
- **新增 GitHub Pages landing page**:同步 upstream 的多語介紹頁與最新面板截圖,並改成 `ericweichun/usage` 與 Codex-first 文案。
18+
- **Popover 文案同步 upstream**:「分析」改為「報告」,「CLI」改為「終端」,更貼近實際功能。
19+
20+
### 修正
21+
- **Report 語言跟隨 app 語言**:menubar 產生 HTML report 時會把目前 UI 語言傳入 report renderer。
22+
- **statusLine update hint 不再污染狀態 JSON**:只有真正渲染 statusLine 文字時才附加新版提示,避免寫入給 app 讀的 JSON payload。
23+
- **語言偵測共用 `usage_lang.detect_lang()`**:Finder / launchd 啟動 `.app` 時也會依 macOS preferred languages 判定語言。
24+
- **隱私與 CI hygiene**:issue template 明確提醒不要貼上 `~/.codex/sessions/**/*.jsonl` 或 Claude 狀態檔;CI actions 改 pin SHA;移除未使用的 Antigravity icon asset。
25+
1326
## [0.11.4+codex.2] - 2026-05-26
1427

1528
### 修正

README.en.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
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 / all-time), and today's token usage and cost estimate; click Analyze to generate an all-time HTML report.
11+
🌐 **Landing page**: [ericweichun.github.io/usage](https://ericweichun.github.io/usage/)
12+
13+
`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 Report to generate an all-time HTML report.
1214

1315
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."
1416

@@ -125,7 +127,7 @@ After the hook is installed and Claude Code is restarted, the bottom of the Clau
125127
<img src="docs/statusline.en.png" alt="Claude Code statusLine display (English)" width="640">
126128
</p>
127129
128-
To toggle the statusLine on / off later (e.g. you want to see Claude Code's native status line), click the **CLI ✓** button in the menubar popover's "Projects" section toolbar — no need to run `--unsetup` / `--setup` again.
130+
To toggle the statusLine on / off later (e.g. you want to see Claude Code's native status line), click the **Terminal ✓** button in the menubar popover's "Projects" section toolbar — no need to run `--unsetup` / `--setup` again.
129131
130132
## Download
131133
@@ -225,7 +227,7 @@ Press `Ctrl+C` to exit.
225227
226228
## Reports and deep analytics
227229
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:
230+
Beyond the menu bar and TUI, the popover's **Report** 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:
229231
230232
<p align="center">
231233
<img src="docs/report.en.png" alt="HTML report screen: Your AI Usage Recap" width="520">

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
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 用量與成本估算;按「分析」會產生 all-time HTML report。
11+
🌐 **介紹頁**[ericweichun.github.io/usage](https://ericweichun.github.io/usage/)
12+
13+
`usage` 是一個 macOS menu bar(螢幕右上角的選單列)小工具,把 **Codex** 的用量釘在你的螢幕右上角,並保留 **Claude Code** 作為可選整合。點開可以看到 Session、Weekly、各專案用量(今日 / 7 日 / 月 / 全部),以及今日 token 用量與成本估算;按「報告」會產生 all-time HTML report。
1214

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

@@ -125,7 +127,7 @@ ln -s $(brew --prefix)/Cellar/usage/$(brew list --versions usage | awk '{print $
125127
<img src="docs/statusline.png" alt="Claude Code statusLine 顯示樣式(繁中)" width="640">
126128
</p>
127129
128-
裝完之後,若想隨時關掉 / 重裝 statusLine(例如想看看 Claude Code 原本的狀態列),可以從 menubar popover 的「專案」section 工具列點 **CLI** 按鈕一鍵切換 —— 不需要再跑 `--unsetup` / `--setup`
130+
裝完之後,若想隨時關掉 / 重裝 statusLine(例如想看看 Claude Code 原本的狀態列),可以從 menubar popover 的「專案」section 工具列點 **終端** 按鈕一鍵切換 —— 不需要再跑 `--unsetup` / `--setup`
129131
130132
## 拿到原始碼
131133
@@ -227,7 +229,7 @@ python3 main.py --tui
227229

228230
## 報告與深度分析
229231

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

232234
<p align="center">
233235
<img src="docs/report.png" alt="HTML 報告畫面:你的 AI 用量回顧" width="520">
-70.2 KB
Binary file not shown.

docs/aquarium.en.png

231 KB
Loading

docs/aquarium.png

212 KB
Loading

docs/black_hole.en.png

176 KB
Loading

0 commit comments

Comments
 (0)