Skip to main content
Glama
codex-quota

codex-quota

by YangCazz

CazzTools

English · CI

Codex 用量是面向 Codex 桌面端的侧栏插件。外侧圆环显示各额度窗口的剩余百分比,较长的周期在外圈。中央数字显示可用重置次数。最早的重置机会临近到期时,中央边环逐渐变暗。

完整面板显示用量来源、积分余额、各额度窗口的消耗和剩余额度、自动重置时间与倒计时,以及可用重置次数与最早到期时间。

Codex 用量的收起和展开状态,使用示例用量数据

从源码安装

需要 Git、Node.js 22 或更高版本、npm,以及支持 MCP 应用侧栏的 Codex 桌面端。请先用 ChatGPT 账号登录本机 Codex CLI,可运行 codex login status 检查登录状态。桌面端运行插件时也需要能找到 node。

git clone https://github.com/YangCazz/CazzTools.git
cd CazzTools
npm ci
npm run build
codex plugin marketplace add .
codex plugin add codex-quota@cazztools

也可在添加插件目录后打开 Codex 桌面端,在插件目录 CazzTools 中安装 Codex 用量。安装后重新打开桌面端加载入口。

Related MCP server: codex-reset

打开面板

  • 左侧快捷栏。点击最左侧窄栏的 ⋯ 打开应用列表,在 Codex 用量 这一行点图钉置顶。部分版本将该列表显示为 探索(Explore) 或 Your stuff。置顶后可点击快捷栏中段的插件图标,直接打开完整面板。拖动图标可在置顶组内调整顺序。原生用量按钮所在的底部区域由 Codex 桌面端管理,插件接口没有提供底部位置选项。

  • 会话侧栏。在本地会话右侧栏选择 + → 更多工具 → 插件和 MCP → Codex 用量,再点击圆环展开详情。

面板可见时约每分钟刷新一次,也可点击 刷新。管理用量会打开 OpenAI 的 Codex 用量设置。

微软商店版 Codex 内嵌圆环

在 Windows 10 或 11 上,使用 Node.js 22 或更新版本,在仓库目录运行 npm ci 和 npm run build。双击 windows/Install-Embedded.cmd 后,桌面和开始菜单会出现 Codex + CazzTools。第一次使用时请完全退出 Codex,再从该快捷方式启动。之后用它打开 Codex,数字圆环会自动出现在左下原生用量按钮的正上方。点圆环可以展开或收起完整详情,原生用量按钮也可照常使用。

如果希望快捷方式显示为 Codex 并使用本机商店版图标,可以在 PowerShell 中从仓库目录运行 powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File .\windows\Start-Embedded.ps1 -Action Install -UseCodexAppearance。在资源管理器中右键快捷方式,选择 显示更多选项 → 固定到任务栏,然后拖到需要的位置。通过已固定的快捷方式启动后,内嵌窗口会采用同一个任务栏分组标识,用这个按钮也可以切回窗口。已有的 CazzTools 固定项可直接沿用。Windows 任务栏操作

该启动入口通过子进程的私有调试管道连接桌面渲染器。圆环依赖当前 Codex 的导航栏结构。以原图标启动,或当前版本无法挂载时,可使用下面的窗口浮层。更新 CazzTools 后请重新执行 npm run build,再完全退出并从新入口打开。卸载时在仓库目录运行 powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File .\windows\Start-Embedded.ps1 -Action Remove,可移除这个项目创建的快捷方式。

Windows 窗口浮层

在 Windows 10 或 11 上,首次双击仓库里的 windows/Start-Overlay.cmd 启动浮层,再右键圆环,勾选 登录 Windows 后自动启动。之后登录 Windows 时,浮层会在后台启动,切到 Codex 窗口时便会显示。浮层使用已有的 Node.js 和 Codex 登录。

数字圆环默认对齐在窗口左下原生用量按钮的正上方,跟随前台 Codex 窗口移动。切换应用或最小化时隐藏,点击圆环可展开或收起详情。按住 Shift 拖动可以微调位置,右键可 恢复默认位置。已保存的位置仍然生效,路径是 %LOCALAPPDATA%\CazzTools\QuotaOverlay\position.json。

右键圆环可关闭自动启动。如需移除浮层,先取消勾选 登录 Windows 后自动启动,再选 退出浮层。如果要移动仓库,先退出浮层,移动后从新目录启动并重新勾选,即可更新启动路径。

更新和卸载

在原来的仓库目录更新源码并重新安装,随后重新打开桌面端。

git pull --ff-only
npm ci
npm run build
codex plugin add codex-quota@cazztools

卸载时运行 codex plugin remove codex-quota@cazztools。如果也想移除本地 CazzTools 插件目录,再运行 codex plugin marketplace remove cazztools。

数据来源与隐私

插件通过本机 Codex App Server 的 account/rateLimits/read 只读查询用量。认证和用量服务请求由 Codex 使用本机的 ChatGPT 登录状态完成。插件通过本地标准输入输出接收用量字段,再将它们传给桌面面板展示。重置额度等账号操作在官方用量设置页完成。Codex App Server 额度协议

额度窗口按接口返回的百分比显示。未返回的字段显示为「未提供」或 —,返回的零积分和零次重置会明确显示。时间按桌面端的本地时区显示。刷新失败时,如果已经读取过数据,面板会保留上次结果并标明状态。

常见问题

  • 找不到入口。先检查最左侧窄栏的 ⋯,再运行 codex plugin list 确认插件已启用。支持 MCP 应用全局入口的桌面版本也可以用 codex://plugins/codex-quota@cazztools/app/open_codex_quota_sidebar 直达面板。会话右侧栏也提供入口。MCP 应用入口规范

  • 找不到 Codex CLI。把 Codex 加入桌面端继承的 PATH,或把环境变量 CODEX_QUOTA_EXECUTABLE 设为 Codex 可执行文件的绝对路径。Windows 使用 codex.exe。更改后重新打开桌面端。

  • 提示登录或连接失败。运行 codex login status 检查本机的 ChatGPT 登录状态。如需重新登录,运行 codex login。确认网络可用后,在面板内重试。

参与项目

贡献指南 · 更新记录 · 安全报告 · MIT 许可证

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      Provides real-time visibility into Claude Pro and Max subscription usage limits directly within Claude Code by utilizing local OAuth tokens. It enables users to monitor session and weekly usage across different models and receive alerts regarding rate-limiting status.
      4
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying forecasts of OpenAI Codex usage-limit resets, verified reset timelines, and current Codex service status through natural language, with no API key required.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Lets an AI agent check its own Claude and Codex usage limits — used percentages and exact reset times for session and weekly windows — so it can plan long-running work around resets instead of dying mid-task. It reads local, credential-free sources by default, always reports which source answered, and ships a hook that pushes quota state into context automatically.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables local monitoring of Codex token usage, prompt-cache reuse and estimated credits by reading existing session logs and exposing an embedded dashboard plus tools for whole-chat, latest-call and latest-prompt readings and call history. All collection and refresh stay local on-device, requiring no model calls, API key or hosted backend.
      5
      MIT