feat: 支持 Grok Build 额度与用量 - #4
Open
wesleyel wants to merge 7 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
增加 Grok Build(xAI)作为第四个 Provider。
改动
~/.grok/auth.json+ OIDC 续期cli-chat-proxybilling credits + 订阅档位~/.grok/sessions/**/updates.jsonl,费用优先costUsdTicksCloses 3
测试