usage

usage 0.29.33

工具與目錄
在這頁

新功能 3 項

01

Linux 支援狀態列驗證,標準函式庫掛鉤正式納入測試

想在 Linux 環境藉由 usage 掌握 Claude Code 的用量與狀態,過去常因文件未提及而不敢確定是否支援。事實上,負責串接的 hook(事件發生時觸發的自動處理程式)僅依賴 Python 標準函式庫,且 usage setup 在 macOS 與 Windows 上從未設下系統限制,在 Linux 本就能正常運作;過去只是缺少自動化測試驗證,才一直未寫入官方文件。現在 CI 會在 Ubuntu 系統中建立拋棄式 HOME 目錄安裝掛鉤,並傳入真實的 statusLine(終端機底部的即時狀態列)酬載進行驗證。⟦這好比一件出廠就具備防水機能的風衣,過去因說明書未印認證標章讓人不敢在雨天穿出門;直到品管中心在標準測試台噴灑真實水柱,確認它確實防水。⟧

官方原文

**The Claude Code status line is now verified on Linux.** The hook is stdlib-only and usage setup never gated the Claude path on macOS or Windows, so it already worked there — nothing tested it, so it went undocumented. CI now installs the hook against a throwaway HOME on Ubuntu and feeds it a real statusLine payload.

02

命令列套件登陸 PyPI,免裝桌面版即可在終端機直接試用

套件已以 usage-cli 之名發布至 PyPI,輸入 uvx usage-cli 不用先安裝任何東西,uv 會自行準備 Python 3.13 執行環境,讓 Linux 與 Windows 使用者不必下載 macOS 應用程式,就能體驗 usage status --json、儀表板與報表。執行 uv tool install usage-cli 則可常駐指令;因 usage 名稱在 2016 年已被註冊,套件名稱為 usage-cli,但安裝後 usage 與 usage-cli 指令皆可使用。此途徑僅提供命令列工具,選單列與系統匣應用程式仍維持在 Release 下載。⟦這如同工具出租店提供免押金快借服務,想用扳手不必搬整組工具箱回家,報代號就能直接開工;若順手再登記留用。⟧

官方原文

**uvx usage-cli runs the terminal interface without installing anything.** The CLI is now published to PyPI as usage-cli, so Linux and Windows users can try usage status --json, the dashboard, and the reports without downloading the macOS app; uv prepares Python 3.13 on its own. uv tool install usage-cli keeps the command around as usage. The distribution name is usage-cli because usage was already taken on PyPI in 2016; both usage and usage-cli are installed as commands. This path ships the CLI only — the menu bar and system tray apps are unchanged and still come from the release downloads.

03

依工作目錄精準歸帳,Antigravity 用量不再全數掛在單一專案

⟦像公務採購報帳時,若所有發票都一律蓋上總公司大印,月底的部門支出排行便完全看不出各專案到底花了多少經費;唯有依據出差工單上的工作地點逐筆歸帳,才能精準呈現各專案的真實花費。⟧ Antigravity(agy)的用量現在會準確歸屬至你實際作業的專案中。過去每筆 agy 記錄都固定寫入 "Antigravity" 專案名稱,導致專案用量排行無法看出 token(AI 計費的文字單位)到底花在哪個資料夾。現在記錄會從各工作階段所執行的 shell 指令中自動解析工作目錄,只有在找不到任何指令紀錄時,才會以備援方式退回使用 "Antigravity" 名稱。

官方原文

**Antigravity (agy) usage is now attributed to the project you were actually working in.** Every agy entry previously recorded a fixed "Antigravity" project name, so the project usage ranking couldn't show which folder the tokens were spent in. Entries now resolve the working directory from the session's recorded shell commands, falling back to "Antigravity" only when none is found.