CodexBar 🎚️ — 愿你的 token 永不耗尽
英文标题:🔥 steipete/CodexBar
CodexBar 是一款轻量的 macOS 14+ 菜单栏应用,无需登录即可集中查看 OpenAI Codex、Claude Code 及 57 个 AI 编程服务的用量限额与重置倒计时。它复用现有的 OAuth、设备流程、API 密钥、浏览器 Cookie 等认证方式,不存储密码,并在菜单栏以独立图标或合并图标模式展示每个服务商的状态。应用同时提供 CLI 工具、成本扫描、事件告警和小组件,帮助开发者规划长时间任务、避免配额意外耗尽。
473.8 KB
299.0 KB
160.2 KB
121.4 KB
中文
CodexBar 🎚️ — 愿你的 token 永不耗尽
所有 AI 编码限制,尽在菜单栏。
一款适用于 macOS 14+ 的微型菜单栏应用,让你的 AI 编码服务商限额一目了然,并显示每个窗口的重置时间。支持 Codex、OpenAI、Claude、Cursor、Gemini、Copilot、Grok、GroqCloud、ElevenLabs、Deepgram、z.ai、MiniMax、Kiro、Zed、Vertex AI、Augment、OpenRouter、LiteLLM、LLM Proxy、Codebuff、Command Code、AWS Bedrock 以及许多新兴的编码服务商。每个服务商可显示一个状态项,也可使用合并图标模式搭配服务商切换器。无 Dock 图标,极简 UI,动态菜单栏图标。
- 围绕重置规划。 按服务商展示会话、每周和每月使用窗口,并显示下一次重置倒计时——不再犹豫是否开始一项长时间任务。
- 积分、花费和成本扫描。 展示积分余额、Admin API 支出仪表板、服务商账单摘要,以及在数据源提供足够信息时的本地成本扫描。
- 实时状态。 服务商状态轮询会在菜单中展示事件徽章,并在菜单栏图标上叠加指示器。
- 隐私优先。 复用现有的服务商会话——OAuth、设备流程、API 密钥、浏览器 Cookie、本地文件——因此不会存储密码。
下载:https://github.com/steipete/CodexBar/releases
brew install --cask codexbar
CLI 压缩包(macOS/Linux)
Homebrew 公式(现支持 Linux):
brew install steipete/tap/codexbar
Arch Linux AUR 包:
或从 GitHub Releases 下载发行版压缩包:
-
macOS:
CodexBarCLI-v<tag>-macos-arm64.tar.gz、CodexBarCLI-v<tag>-macos-x86_64.tar.gz -
Linux(glibc):
CodexBarCLI-v<tag>-linux-aarch64.tar.gz、CodexBarCLI-v<tag>-linux-x86_64.tar.gz -
Linux(静态 musl):
CodexBarCLI-v<tag>-linux-musl-aarch64.tar.gz、CodexBarCLI-v<tag>-linux-musl-x86_64.tar.gz -
打开“设置 → 服务商”并启用你使用的服务。
-
安装/登录你依赖的服务商源:CLI、浏览器会话、OAuth/设备流程、API 密钥、本地应用文件或根据服务商需求使用的服务商应用。
-
可选:“设置 → 服务商 → Codex → OpenAI cookies(自动或手动)”以添加仪表板额外信息。
通过 CLI 设置 API 密钥
服务商开关与 API 密钥保存在最终确定的 CodexBar 配置文件中。全新安装使用 ~/.config/codexbar/config.json;仍保留在 ~/.codexbar/config.json 的现有安装会继续从旧路径加载。你可以通过脚本操作与“设置 → 服务商”相同的服务商列表:
codexbar config providers
codexbar config enable --provider grok
codexbar config disable --provider cursor
对于基于 API 密钥的服务商,无需打开设置即可保存密钥:
printf '%s' "$ELEVENLABS_API_KEY" | codexbar config set-api-key --provider elevenlabs --stdin
set-api-key 会裁剪传入的值,并以严格的配置文件权限存储,同时默认启用该服务商。使用 --no-enable 仅保存密钥,或使用 --api-key <key> 用于一次性本地脚本(不担心命令历史记录)。完整流程见 CLI 配置。
- Codex — OAuth API 或本地 Codex CLI,以及可选的 OpenAI 网页仪表板额外信息。
- OpenAI — Admin API 密钥用量/费用图表,并包含旧版积分余额回退。
- Claude — OAuth API、浏览器 Cookie 或 CLI PTY 回退;在可用时展示会话和每周用量。
- Cursor — 浏览器会话 Cookie,展示计划 + 用量 + 账单重置。
- OpenCode — 浏览器 Cookie,展示工作区订阅用量。
- OpenCode Go — 浏览器或本地 SQLite 数据,展示 Go 用量窗口。
- Alibaba Coding Plan — 网页 Cookie 或 API 密钥,展示编码计划配额。
- Alibaba Token Plan — 百炼浏览器/手动 Cookie,展示 token 计划积分。
- Gemini — 使用 Gemini CLI 凭据的 OAuth 后端配额 API(无需浏览器 Cookie)。
- Antigravity — 本地语言服务器探测(实验性);无需外部认证。
- Droid — 浏览器 Cookie + WorkOS token 流程,展示 Factory 用量和账单。
- Copilot — GitHub 设备流程 + Copilot 内部用量 API。
- Devin — Chrome localStorage 会话或手动 Bearer token,展示每日和每周配额。
- z.ai — API 令牌,展示个人/团队配额、MCP、5 小时和每小时用量窗口。
- Manus — 浏览器
session_id认证,展示积分余额、每月积分和每日刷新追踪。 - MiniMax — API 令牌、cookie 头或浏览器 Cookie,展示编码计划用量。
- T3 Chat — 浏览器 Cookie 采集,展示 Base 和 Overage 用量桶。
- Kimi — 认证 token(来自
kimi-authcookie 的 JWT),展示每周配额和 5 小时速率限制。 - Kimi K2(非官方) — 旧版 API 密钥流程,展示基于积分的用量总和。
- Kilo — API 令牌,带 CLI 认证回退,展示 Kilo Pass 用量。
- Kiro — 基于 CLI 的用量;展示每月积分和奖励积分。
- Vertex AI — Google Cloud gcloud OAuth,结合本地 Claude 日志进行 token 成本追踪。
- Augment — Augment CLI 或浏览器 Cookie,展示积分追踪和用量监控。
- Amp — 基于浏览器 Cookie 的认证,展示 Amp Free 用量追踪。
- Ollama — API 密钥访问加浏览器 Cookie,展示 Ollama Cloud 用量窗口。
- JetBrains AI — 来自 JetBrains IDE 配置的本地 XML 配额;每月积分追踪。
- Warp — API 令牌,展示 GraphQL 请求限额和每月积分。
- ElevenLabs — API 密钥,展示字符积分和语音槽用量。
- OpenRouter — API 令牌,展示跨多个 AI 供应商的基于积分的用量追踪。
- Windsurf — 浏览器 localStorage 会话导入或本地 SQLite 缓存,展示计划用量。
- Zed — Zed 编辑器 Keychain 会话,展示计划、编辑预测配额、账单周期和逾期账单。
- Perplexity — 来自 Perplexity 用量数据的帐户用量积分。
- Xiaomi MiMo — 浏览器 Cookie,展示余额和 token 计划用量。
- Doubao — API 密钥,用于火山引擎 Ark 请求限制探测。
- Sakana AI — 手动 Cookie 头,展示 5 小时和每周配额窗口。
- Abacus AI — 浏览器 Cookie 认证,展示 ChatLLM/RouteLLM 计算积分追踪。
- Mistral — 浏览器 Cookie,展示 API 花费、积分余额和每月计划用量。
- DeepSeek — API 密钥,展示积分余额追踪(付费与赠送明细)。
- Moonshot / Kimi API — API 密钥,展示 Moonshot/Kimi API 账户余额追踪。
- Venice — API 密钥,展示 DIEM 或美元余额追踪。
- Codebuff — API 令牌(或
~/.config/manicode/credentials.json),展示积分余额 + 每周速率限制。 - Crof — API 密钥,展示美元积分余额和请求配额追踪。
- Command Code — 浏览器或手动 Cookie,展示每月美元积分(来自 Command Code 账单)。
- StepFun — 用户名 + 密码登录,展示 Step Plan 速率限制(5 小时 + 每周窗口)和订阅计划名称。
- AWS Bedrock — AWS 访问密钥或命名的 AWS 配置文件(通过 AWS CLI 使用 SSO/assume-role),展示 Cost Explorer 花费、月度预算和可选的 CloudWatch Claude 活动。
- Grok — Grok CLI 账单 RPC 加 grok.com 浏览器会话回退。
- GroqCloud — API 密钥,展示企业 Prometheus 请求/token/缓存命中指标。
- LLM Proxy — API 密钥 + 基础 URL,展示聚合代理配额统计和各服务商明细。
- ClawRouter — API 密钥,展示每月预算、花费、请求、token 和路由后的服务商用量。
- LiteLLM — 虚拟密钥 + 代理 URL,展示个人和团队预算/花费追踪。
- Deepgram — API 密钥用量摘要,涵盖语音、Agent、token 和 TTS 指标。
- Poe — API 密钥,展示当前积分余额和近期积分历史。
- Chutes — API 密钥,展示订阅用量、滚动和每月配额窗口以及按量付费配额。
- 对新服务商开放:服务商创作指南。
菜单栏图标是一个微型用量计量器。图标含义因服务商而异,错误/过时数据会使图标变暗或显示事件指示器。
- 多服务商菜单栏,可按服务商单独开关(设置 → 服务商)。
- 针对不同服务商的用量计量器及重置倒计时。
- 可选 Codex 网页仪表板增强(剩余代码审查、用量明细、积分历史)。
- 基于 API 的服务商(如 OpenAI、Claude Admin API、OpenRouter、LiteLLM、z.ai、MiniMax、Mistral 和 AWS Bedrock)提供内联花费和用量图表。
- 可配置的 Codex + Claude 成本用量扫描,以及复用图表界面展示支持的服务商历史记录。
- 服务商状态轮询,在菜单中显示事件徽章并在图标上叠加指示器。
- 合并图标模式,可将多个服务商合并为一个状态项 + 切换器。
- 显示控制:可调整服务商图标、标签、计量器、重置时间样式和最高用量自动选择。
- 刷新频率预设(手动、1 分钟、2 分钟、5 分钟、15 分钟)。
- 内建 CLI(
codexbar),用于脚本和 CI(包括codexbar cost --provider codex、claude或both查看本地成本用量);提供 macOS 和 Linux CLI 构建。 - 针对支持的服务商的 WidgetKit 小组件。
- 本地化的应用与网站,共享 21 种语言目录,自动网站语言检测,持久化语言选择器及 RTL 支持。
- 可选会话配额通知和每周重置彩蛋效果。
- 隐私优先:默认在设备上解析;浏览器 Cookie 为可选加入并复用(不存储密码)。
想知道 CodexBar 是否会扫描你的磁盘?它不会遍历你的文件系统;仅在启用相关功能时读取少量已知位置(浏览器 Cookie/本地存储、服务商配置文件、本地 JSONL 日志)。服务商令牌和令牌帐号信息仅保存在本地配置文件中。
English / 原文
CodexBar 🎚️ — May your tokens never run out.
Every AI coding limit, in your menu bar.
Tiny macOS 14+ menu bar app that keeps AI coding-provider limits visible and shows when each window resets. Codex, OpenAI, Claude, Cursor, Gemini, Copilot, Grok, GroqCloud, ElevenLabs, Deepgram, z.ai, MiniMax, Kiro, Zed, Vertex AI, Augment, OpenRouter, LiteLLM, LLM Proxy, Codebuff, Command Code, AWS Bedrock, and many newer coding providers. One status item per provider, or Merge Icons mode with a provider switcher. No Dock icon, minimal UI, dynamic bar icons.
- Plan around resets. Per-provider session, weekly, and monthly windows with countdowns to the next reset — stop guessing whether to start that long task.
- Credits, spend, and cost scans. Credit balances, Admin API spend dashboards, provider billing summaries, and local cost scans where the source exposes enough detail.
- Live status. Provider status polling surfaces incident badges in the menu and an indicator overlay on the bar icon.
- Privacy-first. Reuses existing provider sessions — OAuth, device flow, API keys, browser cookies, local files — so no passwords are stored.
Download: https://github.com/steipete/CodexBar/releases
brew install --cask codexbar
CLI Tarballs (macOS/Linux)
Homebrew formula (Linux today):
brew install steipete/tap/codexbar
Arch Linux AUR package:
Or download release tarballs from GitHub Releases:
-
macOS:
CodexBarCLI-v<tag>-macos-arm64.tar.gz,CodexBarCLI-v<tag>-macos-x86_64.tar.gz -
Linux (glibc):
CodexBarCLI-v<tag>-linux-aarch64.tar.gz,CodexBarCLI-v<tag>-linux-x86_64.tar.gz -
Linux (static musl):
CodexBarCLI-v<tag>-linux-musl-aarch64.tar.gz,CodexBarCLI-v<tag>-linux-musl-x86_64.tar.gz -
Open Settings → Providers and enable what you use.
-
Install/sign in to the provider sources you rely on: CLIs, browser sessions, OAuth/device flow, API keys, local app files, or provider apps depending on the provider.
-
Optional: Settings → Providers → Codex → OpenAI cookies (Automatic or Manual) to add dashboard extras.
Set API keys from the CLI
Provider toggles and API keys live in the resolved CodexBar config file. New installs use ~/.config/codexbar/config.json; existing ~/.codexbar/config.json installs still load from the legacy path. You can script the same provider list that Settings → Providers uses:
codexbar config providers
codexbar config enable --provider grok
codexbar config disable --provider cursor
For API-key providers, store a key without opening Settings:
printf '%s' "$ELEVENLABS_API_KEY" | codexbar config set-api-key --provider elevenlabs --stdin
set-api-key trims the piped value, stores it with restrictive config-file permissions, and enables the provider by default. Use --no-enable to only save the key, or --api-key <key> for one-off local scripts where shell history is not a concern. See CLI configuration for the full flow.
- Codex — OAuth API or local Codex CLI, plus optional OpenAI web dashboard extras.
- OpenAI — Admin API key usage/cost graphs with legacy credit-balance fallback.
- Claude — OAuth API, browser cookies, or CLI PTY fallback; session and weekly usage where available.
- Cursor — Browser session cookies for plan + usage + billing resets.
- OpenCode — Browser cookies for workspace subscription usage.
- OpenCode Go — Browser or local SQLite data for Go usage windows.
- Alibaba Coding Plan — Web cookies or API key for coding-plan quotas.
- Alibaba Token Plan — Bailian browser/manual cookies for token-plan credits.
- Gemini — OAuth-backed quota API using Gemini CLI credentials (no browser cookies).
- Antigravity — Local language server probe (experimental); no external auth.
- Droid — Browser cookies + WorkOS token flows for Factory usage + billing.
- Copilot — GitHub device flow + Copilot internal usage API.
- Devin — Chrome localStorage session or manual Bearer token for daily and weekly quotas.
- z.ai — API token for personal/team quota, MCP, 5-hour, and hourly usage windows.
- Manus — Browser
session_idauth for credit balance, monthly credits, and daily refresh tracking. - MiniMax — API token, cookie header, or browser cookies for coding-plan usage.
- T3 Chat — Browser cookies capture for Base and Overage usage buckets.
- Kimi — Auth token (JWT from
kimi-authcookie) for weekly quota + 5‑hour rate limit. - Kimi K2 (unofficial) — Legacy API key flow for credit-based usage totals.
- Kilo — API token with CLI-auth fallback for Kilo Pass usage.
- Kiro — CLI-based usage; monthly credits + bonus credits.
- Vertex AI — Google Cloud gcloud OAuth with token cost tracking from local Claude logs.
- Augment — Augment CLI or browser cookies for credits tracking and usage monitoring.
- Amp — Browser cookie-based authentication with Amp Free usage tracking.
- Ollama — API key access plus browser cookies for Ollama Cloud usage windows.
- JetBrains AI — Local XML-based quota from JetBrains IDE configuration; monthly credits tracking.
- Warp — API token for GraphQL request limits and monthly credits.
- ElevenLabs — API key for character credits and voice slot usage.
- OpenRouter — API token for credit-based usage tracking across multiple AI providers.
- Windsurf — Browser localStorage session import or local SQLite cache for plan usage.
- Zed — Zed editor Keychain session for plan, edit-prediction quota, billing cycle, and overdue invoices.
- Perplexity — Account usage credits from Perplexity usage data.
- Xiaomi MiMo — Browser cookies for balance and token-plan usage.
- Doubao — API key for Volcengine Ark request-limit probes.
- Sakana AI — Manual Cookie header for 5-hour and weekly quota windows.
- Abacus AI — Browser cookie auth for ChatLLM/RouteLLM compute credit tracking.
- Mistral — Browser cookies for API spend, credit balance, and monthly-plan usage.
- DeepSeek — API key for credit balance tracking (paid vs. granted breakdown).
- Moonshot / Kimi API — API key for Moonshot/Kimi API account balance tracking.
- Venice — API key for DIEM or USD balance tracking.
- Codebuff — API token (or
~/.config/manicode/credentials.json) for credit balance + weekly rate limit. - Crof — API key for dollar credit balance and request quota tracking.
- Command Code — Browser or manual cookies for monthly USD credits from Command Code billing.
- StepFun — Username + password login for Step Plan rate limits (5‑hour + weekly windows) and subscription plan name.
- AWS Bedrock — AWS access keys or a named AWS profile (SSO/assume-role via the AWS CLI) for Cost Explorer spend, monthly budgets, and optional CloudWatch Claude activity.
- Grok — Grok CLI billing RPC plus grok.com browser-session fallback.
- GroqCloud — API key for Enterprise Prometheus request/token/cache-hit metrics.
- LLM Proxy — API key + base URL for aggregate proxy quota stats and provider breakdowns.
- ClawRouter — API key for monthly budget, spend, requests, tokens, and routed-provider usage.
- LiteLLM — Virtual key + proxy URL for personal and team budget/spend tracking.
- Deepgram — API key usage summaries across speech, agent, token, and TTS metrics.
- Poe — API key for current point balance and recent points history.
- Chutes — API key for subscription usage, rolling and monthly quota windows, and pay-as-you-go quotas.
- Open to new providers: provider authoring guide.
The menu bar icon is a tiny usage meter. Bar meaning is provider-specific, and errors/stale data can dim the icon or show an incident indicator.
- Multi-provider menu bar with per-provider toggles (Settings → Providers).
- Provider-specific usage meters with reset countdowns.
- Optional Codex web dashboard enrichments (code review remaining, usage breakdown, credits history).
- Inline spend and usage charts for API-backed providers such as OpenAI, Claude Admin API, OpenRouter, LiteLLM, z.ai, MiniMax, Mistral, and AWS Bedrock.
- Configurable cost-usage scans for Codex + Claude, plus reused chart UI for supported provider histories.
- Provider status polling with incident badges in the menu and icon overlay.
- Merge Icons mode to combine providers into one status item + switcher.
- Display controls for provider icons, labels, bars, reset-time style, and highest-usage auto-selection.
- Refresh cadence presets (manual, 1m, 2m, 5m, 15m).
- Bundled CLI (
codexbar) for scripts and CI (includingcodexbar cost --provider codex,claude, orbothfor local cost usage); macOS and Linux CLI builds available. - WidgetKit widgets for supported providers.
- Localized app and website with a shared 21-language catalog, automatic website detection, persistent pickers, and RTL support.
- Optional session quota notifications and weekly-reset confetti.
- Privacy-first: on-device parsing by default; browser cookies are opt-in and reused (no passwords stored).
Wondering if CodexBar scans your disk? It doesn’t crawl your filesystem; it reads a small set of known locations (browser cookies/local storage, provider config files, local JSONL logs) when the related features are enabled. Provider tokens and token-account settings live in the CodexBar config file with restrictive file permissions. See the discussion and audit notes in issue #12.
macOS permissions (why they’re needed)
-
Full Disk Access (optional) : only required to read Safari cookies/local storage for web-based providers. If you don’t grant it, use another supported browser, manual cookies/API keys, OAuth, or CLI/local sources where that provider supports them.
-
Keychain access (prompted by macOS) :
- Chromium cookie import needs the browser “Safe Storage” key to decrypt cookies.
- Claude OAuth bootstrap may read the Claude CLI Keychain item when CodexBar has no usable cached credentials.
- CodexBar may use Keychain for browser cookie decryption, cached cookie headers, and OAuth/device-flow credentials where those sources require it.
- How do I prevent those keychain alerts?
- Open Keychain Access.app → login keychain → search the prompted item (for Claude OAuth, usually “Claude Code-credentials”).
- Open the item → Access Control → add
CodexBar.appunder “Always allow access by these applications”. - Prefer adding just CodexBar (avoid “Allow all applications” unless you want it wide open).
- Relaunch CodexBar after saving.
- Reference screenshot:

- How to do the same for the browser?
- Find the browser’s “Safe Storage” key (e.g., “Chrome Safe Storage”, “Brave Safe Storage”, “Microsoft Edge Safe Storage”).
- Open the item → Access Control → add
CodexBar.appunder “Always allow access by these applications”. - This removes the prompt when CodexBar decrypts cookies for that browser.
- Last resort — stop all Keychain reads entirely : if "Always Allow" doesn't stick (e.g., macOS resets the ACL after a Chromium update or a
partition_idreset), open CodexBar → Settings → Advanced → Keychain access and enable Disable Keychain access. CodexBar will no longer touch the Keychain. Browser-cookie-based providers will be skipped, but Claude/Codex OAuth via the CLI still works (it reads~/.codex/~/.claudeconfig files, not the Keychain). - Prompt after uninstall? Deleting the app prevents a new launch from that bundle, but an already-running CodexBar process can keep requesting Keychain access until it quits. Check for that process, a Login Item, another installed copy, or a prompt that names a different requesting binary/path. See Keychain prompt troubleshooting for safe checks and what to include in a support report without sharing secrets.
-
Files & Folders prompts (folder/volume access): CodexBar launches provider CLIs and local probes for some providers. If those helpers read a project directory or external drive, macOS may ask CodexBar for that folder/volume (e.g., Desktop or an external volume). This is driven by the helper’s working directory, not background disk scanning.
-
What we do not request in the background : no Screen Recording or Accessibility permissions; user-triggered helper actions may ask macOS for Automation permission to open Terminal. No passwords are stored (browser cookies are reused when you opt in).
-
Clone the repo and open it in Xcode or run the scripts directly.
-
Launch once, then toggle providers in Settings → Providers.
-
Install/sign in to provider sources you rely on (CLIs, browser cookies, OAuth/device flow, API keys, or local app/config files).
-
Optional: set OpenAI cookies (Automatic or Manual) for Codex dashboard extras.
Requires macOS 14+ and Swift 6.2+.
./Scripts/package_app.sh # builds CodexBar.app in-place with ad-hoc signing
open CodexBar.app
Dev loop:
./Scripts/compile_and_run.sh
./Scripts/compile_and_run.sh --test # also run the sharded test suite before packaging/relaunching
make check # SwiftFormat + SwiftLint
make docs-list # list docs with frontmatter summaries
CLI install:
# after installing CodexBar.app in /Applications
./bin/install-codexbar-cli.sh
- ✂️ Trimmy — “Paste once, run once.” Flatten multi-line shell snippets so they paste and run.
- 🧳 MCPorter — TypeScript toolkit + CLI for Model Context Protocol servers.
- 🧿 oracle — Ask the oracle when you're stuck. Invoke GPT-5 Pro with a custom context and files.
Looking for a Windows version?
Linux desktop integration?
- codexbar-waybar — Waybar custom module + GTK4 popover for Hyprland / Sway / other Wayland compositors, built on top of the bundled Linux CLI.
- Codexbar GNOME — GNOME Shell extension that brings CodexBar usage into the desktop panel.
- noctalia-codex-usage — Noctalia/Quickshell plugin that shows Codex 5-hour and weekly usage limits, built on top of the bundled Linux CLI.
- KodexBar — KDE Plasma widget that shows CodexBar usage in the Plasma panel, built on top of the bundled Linux CLI.
Status bar & terminal integration
- showy-quota — always-on AI plan quota strips for SketchyBar, tmux, and Zellij (standalone WASM plugin), built on
codexbar serve/ the bundled CLI.
Inspired by ccusage (MIT), specifically the cost usage tracking.
MIT • Peter Steinberger (steipete)

