Windows rewrite of the role of upstream docs/providers.md: how providers are registered and fetched in this repo.
Do not treat upstream’s full strategy table as authoritative for Win-CodexBar without checking code — IDs and auto-order drift.
All shells and the CLI construct providers through:
codexbar::core::instantiate_provider → rust/src/core/provider_factory.rs
ProviderId lives in rust/src/core/provider.rs. The factory match is exhaustive (missing arm = compile error). Tests ensure every id instantiates.
Never duplicate provider factories in the Tauri shell or ad-hoc commands.
- Add a
ProviderIdvariant +cli_name/display_name/ cookie domain /from_cli_namemetadata as required. - Implement
Providerinrust/src/providers/<name>/(or module). - Add the match arm in
provider_factory.rs::instantiate. - Keep provider-specific parsing and auth inside that module — no cross-provider branching in shared UI paths.
- Keep identity / plan / email siloed per provider in the UI.
Same vocabulary as upstream, implemented in Rust:
| Source label | Meaning (typical) |
|---|---|
auto |
Provider-specific fallback order |
web |
Cookie / dashboard HTTP |
cli |
Local CLI / PTY / RPC helpers |
oauth |
OAuth-backed flows where supported |
CLI: codexbar usage --source auto|web|cli|oauth.
Auth resolution helpers in rust/src/providers/ commonly try: explicit settings → keyring/entry → environment variables (exact order is provider-specific).
Windows browser import: Chrome, Edge, Brave (DPAPI + AES-GCM), Firefox (SQLite).
Settings → Providers → provider detail → choose browser → Import.
Manual cookie header paste is the fallback (required under WSL for Chromium DPAPI).
Details: COOKIES.md.
codexbar config providers
codexbar config enable -p cursor
codexbar config disable -p cursorDesktop: Settings → Providers (sidebar reorder, per-provider credential UI).
Optional status polling (provider status pages) is available via CLI --status and Settings advanced toggles where wired. Mapping of Statuspage vs Google incidents is provider metadata in code — see provider modules rather than upstream-only URLs if they disagree.
Desktop tab id: usageSpend. The desktop and Overview consume one shared spend catalog. Codex and Claude local logs are first-class; routed OpenCodex usage enriches the matching Codex, OpenCode Go, Kimi, or DeepSeek subscription instead of appearing as a second fake provider. xAI and OpenRouter can publish exact provider-metered daily USD spend when their management credentials are configured, while Grok local sessions contribute tokens only. Missing spend sources remain unknown rather than becoming a false $0. Do not invent cross-currency totals.
Custom pricing overlays are exact-match overrides used only where the local spend contract has matching provider/model token evidence. Explicit zero rates mean free; omitted rate fields stay unknown. The Usage & Spend surface keeps provenance/coverage visible, preserves cost-only model rows when token coverage is partial, and can Copy JSON or save the same JSON contract through the native file picker.
Upstream docs/providers.md is a large auto-strategy matrix (60+ providers) for the macOS app. Use it as inspiration when porting a provider. For runtime truth on Windows:
rust/src/core/provider.rs(ProviderId)rust/src/providers/<id>/codexbar usage -p <id> -v/ desktop provider detail errors