Skip to content

feat: 支持 Grok Build 额度与用量 - #4

Open
wesleyel wants to merge 7 commits into
nanvon:mainfrom
wesleyel:feat/grok-support
Open

feat: 支持 Grok Build 额度与用量#4
wesleyel wants to merge 7 commits into
nanvon:mainfrom
wesleyel:feat/grok-support

Conversation

@wesleyel

Copy link
Copy Markdown

摘要

增加 Grok Build(xAI)作为第四个 Provider。

改动

  • 凭据:~/.grok/auth.json + OIDC 续期
  • 额度:cli-chat-proxy billing credits + 订阅档位
  • 用量:扫 ~/.grok/sessions/**/updates.jsonl,费用优先 costUsdTicks
  • UI:菜单栏 / 设置 / 统计 / 时间线

Closes 3

测试

  • 本地 macOS Debug 构建通过
  • Grok 解析 / 计价单测通过

wesleyel added 6 commits July 27, 2026 18:01
Read ~/.grok/auth.json, refresh OIDC tokens against auth.x.ai, and
fetch weekly credit usage from cli-chat-proxy.grok.com so Grok shows
alongside Codex, Claude Code, and Antigravity in the menu bar.
Use the public xAI monogram for the menu/popover logo. Scan
~/.grok/sessions/**/updates.jsonl turn_completed events for tokens
and costUsdTicks, and surface Grok in stats, conversations, and
today/week spend alongside Codex and Claude.
Fetch active plan from grok.com/rest/subscriptions (and credits
subscriptionTier when present), map GROK_PRO to SuperGrok, and
surface it on the account row like Claude's subscriptionType.
Show Grok weekly credit changes alongside Codex and Claude in the
stats timeline tab, with correct service filter handling.
Pad and center the xAI monogram in a 100×100 viewBox so it no longer
optically dominates Codex/Claude at 18pt template size.
Use docs.x.ai prices ($20/$60/$3 for grok-4.5), prefer costUsdTicks
with proportional breakdowns, skip reasoning in billing, and map CLI
model aliases so stats spend matches API accounting.
Mention Grok in the welcome copy, add a menu-bar visibility toggle,
and grow the onboarding window for four account rows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant