CodexBar README

项目的 README,来自 github.com/steipete/CodexBar。合并为一个 markdown 文件:README.md。

CodexBar 🎚️ — May your tokens never run out.

Every AI coding limit, in your menu bar.

Latest release macOS 14+ Linux desktop Homebrew AUR License: MIT Site

CodexBar — every AI coding limit in your menu bar. 115 providers.

Tiny macOS 14+ menu bar app that keeps AI coding-provider limits visible and shows when each window resets. See the supported providers below. One status item per provider, or Merge Icons mode with a provider switcher. No Dock icon, minimal UI, dynamic bar icons.

Also available as a Linux desktop app with usage and spending windows, separate settings, desktop notifications, and an optional tray icon. On Omarchy, a native bar widget shares the desktop app’s data and follows your theme.

CodexBar menu popover with provider tiles, usage bars, and reset countdowns

Why

Install

macOS app

Requires macOS 14+ (Sonoma). Download from GitHub Releases, or install with Homebrew:

brew install --cask codexbar

Linux desktop and Omarchy

The Qt 6 desktop app supports Wayland and X11, with an optional Omarchy widget. Published desktop archives target x86_64 and ARM64 and require glibc 2.39+, Qt 6.4+, and a separately installed CodexBar CLI. Python 3 runs the per-user installer.

Follow the Linux installation guide for Arch/Omarchy, Fedora, and Debian/Ubuntu runtime packages, verified release downloads, and upgrades. It keeps the CLI's resource bundle beside its executable and installs a launcher and optional login startup. Open Settings to choose providers, then authenticate through the provider's CLI or configure its API key. GNOME may need a tray extension; the app's windows work without a tray.

See the macOS feature comparison for supported features and remaining gaps.

CLI Tarballs (macOS/Linux)

Homebrew formula (Linux today):

brew install steipete/tap/codexbar

Arch Linux AUR package:

yay -S codexbar-cli

Or download release tarballs from GitHub Releases:

macOS first run

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.

Providers

Icon & Screenshot

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.

Features

Privacy note

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. Plain Adaptive refresh never inspects local agent activity. The separate Adaptive (agent-aware) option asks before inspecting the running-process list (including command lines) to identify Codex/Claude and reading bounded known-session metadata. Declining returns to plain Adaptive. When allowed with Agent Sessions hidden, CodexBar retains only the latest activity time and discards session paths and identities. 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)

Docs

Getting started (dev)

Build from source

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

Looking for a Windows version?

Linux desktop integration?

Desk display

Status bar & terminal integration

Phone & web

Credits

Inspired by ccusage (MIT), specifically the cost usage tracking.

License

MIT • Peter Steinberger (steipete)

CodexBar (steipete/CodexBar)

正在搜索数据库…

这是干什么的?CodexBar 是一款小巧的 macOS 14+ 菜单栏应用,可以让你随时看到各个 AI 编程服务商的用量限额,并显示每个用量窗口何时重置,这样你就能合理安排长任务,而不用瞎猜还剩多少额度。
这是一个完整的应用,还是要在终端里运行的东西?它是一个原生 macOS 菜单栏应用,没有 Dock 图标——每个服务商一个状态栏图标,或者合并成一个带切换器的图标——它还自带 codexbar 命令行工具,可用于脚本和 CI,提供 macOS 和 Linux 版本。
我怎么安装并让它跑起来?从 GitHub Releases 下载发布压缩包(需要 macOS 14+ Sonoma),然后打开 Settings → Providers,启用你使用的服务商;也可以通过命令行把 API 密钥存到 ~/.config/codexbar/config.json 里。
我需要交出我的密码或重新注册账号吗?不用——它会复用你已有的登录状态:OAuth 或设备授权流程、API 密钥、浏览器 Cookie、服务商的命令行工具,以及本地应用文件。不会存储任何密码。
它会向我索要哪些 macOS 权限?完全磁盘访问权限是可选的(只有基于 Safari Cookie 的服务商才需要);导入 Chromium Cookie 时会弹出钥匙串授权提示,服务商的命令行辅助工具读取项目目录时会弹出文件夹授权提示。在后台运行时,它会直接失败或跳过,而不会弹窗询问。
它能在 Windows 或 Linux 上用吗?菜单栏应用本身只支持 macOS 14+,但自带的 codexbar 命令行工具也有 Linux 版本,提供 arm64 和 x86_64 的 glibc 及静态 musl 构建。
它会扫描我的硬盘或把我的数据发到别处吗?不会——默认情况下解析都在本机完成,只有在相关功能开启时,它才会读取少数已知的固定位置(Cookie、配置文件、JSONL 日志);令牌保存在权限严格受限的本地配置文件里。
菜单栏图标实际上显示什么?一个小小的用量计量条——条的含义取决于具体服务商,出错或数据过期时会变暗,出现故障事件时会加一个叠加指示。你可以开关图标、标签、计量条和重置时间的显示样式,也可以把所有服务商合并成一个带切换器的状态栏图标。
它能显示花费,而不只是额度吗?可以——包括余额、Admin API 花费面板、服务商的账单汇总,以及在数据源提供足够细节时的本地成本扫描;还有一个常驻的 Usage & Spend 视图,提供本地 7/30 天的估算。
它多久刷新一次我的用量?全新安装默认使用自适应(Adaptive)刷新;固定的 1、2、5、15 和 30 分钟间隔以及手动刷新仍然可用,老用户会保留他们之前设置的有效选项。
除了显示统计信息,它还有别的功能吗?有——包括服务商状态轮询和故障事件徽标、可选的会话额度通知、每周重置时的彩蛋动画、WidgetKit 小组件,以及支持从右到左(RTL)文字、翻译成 21 种语言的应用和网站。
作者
steipete
大小
364.1 MB
星标
23.4K
时长
1年
提交 · 90 天