Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ This project is a **CLI fork** of [CC-Switch](https://github.com/farion1231/cc-s
</tr>
<tr>
<td width="180">
<a href="https://www.right.codes/register?aff=ccswitch-cli">
<img src="assets/partners/logos/rightcode.jpg" alt="RightCode" width="150">
<a href="https://cubence.com/signup?code=SC3M1CAH&source=ccscli">
<img src="assets/partners/logos/cubence.png" alt="Cubence" width="150">
</a>
</td>
<td>
Thanks to <b>RightCode</b> for sponsoring this project! RightCode reliably provides routing services for models such as Claude Code, Codex, and Gemini. It features a highly cost-effective Codex monthly subscription plan and <b>supports quota rollovers—unused quota from one day can be carried over and used the next day.</b> <br/>
RightCode offers a special deal for CC-Switch CLI users: register via <a href="https://www.right.codes/register?aff=ccswitch-cli">this link</a> and get <b>5% bonus pay-as-you-go credits</b> on every top-up!
Thanks to <b>Cubence</b> for sponsoring this project! Cubence is an API relay service provider dedicated to offering stable and efficient services to its customers. Operating since September 2025, it has provided support for various models such as Claude code, Codex, and Gemini. Register via <a href="https://cubence.com/signup?code=SC3M1CAH&source=ccscli">this link</a> and use the <code>CCSCLI</code> discount code when topping up to enjoy a 10% discount.
</td>
</tr>
<tr>
Expand Down
8 changes: 3 additions & 5 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@
</tr>
<tr>
<td width="180">
<a href="https://www.right.codes/register?aff=ccswitch-cli">
<img src="assets/partners/logos/rightcode.jpg" alt="RightCode" width="150">
<a href="https://cubence.com/signup?code=SC3M1CAH&source=ccscli">
<img src="assets/partners/logos/cubence.png" alt="Cubence" width="150">
</a>
</td>
<td>
感谢 <b>RightCode</b> 赞助本项目!<br/>
RightCode 为 Claude Code、Codex、Gemini 等模型提供稳定的路由服务,拥有高性价比的 Codex 月付方案,且<b>支持额度滚存——当天未用完的额度可顺延至次日使用。</b><br/>
RightCode 为 CC-Switch CLI 用户提供了特别优惠:通过<a href="https://www.right.codes/register?aff=ccswitch-cli">此链接</a>注册,每次充值均可获得实付金额 <b>5%</b> 的按量额度!
感谢 <b>Cubence</b> 赞助本项目!Cubence 是一家致力为客户提供稳定、高效的API中转服务商。从25年9月运营至今,提供了Claude code、Codex、Gemini等多种模型支持。通过<a href="https://cubence.com/signup?code=SC3M1CAH&source=ccscli">此链接</a>注册,并在充值时使用 <code>CCSCLI</code> 优惠码享受9折优惠。
</td>
</tr>
<tr>
Expand Down
Binary file added assets/partners/logos/cubence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/partners/logos/rightcode.jpg
Binary file not shown.
80 changes: 63 additions & 17 deletions src-tauri/src/cli/tui/form/provider_templates.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use crate::app_config::AppType;
use serde_json::json;

use super::{ClaudeApiFormat, CodexWireApi, FormMode, GeminiAuthType, ProviderAddFormState};
use super::{
ClaudeApiFormat, CodexWireApi, FormMode, GeminiAuthType, ProviderAddFormState,
HERMES_DEFAULT_API_MODE, OPENCLAW_DEFAULT_API_PROTOCOL,
};

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum ProviderTemplateId {
Expand Down Expand Up @@ -30,6 +33,9 @@ pub(super) struct SponsorProviderPreset {
claude_base_url: &'static str,
codex_base_url: &'static str,
gemini_base_url: &'static str,
opencode_base_url: &'static str,
openclaw_base_url: &'static str,
hermes_base_url: &'static str,
}

#[cfg(test)]
Expand All @@ -55,6 +61,9 @@ static SPONSOR_PROVIDER_PRESETS: [SponsorProviderPreset; 4] = [
claude_base_url: "https://www.packyapi.com",
codex_base_url: "https://www.packyapi.com/v1",
gemini_base_url: "https://www.packyapi.com",
opencode_base_url: "https://www.packyapi.com/v1",
openclaw_base_url: "https://www.packyapi.com",
hermes_base_url: "https://www.packyapi.com",
},
SponsorProviderPreset {
id: "aicodemirror",
Expand All @@ -67,18 +76,24 @@ static SPONSOR_PROVIDER_PRESETS: [SponsorProviderPreset; 4] = [
claude_base_url: "https://api.aicodemirror.com/api/claudecode",
codex_base_url: "https://api.aicodemirror.com/api/codex/backend-api/codex",
gemini_base_url: "https://api.aicodemirror.com/api/gemini",
opencode_base_url: "https://api.aicodemirror.com/api/claudecode",
openclaw_base_url: "https://api.aicodemirror.com/api/claudecode",
hermes_base_url: "",
},
SponsorProviderPreset {
id: "rightcode",
provider_name: "RightCode",
chip_label: "* RightCode",
website_url: "https://right.codes",
register_url: "https://www.right.codes/register?aff=ccswitch-cli",
promo_code: "",
partner_promotion_key: "rightcode",
claude_base_url: "https://www.right.codes/claude",
codex_base_url: "https://right.codes/codex/v1",
gemini_base_url: "https://www.right.codes",
id: "cubence",
provider_name: "Cubence",
chip_label: "* Cubence",
website_url: "https://cubence.com",
register_url: "https://cubence.com/signup?code=SC3M1CAH&source=ccscli",
promo_code: "CCSCLI",
partner_promotion_key: "cubence",
claude_base_url: "https://api.cubence.com",
codex_base_url: "https://api.cubence.com/v1",
gemini_base_url: "https://api.cubence.com",
opencode_base_url: "https://api.cubence.com/v1",
openclaw_base_url: "https://api.cubence.com",
hermes_base_url: "https://api.cubence.com",
},
SponsorProviderPreset {
id: "dds",
Expand All @@ -91,6 +106,9 @@ static SPONSOR_PROVIDER_PRESETS: [SponsorProviderPreset; 4] = [
claude_base_url: "https://www.ddshub.cc",
codex_base_url: "https://www.ddshub.cc",
gemini_base_url: "",
opencode_base_url: "",
openclaw_base_url: "",
hermes_base_url: "",
},
];

Expand All @@ -114,11 +132,13 @@ static SPONSOR_PROVIDER_PRESETS_GEMINI: [SponsorProviderPreset; 3] = [
SPONSOR_PROVIDER_PRESETS[2],
];

static SPONSOR_PROVIDER_PRESETS_OPENCODE: [SponsorProviderPreset; 1] =
[SPONSOR_PROVIDER_PRESETS[1]];
static SPONSOR_PROVIDER_PRESETS_OPENCODE: [SponsorProviderPreset; 2] =
[SPONSOR_PROVIDER_PRESETS[1], SPONSOR_PROVIDER_PRESETS[2]];

static SPONSOR_PROVIDER_PRESETS_HERMES: [SponsorProviderPreset; 1] = [SPONSOR_PROVIDER_PRESETS[2]];

static SPONSOR_PROVIDER_PRESETS_OPENCLAW: [SponsorProviderPreset; 1] =
[SPONSOR_PROVIDER_PRESETS[1]];
static SPONSOR_PROVIDER_PRESETS_OPENCLAW: [SponsorProviderPreset; 2] =
[SPONSOR_PROVIDER_PRESETS[1], SPONSOR_PROVIDER_PRESETS[2]];

static PROVIDER_TEMPLATE_DEFS_CLAUDE: [ProviderTemplateDef; 3] = [
ProviderTemplateDef {
Expand Down Expand Up @@ -189,7 +209,7 @@ pub(super) fn provider_sponsor_presets(app_type: &AppType) -> &'static [SponsorP
AppType::Codex => &SPONSOR_PROVIDER_PRESETS_CODEX,
AppType::Gemini => &SPONSOR_PROVIDER_PRESETS_GEMINI,
AppType::OpenCode => &SPONSOR_PROVIDER_PRESETS_OPENCODE,
AppType::Hermes => &[],
AppType::Hermes => &SPONSOR_PROVIDER_PRESETS_HERMES,
AppType::OpenClaw => &SPONSOR_PROVIDER_PRESETS_OPENCLAW,
}
}
Expand Down Expand Up @@ -430,9 +450,24 @@ impl ProviderAddFormState {
self.opencode_model_context_limit.set("");
self.opencode_model_output_limit.set("");
self.opencode_model_original_id = Some("claude-opus-4.6".to_string());
} else {
self.opencode_npm_package.set("@ai-sdk/openai-compatible");
self.opencode_api_key.set("");
self.opencode_base_url.set(preset.opencode_base_url);
self.opencode_model_id.set("");
self.opencode_model_name.set("");
self.opencode_model_context_limit.set("");
self.opencode_model_output_limit.set("");
self.opencode_model_original_id = None;
}
}
AppType::Hermes => {}
AppType::Hermes => {
self.hermes_api_mode = HERMES_DEFAULT_API_MODE.to_string();
self.hermes_api_key.set("");
self.hermes_base_url.set(preset.hermes_base_url);
self.hermes_models = Vec::new();
self.hermes_rate_limit_delay.set("");
}
AppType::OpenClaw => {
if preset.id == "aicodemirror" {
self.opencode_api_key.set("");
Expand Down Expand Up @@ -463,6 +498,17 @@ impl ProviderAddFormState {
self.opencode_model_name.set("Claude Opus 4.6");
self.opencode_model_context_limit.set("200000");
self.opencode_model_original_id = Some("claude-opus-4-6".to_string());
} else {
self.opencode_api_key.set("");
self.opencode_base_url.set(preset.openclaw_base_url);
self.opencode_npm_package.set(OPENCLAW_DEFAULT_API_PROTOCOL);
self.openclaw_user_agent = false;
self.openclaw_models = Vec::new();
self.opencode_model_id.set("");
self.opencode_model_name.set("");
self.opencode_model_context_limit.set("");
self.opencode_model_output_limit.set("");
self.opencode_model_original_id = None;
}
}
}
Expand Down
Loading
Loading