繁體中文

新功能

用指令快速查額度,終端機與狀態列隨調隨用

想在 Starship 提示字元或 tmux 狀態列隨時盯著 AI 剩餘額度,過去就像非得請水電工拆開儀表箱才能讀取數據,必須寫 Python 程式硬挖 usage 的內部模組。現在正面直接裝上了液晶小螢幕:新指令 usage status 會直接印出一行摘要,加上 --json 參數還能輸出帶版號的 JSON 資料。兩者跟選單列讀取同一份本機檔案,完全不發送額外網路請求,看一眼就知道剩餘額度而不用聯網查詢;官方開發文件還附上了現成的設定範例,方便你直接貼進設定檔。

新功能

附帶組建來源證明與物料清單,安裝檔來源透明可驗證

下載安裝檔時,現在你可以確切核實檔案是否真的由官方原始碼編譯而成。每個 macOS 與 Windows 發行檔案現在都附帶經過數位簽署的 SLSA 組建來源證明,只要執行 gh attestation verify <file> --repo aqua5230/usage 指令就能核對檔案產銷履歷;macOS 版本還額外附上 CycloneDX 格式的軟體物料清單(SBOM,詳細列出所有內建相依套件的名冊)。這種透明度好比購買進口食品,包裝上貼有可掃描產銷履歷的防偽溯源標籤以證明未遭調包,背面更印有完整成分配料表,讓每項零件與函式庫的來源都一清二楚。

新功能

離線價目表標註查核日期,啟用備援時主動發出警示

網路斷線或無法連上最新價目表時,計算模型花費不再容易被過期費率誤導。當 usage 無法抓取線上最新價格時,會自動切換為內建的離線價目表作為備援;這份內建表格現在記錄了上次與官方核對的日期,並在啟用時主動於日誌留下警告訊息,讓你能一眼看出目前使用的是舊資料,而不是悄悄算錯累積費用。這好比銀行櫃檯的電子匯率看板斷線時,行員改拿出抽屜裡的紙本費率表,以前紙上沒寫列印日期容易算錯,現在紙面蓋有「最後核對日期」的大章並在單據記下備用註記,避免帳目在不知不覺中出現落差。

問題修復

Python 套件補齊所有模組,安裝不再因缺檔而報錯崩潰

透過 Python 套件管理工具安裝 usage,過去就像買到了裝箱清單只勾了一半零件的組裝家具材料包。先前打包設定的模組白名單只收錄了 74 個頂層模組中的 39 個,害使用者安裝後執行時,常因找不到其餘模組而跳出 ModuleNotFoundError 錯誤當機;現在打包清單已完整補齊全部 74 個模組,並新增了自動化測試來防止未來漏掉檔案。這如同材料包出廠清單已補齊所有配件,且出廠前一律經過自動掃描確認,買回家不再組裝到一半才發現缺了螺絲與木板。

English

FEATURE

Check quota directly via CLI for external terminal tools

If you want your Starship prompt or tmux status bar to show remaining AI quota, you no longer need to write custom Python scripts importing usage's internal modules. The new usage status command prints a concise one-line summary, and --json outputs a versioned JSON payload. Both read the same local files as the menu bar item, requiring zero network calls. Ready-made snippets in the development documentation make setup immediate. It is like a utility meter on a house: instead of calling a technician to disassemble the mechanical counter inside, a digital readout on the front now lets any display read current consumption without contacting the utility company.

FEATURE

Releases include build provenance and SBOM for verified security

When downloading release artifacts, you can now mathematically verify that your binaries were built directly from official source code. Every macOS and Windows release artifact now ships with a signed SLSA build-provenance attestation, verifiable in your terminal using the gh attestation verify <file> --repo aqua5230/usage command. In addition, the macOS release includes a CycloneDX software bill of materials (SBOM) detailing every bundled dependency. It is like buying packaged organic food: the box carries a certified supply-chain tracking seal proving the product was never swapped in transit, alongside a complete ingredient list that reveals every sub-component inside.

FEATURE

Offline price table tracks its check date and warns on fallback

When your network is down or upstream price lists cannot be reached, model cost calculations will no longer silently drift on outdated rates. When usage cannot fetch live pricing, it falls back to a built-in pricing table. That built-in table now records the exact date it was last synced against upstream and writes a warning to the log whenever it is engaged, making stale pricing immediately visible before it skews your cost totals. It is like an exchange counter whose electronic rate board goes dark: the teller pulls a printed rate sheet from the drawer, but the sheet now displays an inspection date stamp and a written notation is logged on the slip, ensuring no one calculates totals under the mistaken impression that prices are current.

BUGFIX

Python package includes all modules to stop ModuleNotFoundError crashes

Developers who install usage as a Python package will no longer hit instant crashes caused by missing files. Previously, the packaging allowlist included only 39 of the 74 top-level modules, causing installed copies to crash immediately with a ModuleNotFoundError. The packaging list now includes all 74 modules, and an automated regression test ensures no files are forgotten in future releases. It is like buying a boxed furniture kit whose packing checklist only listed half the necessary parts, leaving customers stranded mid-assembly without key screws or panels; the factory checklist now includes every single component, with a scanner verifying each box before shipment.

原始 CHANGELOG

Original changelog用指令快速查額度,終端機與狀態列隨調隨用
**`usage status` prints your quota for other tools to read.** Until now the only way to get quota out of usage was to import its internals from Python. `usage status` gives a one-line summary, `usage status --json` gives a versioned JSON payload, and both read the same local files as the menu bar — no network call. The [development docs](docs/DEVELOPMENT.md) include ready-made Starship and tmux snippets.
Original changelog附帶組建來源證明與物料清單,安裝檔來源透明可驗證
**Releases now ship build provenance and an SBOM.** Every macOS and Windows artifact carries a signed SLSA build-provenance attestation, verifiable with `gh attestation verify <file> --repo aqua5230/usage`, and the macOS release includes a CycloneDX software bill of materials listing every bundled dependency.
Original changelog離線價目表標註查核日期,啟用備援時主動發出警示
**The offline price table now says how old it is.** When the upstream price list can't be reached, usage falls back to a built-in table; that table now records the date it was last checked against upstream and logs a warning when it is used, so a silently outdated price can be spotted instead of quietly skewing your cost totals.
Original changelogPython 套件補齊所有模組,安裝不再因缺檔而報錯崩潰
**Installing usage as a Python package no longer leaves modules behind.** The packaging allowlist covered 39 of the 74 top-level modules, so an installed copy crashed with `ModuleNotFoundError`. The list is complete now and a test keeps it that way.