@@ -11,6 +11,8 @@ A lightweight **Windows desktop floating widget** for monitoring Codex usage.
1111 Shows usage for both 5-hour and 7-day windows (used/remaining).
1212- 每 60 秒自动刷新
1313 Auto-refreshes every 60 seconds.
14+ - 后台刷新,不因网络请求卡住悬浮窗
15+ Refreshes in the background so the widget UI stays responsive.
1416- 支持透明度调节(20%~ 100%)
1517 Adjustable opacity (20%~ 100%).
1618- 支持图层切换(始终置顶 / 普通层级)
@@ -21,6 +23,10 @@ A lightweight **Windows desktop floating widget** for monitoring Codex usage.
2123 Game mode (auto full-screen detection + manual force show/hide, manual override has priority).
2224- 网络异常时使用本地缓存数据显示
2325 Falls back to cached data when network requests fail.
26+ - 配置与缓存保存到用户 AppData,不污染项目目录
27+ Stores generated config/cache under the user's AppData folder.
28+ - token 刷新写回前会备份并原子写入认证文件
29+ Backs up and atomically writes auth files when refreshing tokens.
2430
2531---
2632
@@ -33,9 +39,11 @@ A lightweight **Windows desktop floating widget** for monitoring Codex usage.
3339- ` 启动Codex用量桌显.bat ` :一键启动入口(Windows)
3440 One-click launcher on Windows.
3541- ` widget_config.json ` :界面配置(自动生成)
36- UI config file (auto-generated).
42+ UI config file (auto-generated, stored in ` %LOCALAPPDATA%\CodexUsageWidget ` ).
3743- ` last_usage.json ` :最近一次成功数据缓存(自动生成)
38- Last successful usage cache (auto-generated).
44+ Last successful usage cache (auto-generated, stored in ` %LOCALAPPDATA%\CodexUsageWidget ` ).
45+ - ` tests/ ` :核心 Python 逻辑的轻量测试
46+ Lightweight tests for the Python usage parser/cache behavior.
3947
4048---
4149
@@ -63,12 +71,42 @@ A lightweight **Windows desktop floating widget** for monitoring Codex usage.
6371
6472---
6573
74+ ## 开发与验证 / Development
75+
76+ 运行完整检查:
77+
78+ ``` powershell
79+ .\scripts\check.ps1
80+ ```
81+
82+ 构建便携 zip 包:
83+
84+ ``` powershell
85+ .\scripts\build_release.ps1
86+ ```
87+
88+ 如果想把 Python 抓取脚本打成单文件 exe,一起放入 release 包:
89+
90+ ``` powershell
91+ .\scripts\build_release.ps1 -InstallPyInstaller
92+ ```
93+
94+ 生成的 zip 位于 ` dist\CodexUsageWidget-<version>.zip ` 。如果包内存在 ` tools\codex_usage_fetch.exe ` ,小组件会优先使用它;否则会回退到本机 Python。
95+
96+ CI 会在 GitHub Actions 上运行 ` scripts/check.ps1 ` 。推送 ` v* ` tag 时会自动构建 zip 并发布到 GitHub Releases。
97+
98+ ---
99+
66100## 说明 / Notes
67101
102+ - 本项目依赖 ChatGPT/Codex 的本地认证文件与非公开 usage 接口;这些结构可能随官方客户端更新而变化。
103+ This project depends on local ChatGPT/Codex auth files and non-public usage endpoints, so it may need updates when the official client changes.
68104- 本项目读取本机已有认证文件,不需要在代码里硬编码 token。
69105 This project uses local existing auth files and does not require hardcoding tokens in code.
70106- 建议不要提交个人认证文件到仓库。
71107 Do not commit personal auth credentials to the repository.
108+ - 如果 access token 过期,脚本会使用 refresh token 刷新,并在写回认证文件前创建 ` .bak ` 备份。
109+ When the access token expires, the script refreshes it and creates a ` .bak ` backup before writing the auth file.
72110
73111---
74112
0 commit comments