feat: add CLIProxyAPI multi-account quota support and Simplified Chinese localization#335
feat: add CLIProxyAPI multi-account quota support and Simplified Chinese localization#335baicai-1145 wants to merge 8 commits intosteipete:mainfrom
Conversation
- Added default localization to the package configuration. - Introduced resource processing for menu items. - Updated various UI elements in the menu card to use localized strings for better internationalization. - Implemented new settings for CLIProxy API, including base URL and management key. - Enhanced the settings pane with language selection and CLIProxy configuration options. - Improved handling of account actions in the menu based on provider settings.
- Introduced CodexProxy as a new provider, including its implementation and descriptor. - Updated existing code to accommodate CodexProxy in various functionalities, such as usage tracking and settings management. - Enhanced the handling of provider-specific logic across multiple files to ensure compatibility with CodexProxy. - Migrated legacy Codex CLI Proxy defaults to streamline configuration. - Improved UI elements to reflect CodexProxy integration, including menu and widget updates. - Refined error handling and logging for CodexProxy usage scenarios.
… handling - Introduced GeminiProxy and AntigravityProxy as new providers, including their implementations and descriptors. - Updated existing code to accommodate these new providers in various functionalities, such as usage tracking and settings management. - Enhanced provider-specific logic across multiple files to ensure compatibility with Gemini and Antigravity proxies. - Improved error handling and logging for usage scenarios related to the new proxies. - Updated localization strings and UI elements to reflect the integration of Gemini and Antigravity proxies.
…derSwitcherView - Introduced `setIconSize` method in `InlineIconToggleButton` and `StackedToggleButton` to allow dynamic icon size adjustments. - Updated `ProviderSwitcherView` to calculate and set icon sizes based on layout conditions. - Enhanced tooltip handling for buttons to display provider-specific names instead of default values. - Improved image scaling for buttons to ensure better visual consistency.
- Integrated localization support for various UI elements in the PreferencesAboutPane, PreferencesAdvancedPane, PreferencesDisplayPane, and others. - Updated text fields, buttons, and labels to utilize localized strings for improved internationalization. - Improved user experience by ensuring consistent terminology and phrasing throughout the settings interface. - Added missing localization keys and refined existing ones to enhance clarity and usability.
…iew and MenuDescriptor - Updated primary and secondary window labels to utilize localized strings based on the provider type. - Introduced new static methods for generating localized labels in both MenuCardView and MenuDescriptor. - Enhanced consistency in label presentation across different components of the UI.
…ProxyAPI - Deleted obsolete `StatusItemController+Menu` files to streamline menu management. - Updated `codex.md` documentation by removing outdated CLIProxyAPI management API details to reflect current usage practices. - Enhanced clarity in documentation regarding OAuth API usage for improved user guidance.
- Added details about first-class CLIProxyAPI usage paths for Codex, Gemini, and Antigravity. - Introduced app language options: System, English, and Simplified Chinese. - Updated provider documentation to reflect new CLIProxy integration and management capabilities.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ee2a34636
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case .codex: | ||
| return self.loadCodexDaily(range: range, now: now, options: options) | ||
| case .codexproxy: | ||
| return self.loadCodexDaily(range: range, now: now, options: options) | ||
| case .geminiproxy: |
There was a problem hiding this comment.
Avoid local Codex cost usage for CLIProxy provider
Here codexproxy reuses loadCodexDaily, which scans the local Codex cost-usage logs. For users who pick CLIProxy Codex (often with remote/multi-account auth), this will surface cost/token data from a local Codex account that may be unrelated to the CLIProxy quotas, so the menu card can display misleading cost usage for the wrong account/source. This violates the data-siloing guidance for provider sources. Consider returning an empty report (like other proxy providers) or gating token usage on an explicit local Codex source instead.
Useful? React with 👍 / 👎.
Summary
This PR adds/refines CLIProxyAPI integration and improves localization support, including Simplified Chinese.
Why
Supporting CLIProxyAPI is highly practical: with a single management API, users can query usage limits for multiple providers (Codex, Gemini,Antigravity) across multiple auth files/accounts, instead of checking each account separately.
CLIProxyAPI project: https://github.com/router-for-me/CLIProxyAPI
What Changed
Notes