usage

usage 0.30.2

工具與目錄
在這頁

新功能 6 項

01

Codex 狀態列支援點記法設定,安裝與移除不再靜默失敗

在 Codex 設定檔 config.toml 未使用獨立 [tui] 區段標頭時,安裝與移除狀態列(status line,終端機最底下的即時資訊列)的功能現在能正確運作。以前若設定檔僅透過 [tui.*] 子表格或頂層點記法鍵值宣告,設定與解除流程會靜默跳過寫入卻回報成功。現在 _insert_table_line()、_remove_table_line() 與 _replace_table_line() 同時支援這兩種結構,每次修改皆透過 tomllib.loads 驗證語法,並在無法安全變更時明確回報失敗。⟦這好比水電師傅查驗配電箱:不論總標籤寫在總開關還是分路子面板上都能正確接線,送電前以電表驗證,無法安全施工時便明確告知而非假裝完工。⟧

官方原文

**Codex status lines now install and remove correctly when config.toml has no bare [tui] header.** Configurations that declare tui only through [tui.*] subtables or top-level dotted keys previously made the setup and unsetup paths silently write nothing while reporting success. _insert_table_line(), _remove_table_line(), and _replace_table_line() now handle both forms, validate every candidate with tomllib.loads, and report failure when no change can be safely made.

02

Windows 建置校正隱藏匯入路徑,清除無效模組設定

Windows 建置腳本修復了打包設定中的過期模組路徑。先前 v0.29.37 修復了遺漏的 wintray.app 與 tui.app 進入點;但在獨立重構後,scripts/build_windows.ps1 仍將 session_hooks 與 setup_hook 列為舊版頂層模組。雖然 main.py 靜態匯入了兩者而未影響執行檔運作,但這些旗標屬於無效設定,正是過去導致 v0.29.34 至 v0.29.36 版無法啟動的同類隱患。現在旗標已更正為 installer.session_hooks 與 installer.setup_hook,讓 PyInstaller 未來能及早診斷遺漏。⟦宛如物流清單上的備忘地址:將舊門牌更新為正確路徑,才能在未來漏載時第一時間示警。⟧

官方原文

**Windows builds now point their hidden imports at the installer modules' current paths.** The v0.29.37 fix restored the missing wintray.app and tui.app entry points; after a separate refactor, scripts/build_windows.ps1 still named session_hooks and setup_hook as obsolete top-level modules. The bundle was never broken — main.py imports both statically — but the flags were dead configuration of exactly the kind that shipped the unusable v0.29.34–36 builds. They now name installer.session_hooks and installer.setup_hook, so PyInstaller can diagnose a future omission.

03

Claude 費用納入顧問迭代與 1 小時快取,歷史紀錄重算更精準

查看 Claude 的花費總額時,現在已完整納入顧問迭代與 1 小時快取寫入費用。解析器新增讀取 usage.iterations 與 usage.cache_creation.ephemeral_1h_input_tokens 欄位;其中僅有 advisor_message 迭代會拆分為獨立資料列,避免重複計算普通訊息。1 小時快取(cache,將資料暫存以加速讀取的機制)寫入則依基礎輸入費率的 2 倍計價,且歷史快取架構版本已同步更新,讓過往既有紀錄能自動重算。⟦這如同會計事務所升級審計帳本:把特別顧問的諮詢與專用保鮮費列入報銷,依雙倍費率計價並重審舊單據,避免多算也絕不漏計。⟧

官方原文

**Claude cost totals now include advisor iterations and one-hour cache writes.** The Claude parsers now read usage.iterations and usage.cache_creation.ephemeral_1h_input_tokens; only advisor_message iterations get separate entries, avoiding double-counting ordinary messages. One-hour cache writes are priced at twice the base input rate, and the history cache schema is bumped so existing entries are reparsed.

04

指南移至專屬目錄且整理說明文件,專案根目錄全面整潔

⟦像圖書館整頓大廳:將讀者規約歸檔至管理處,把各語系導覽手冊移入閱覽室,讓大廳井然有序且指示牌一目了然。⟧ 專案根目錄進行了結構整理與檔案搬移。公開的貢獻指南與安全政策文件已移至 .github/ 資料夾。各語言版本的說明文件(README,專案首頁介紹檔)與更新日誌 changelog 則統一集中至 docs/ 目錄。這項整理清空了專案根目錄的雜亂檔案,並同步更新了所有相互參照的超連結。

官方原文

Moved public contribution and security guides to .github/ and localized README and changelog files to docs/, cleaning up the repository root and updating all links.

05

簡中日韓說明文件補齊 Grok 介紹,功能清單與比較表全面同步

查閱非英文的專案說明文件時,各語言讀者現在都能獲得完整的 Grok CLI 功能介紹。先前在簡體中文、日文與韓文的說明文件(README,專案首頁介紹檔)中,遺漏了 Grok CLI 卡片於功能清單、「隱藏區塊」設定項目以及跨工具比較表中的資料列。本次更新將這三處缺漏逐一回填至三種語言的說明文件中。⟦這恰似多國語言的商品目錄改版:為簡中、日語及韓語版本補印新產品的特色條目、選配開關與規格比較表,使所有語系的型錄內容完全同步。⟧

