docs/command-code.md
CodexBar surfaces Command Code monthly USD credits next to your other AI coding providers.
https://api.commandcode.ai billing endpoints, authenticated with the
signed-in Command Code web session.Command Code support uses browser cookies or a manually pasted cookie header.
https://commandcode.ai in a supported browser.Cookie: header/cURL capture from Command Code.Automatic import looks for better-auth session cookies from commandcode.ai
and www.commandcode.ai. It tries each detected browser profile in order until
one authenticates, so stale cookies in an earlier browser do not mask a later
active session. If automatic import cannot find a session, use the manual cookie
field.
On Linux, browser import is unavailable. Set cookieSource to manual and
provide the Command Code Cookie header in cookieHeader; both auto and
web CLI source modes then use the billing API.
The monthly grant size comes from the optional subscription lookup, which can
time out while credits remain available. CodexBar keeps the last confirmed plan
in memory, scoped to the credential that produced it. A kept plan is dropped at currentPeriodEnd, a day
after the last refresh that confirmed it, when a lookup reports the free tier,
and when a lookup reports a plan this build cannot size. Nothing is written to
disk, so a one-shot codexbar usage run starts with an empty memory.
Debug builds accept COMMANDCODE_API_URL for synthetic tests against a loopback
origin (localhost, 127.0.0.1, or ::1). Release builds always use the official
billing endpoint.
codexbar usage run reports after a failed lookup. The rolling rows stay
available either way. The app also preserves an already-proven depleted monthly
row while enrichment is unavailable and fresh credits still show depletion.Sources/CodexBarCore/Providers/CommandCode/ - descriptor, cookie import,
billing fetcher, snapshot mapping, and plan catalog.Sources/CodexBar/Providers/CommandCode/ - settings store bridge and
provider settings UI.Tests/CodexBarTests/CommandCode*Tests.swift - parser, cookie, settings,
and icon coverage.