usage

usage 0.12.0

工具與目錄
在這頁

新功能 2 項

01

報告大升級:幫你抓出訂閱方案,新增專案圓環圖

HTML 分析報告現在會顯示更多有用的資訊。它新增了「你的訂閱」區塊,會自動從你電腦裡的授權檔讀出你買的是哪種 Claude 方案或 Codex 的 ChatGPT 方案,以及訂閱開始日期(放心,它絕不會偷看你的密碼或 email),而且當你把報告分享給別人並開啟「隱藏專案名稱」時,訂閱日也會自動幫你打上馬賽克。報告裡還多了一張精美的「專案佔比圓環圖」,把最吃資源的前 6 大專案塗上不同顏色,剩下的歸類為「其他」,正中央大字寫著總用量,一目了然。此外,以前系統其實早就默默算好了 Claude 跟 Codex 兩邊的用量對決(花了多少 token、佔比與成本),現在這份「Claude vs Codex」的對比戰報終於解禁顯示出來了。就像你去體檢,以前只給你一張總結數字,現在不僅在開頭幫你印出你買的是哪種等級的健檢套餐,還附上精緻的彩色圓餅圖告訴你哪裡脂肪最多,甚至把你兩隻手的肌肉量拉出來做對比。

官方原文

**"Your subscription" section in the HTML report**: auto-detects Claude (plan + subscription start date) and Codex (ChatGPT plan + subscription start date) from the local OAuth account files. Only the plan name and start date are read — tokens, emails and other secrets are never touched. When sharing the report, the subscription date is masked together with the "Hide project names" toggle. Adds the subscription.py module and its tests.

**Project-share donut chart in the HTML report**: pure-SVG (zero external deps) breakdown of token share per project; the top 6 projects get their own colour, the rest fold into "Other", and the centre shows the total.

**"Claude vs Codex" comparison section in the HTML report**: surfaces the per-agent usage (tokens / share / cost) that build_report_data already computed but never displayed.

02

整理底層管線,除錯也不再讓電腦做白工

產出報告的速度變得更快,因為系統改掉了背後的愚蠢計算方式。在計算報告的花費時,系統以前很糊塗,會先把所有數字加總一次,然後又在小圈圈裡一筆一筆重新算,如果你的資料量很大,它等於是在做雙倍的白工;現在改為只在小圈圈裡算一次,速度順暢多了。另外,報告裡「複製指令」按鈕的程式碼也被清理過了,不再疊床架屋寫兩份一樣的複製邏輯;而報告裡用來估算的台幣匯率,也標上了清楚的內部註解,說明這只是個固定的預估值、不是即時連網抓的匯率。就像餐廳的結帳櫃檯,以前算帳時會先把所有菜單全拿出來用計算機按一次,然後又翻開點菜單一筆一筆再加一次,客人排隊排到天荒地老;現在收銀員變聰明了,一邊點菜一邊就算好總金額。而且點餐機裡的程式碼也整理過了,上面還貼了張便條紙提醒新來的員工「這裡的匯率是寫死的參考值,不要傻傻去對當天的新聞」。

官方原文

**Double-counted report cost**: build_report_data summed cost once over all entries and then recomputed it per entry inside the loop — effectively doubling the work on large datasets. Now accumulated once inside the loop.

**Duplicated clipboard code in the report's "copy command" button**: the tip-copy button now reuses the shared copyText() helper instead of re-implementing the legacy-browser fallback.

**Hard-coded TWD rate**: the USD→TWD estimate in the report is now a named _USD_TO_TWD constant with a note that it is a display estimate, not a live FX rate.