官方原文

Backfilled the Grok CLI card into the Simplified Chinese, Japanese and Korean READMEs, which had missed the feature list entry, the Hide Sections list and the comparison-table row.

06

升級 PyObjC 與 ruff 工具,單次鎖定檔結案五項相依更新

專案相依套件與程式碼檢查工具進行了例行升級。本次將 macOS 系統橋接套件 PyObjC 升級至 12.2.2,並將靜態檢查工具 ruff 更新至 0.16.4。這項調整在單次鎖定檔(lockfile,記錄精確套件版本的設定檔)變更中,一次結案了先前分別提出的 5 項相依套件更新提案。⟦這宛若工廠保養時彙整五張零件更換單,統一升級操作面板元件與校準測量尺,一次鎖定新版規格而無須分批停機。⟧

官方原文

Bumped PyObjC to 12.2.2 and ruff to 0.16.4, closing five separately raised dependency updates in a single lockfile change.

修正 3 項

07

過高面板自動等比縮放,畫面完整呈現不被截斷

⟦像用相機拍攝高聳建築時自動切換廣角,把整棟大樓等比縮進觀景窗,而不是直接裁掉屋頂。⟧ 當螢幕直向空間不足而面板(popover)內容過長時,視窗現在會等比縮小而非裁切畫面。過去 clamp_content_height() 直接以可見畫面高度為上限,超出高度的資料列完全無法看見也點不到。新模組 panels/panel_scale.py 會計算適應螢幕的縮放比例,且不低於保底的 MIN_PANEL_SCALE;macOS 的 PopoverViewController.applyPanelScale() 與 Windows 的 _WindowsTrayController._apply_panel_zoom() 則透過 window.usageApplyPanelZoom() 將比例套用至整個面板,原本超出高度、捲不到的列也看得到了。

官方原文

**Panels that are too tall for the screen now scale down instead of clipping.** clamp_content_height() used the visible frame as its ceiling, leaving rows beyond that height unreachable. panels/panel_scale.py now calculates a fit scale, no lower than MIN_PANEL_SCALE, and macOS's PopoverViewController.applyPanelScale() and Windows's _WindowsTrayController._apply_panel_zoom() apply it to the whole panel through window.usageApplyPanelZoom().

08

macOS 雙擊啟動改用萬國碼讀取,切換開機項目不再崩潰

⟦就像快遞員開箱驗貨:以前若沒人提醒語言就預設只認純英文字母,遇上外文標籤便當場罷工;現在一律配備萬國碼字典,遇到損壞字元自動替換並繼續派送。⟧ 在 macOS 上透過滑鼠連點開啟 App 時,切換開機啟動項目不再無預警失敗。雙擊啟動時環境中常缺少 LANG 變數,導致子行程(subprocess,由主程式分支出來處理特定任務的背景程序)呼叫 subprocess.run(..., text=True) 時預設採用 ASCII 編碼,讀取 launchctl 或 gh 產生的非 ASCII 文字時會拋出 UnicodeDecodeError 錯誤。現在這些讀取動作一律明確指定使用 UTF-8 編碼,並對無效位元組進行容錯替換。

官方原文

**Toggling the macOS login item no longer fails when the app was opened by double-clicking.** Without LANG, subprocess.run(..., text=True) used ASCII and could raise UnicodeDecodeError while reading launchctl or gh output containing non-ASCII text. Those reads now explicitly use UTF-8 with replacement for invalid bytes.

09

Windows 系統匣拖曳 Grok 卡片修正,視窗移動行為全數統一

在 Windows 系統匣(tray,工作列右下角常駐圖示區)拖曳 Grok 額度卡片時,視窗移動行為不再與其他三家卡片不同步。系統匣的 WebKit 墊片原先會將額度卡片的空白區域轉為 pywebview 原生拖曳區,但其選取器過去僅列出 Claude、Codex 與 Antigravity。這導致 Grok 卡片掉入共用的卡片排序處理器,在第四張卡片上做出與前三張相同的拖曳手勢時卻引發不同反應。現在選取器已涵蓋全部四家服務商,與 macOS 上的 panel_core.js 保持一致。⟦如同控制台上的四組手把:前三組能平移整座台面,第四組因未貼標籤而只能移動自身;補齊設定後,四組操作手感完全一致。⟧

官方原文

**Dragging the Grok card no longer moves the panel differently from the other three on Windows.** The tray's WebKit shim turns a quota card's empty area into a native pywebview drag region, but its selector listed only Claude, Codex and Antigravity. Grok fell through to the shared card-reorder handler instead, so the same gesture that moved the window from the first three cards did something else from the fourth. The selector now matches all four, as panel_core.js already did on macOS.