From b920a89539be25100ae76ecf56c10abc5730228a Mon Sep 17 00:00:00 2001 From: joo <14088938+sungizhou@user.noreply.gitee.com> Date: Fri, 29 May 2026 00:07:24 +0800 Subject: [PATCH] docs: update switch examples for model bindings Co-authored-by: Cursor --- electron/README.md | 4 +-- .../anthropic-oauth-ban-agent-workflow.en.md | 8 ++--- ...nthropic-oauth-ban-agent-workflow.zh-CN.md | 8 ++--- ...claude-code-tier-routing-on-a-budget.en.md | 4 +-- ...ude-code-tier-routing-on-a-budget.zh-CN.md | 4 +-- .../codex-subscription-to-local-api.en.md | 10 +++--- .../codex-subscription-to-local-api.zh-CN.md | 10 +++--- ...ursor-terminal-agent-without-plugins.en.md | 2 +- ...or-terminal-agent-without-plugins.zh-CN.md | 2 +- .../blog/desktop-app-vs-cli-workflow.en.md | 6 ++-- .../blog/desktop-app-vs-cli-workflow.zh-CN.md | 6 ++-- .../blog/manage-multiple-api-profiles.en.md | 6 ++-- .../manage-multiple-api-profiles.zh-CN.md | 6 ++-- .../stop-diy-proxy-sprawl-for-agent-cli.en.md | 4 +-- ...op-diy-proxy-sprawl-for-agent-cli.zh-CN.md | 4 +-- ...switch-between-claude-codex-opencode.en.md | 6 ++-- ...tch-between-claude-codex-opencode.zh-CN.md | 6 ++-- ...tch-claude-code-api-without-env-vars.en.md | 4 +-- ...-claude-code-api-without-env-vars.zh-CN.md | 4 +-- ...witch-opencode-upstream-with-clovapi.en.md | 14 ++++---- ...ch-opencode-upstream-with-clovapi.zh-CN.md | 14 ++++---- landing/public/llms.txt | 2 +- .../components/agents/agent-guide-content.tsx | 2 +- landing/src/components/home/hero.tsx | 2 +- landing/src/lib/guides-data.ts | 36 +++++++++---------- landing/src/lib/seo-data.ts | 2 +- landing/src/lib/skill-markdown.ts | 2 +- 27 files changed, 89 insertions(+), 89 deletions(-) diff --git a/electron/README.md b/electron/README.md index 6598dac4..38bb03fb 100644 --- a/electron/README.md +++ b/electron/README.md @@ -20,8 +20,8 @@ On first launch, if `profiles.json` is empty and legacy `localStorage` (`clovapi - **本地代理**:Electron 在主进程调用 **Go `clovapi proxy start`**(与 CLI 同源,后台 daemon),监听 `profiles.json` 中的 `proxy.host` / `proxy.port`(默认 `http://127.0.0.1:27483`)。请求路由与 Go 内核一致:`http://127.0.0.1:{port}/{providerId}/{modelId}/{apiStyle}/v1/…` - **协议与解码**:全部由 **Go `core/internal/proxy` + protocol** 持有;Electron 不写平行 JS proxy - **测试**:`npm test`(进程管理参数构造、`/health` 外部代理分支、ingress URL 分段编码) -- Bind each installed CLI to a profile (`active` map in `profiles.json`) -- **应用** runs `clovapi switch --cli ` to write Codex / OpenCode / etc. configs +- Bind each installed CLI to a vendor/model selection (`active` map in `profiles.json`) +- **应用** runs `clovapi switch --cli --vendor "" --model ` to write Codex / OpenCode / etc. configs ## UI diff --git a/landing/content/blog/anthropic-oauth-ban-agent-workflow.en.md b/landing/content/blog/anthropic-oauth-ban-agent-workflow.en.md index d58dd08b..6d87d95a 100644 --- a/landing/content/blog/anthropic-oauth-ban-agent-workflow.en.md +++ b/landing/content/blog/anthropic-oauth-ban-agent-workflow.en.md @@ -21,7 +21,7 @@ Anthropic’s supported path remains **Claude Code CLI** with subscription or AP Good when you accept the official client experience but want fast switches to a team gateway or third-party API. ```bash -clovapi switch --cli claude-code my-team-gateway +clovapi switch --cli claude-code --vendor "Custom API" --model ``` ## Path B: API keys into OpenCode and other CLIs @@ -38,9 +38,9 @@ One `profiles.json` backs multiple agents: ```bash clovapi list -clovapi switch --cli claude-code deepseek -clovapi switch --cli codex openrouter-prod -clovapi switch --cli opencode local-ollama +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat +clovapi switch --cli codex --vendor "Custom API" --model +clovapi switch --cli opencode --vendor Ollama --model llama3.1 ``` You change which upstream the active agent eats—not reinstall three env-var scripts. diff --git a/landing/content/blog/anthropic-oauth-ban-agent-workflow.zh-CN.md b/landing/content/blog/anthropic-oauth-ban-agent-workflow.zh-CN.md index 39fb7a46..fb51a5cb 100644 --- a/landing/content/blog/anthropic-oauth-ban-agent-workflow.zh-CN.md +++ b/landing/content/blog/anthropic-oauth-ban-agent-workflow.zh-CN.md @@ -21,7 +21,7 @@ Anthropic 明确支持的路径仍是 **Claude Code CLI** 配合订阅或 API。 适合:你接受「Claude 官方客户端体验」,只想快速切第三方 API 或团队网关。 ```bash -clovapi switch --cli claude-code my-team-gateway +clovapi switch --cli claude-code --vendor "Custom API" --model ``` ## 路径 B:API Key 进 OpenCode / 其他 CLI @@ -38,9 +38,9 @@ clovapi 用一份 `profiles.json` 服务多 CLI: ```bash clovapi list -clovapi switch --cli claude-code deepseek -clovapi switch --cli codex openrouter-prod -clovapi switch --cli opencode local-ollama +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat +clovapi switch --cli codex --vendor "Custom API" --model +clovapi switch --cli opencode --vendor Ollama --model llama3.1 ``` 换的是「当前 Agent 吃哪条上游」,不是重装三套环境变量。 diff --git a/landing/content/blog/claude-code-tier-routing-on-a-budget.en.md b/landing/content/blog/claude-code-tier-routing-on-a-budget.en.md index ee8d6fb3..e601b08d 100644 --- a/landing/content/blog/claude-code-tier-routing-on-a-budget.en.md +++ b/landing/content/blog/claude-code-tier-routing-on-a-budget.en.md @@ -29,8 +29,8 @@ The proxy inspects the model name on **every HTTP request** and picks a backend. clovapi does not ship a hard-coded “Opus→free / Haiku→local” table (no hidden magic). A simpler loop: 1. **`clovapi add --name deepseek-flash`** — bind a cheap model and gateway. -2. **`clovapi switch --cli claude-code deepseek-flash`** — the whole Claude Code session uses that upstream; the proxy transcodes Messages format. -3. When you need Opus-grade quality, **`switch` back to an official profile** (desktop OAuth or Anthropic API profile). +2. **`clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat`** — the whole Claude Code session uses that upstream; the proxy transcodes Messages format. +3. When you need Opus-grade quality, **`switch` back to an official subscription model binding** (desktop OAuth or Anthropic API profile). Whether sub-agents get cheaper depends on whether that **single upstream** is fast enough end-to-end. Many reports say DeepSeek V4 Flash covering ~80% of daily coding already beats maintaining tier tables. diff --git a/landing/content/blog/claude-code-tier-routing-on-a-budget.zh-CN.md b/landing/content/blog/claude-code-tier-routing-on-a-budget.zh-CN.md index 905c8bd5..ed6bf4f4 100644 --- a/landing/content/blog/claude-code-tier-routing-on-a-budget.zh-CN.md +++ b/landing/content/blog/claude-code-tier-routing-on-a-budget.zh-CN.md @@ -29,8 +29,8 @@ MODEL_HAIKU=ollama/llama3.1 clovapi 不内建「Opus→免费 / Haiku→本地」的硬编码表(避免隐藏魔法)。更直接的做法: 1. **`clovapi add --name deepseek-flash`** — 绑定廉价模型与网关。 -2. **`clovapi switch --cli claude-code deepseek-flash`** — 整段 Claude Code 会话走该上游;代理按 Messages 形态转码。 -3. 需要 Opus 级质量时 **`switch` 回官方 profile**(桌面端 OAuth 或 Anthropic API profile)。 +2. **`clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat`** — 整段 Claude Code 会话走该上游;代理按 Messages 形态转码。 +3. 需要 Opus 级质量时 **`switch` 回官方订阅模型绑定**(桌面端 OAuth 或 Anthropic API profile)。 子代理是否变便宜,取决于你选的**单一上游**是否在全流程中够快够稳。许多开发者反馈:DeepSeek V4 Flash 承担 80% 日常编码后,账单已足够低,不必再维护 tier 路由表。 diff --git a/landing/content/blog/codex-subscription-to-local-api.en.md b/landing/content/blog/codex-subscription-to-local-api.en.md index d9df95bd..07d5b053 100644 --- a/landing/content/blog/codex-subscription-to-local-api.en.md +++ b/landing/content/blog/codex-subscription-to-local-api.en.md @@ -14,25 +14,25 @@ Codex is tied to the **openai-responses** format, not generic Chat Completions. 2. Starts the built-in local proxy so Codex only talks to `localhost`. 3. Transcodes and forwards Responses-shaped requests to the profile you saved. -The agent keeps stable paths; switching upstream means switching a clovapi profile. +The agent keeps stable paths; switching upstream means switching a clovapi vendor/model binding. ## Suggested commands ```bash npm i -g @clovapi/cli clovapi add --name codex-official -clovapi switch --cli codex codex-official +clovapi switch --cli codex --vendor "Codex Subscription" --model gpt-5.5 ``` -`add` probes connectivity first. For a third-party gateway, enter base URL, API key, and model ID in the interactive flow. Official subscription and vendor APIs are distinguished by **profile name**: +`add` probes connectivity first. For a third-party gateway, enter base URL, API key, and model ID in the interactive flow. Official subscription and vendor APIs are distinguished by **vendor/model binding**: ```bash -clovapi switch --cli codex my-gateway +clovapi switch --cli codex --vendor "Custom API" --model ``` ## Share the profile library with Claude Code -`profiles.json` stores **upstreams**, not per-CLI silos. You might keep `deepseek` for Claude Code and `openrouter-prod` for Codex, each applied with `switch`. The desktop app and CLI read the same file—pick profiles in the GUI or automate in the terminal. +`profiles.json` stores **upstreams**, not per-CLI silos. You might bind `Custom API/deepseek-chat` for Claude Code and `Custom API/` for Codex. The desktop app and CLI read the same file, so you can pick bindings in the GUI or automate them in the terminal. ## Read more diff --git a/landing/content/blog/codex-subscription-to-local-api.zh-CN.md b/landing/content/blog/codex-subscription-to-local-api.zh-CN.md index a2cb8c1d..2befb489 100644 --- a/landing/content/blog/codex-subscription-to-local-api.zh-CN.md +++ b/landing/content/blog/codex-subscription-to-local-api.zh-CN.md @@ -14,25 +14,25 @@ Codex 绑定的是 **openai-responses** 形态,不是通用 Chat Completions 2. 启动内置本地代理,Codex 进程只连 `localhost`。 3. 由代理把 Responses 形态请求转码并转发到你保存的上游。 -Agent 侧配置路径稳定,换上游只动 clovapi profile。 +Agent 侧配置路径稳定,换上游只动 clovapi 的 vendor/model 绑定。 ## 推荐命令 ```bash npm i -g @clovapi/cli clovapi add --name codex-official -clovapi switch --cli codex codex-official +clovapi switch --cli codex --vendor "Codex Subscription" --model gpt-5.5 ``` -`add` 会探测连通性;若你接入第三方,在交互流程里填写 Base URL、API Key 与模型 ID 即可。官方订阅与第三方 API 都以 **profile 名称** 区分,切换时: +`add` 会探测连通性;若你接入第三方,在交互流程里填写 Base URL、API Key 与模型 ID 即可。官方订阅与第三方 API 都以 **vendor/model 绑定** 区分,切换时: ```bash -clovapi switch --cli codex my-gateway +clovapi switch --cli codex --vendor "Custom API" --model ``` ## 与 Claude Code 共用 profile 库 -`profiles.json` 里保存的是**上游**而非某个 CLI 独占。你可以为 Claude Code 保存 `deepseek`,为 Codex 保存 `openrouter-prod`,各自 `switch` 到对应 CLI。桌面端与 CLI 读写同一份配置,适合在 GUI 里点选、在终端里脚本化。 +`profiles.json` 里保存的是**上游**而非某个 CLI 独占。你可以给 Claude Code 绑定 `Custom API/deepseek-chat`,给 Codex 绑定 `Custom API/`。桌面端与 CLI 读写同一份配置,适合在 GUI 里点选、在终端里脚本化。 ## 延伸阅读 diff --git a/landing/content/blog/cursor-terminal-agent-without-plugins.en.md b/landing/content/blog/cursor-terminal-agent-without-plugins.en.md index 64d7b3c3..e570e0e8 100644 --- a/landing/content/blog/cursor-terminal-agent-without-plugins.en.md +++ b/landing/content/blog/cursor-terminal-agent-without-plugins.en.md @@ -33,7 +33,7 @@ Typical failures: It starts the same **Go proxy** the CLI uses (default `http://127.0.0.1:27483`). In Cursor’s terminal: ```bash -clovapi switch --cli claude-code my-profile +clovapi switch --cli claude-code --vendor "Custom API" --model claude ``` diff --git a/landing/content/blog/cursor-terminal-agent-without-plugins.zh-CN.md b/landing/content/blog/cursor-terminal-agent-without-plugins.zh-CN.md index 8ce33343..d8f7fa88 100644 --- a/landing/content/blog/cursor-terminal-agent-without-plugins.zh-CN.md +++ b/landing/content/blog/cursor-terminal-agent-without-plugins.zh-CN.md @@ -35,7 +35,7 @@ date: 2026-05-31 并启动与 CLI 同源的 **Go 代理**,默认 `http://127.0.0.1:27483`。你在 Cursor 终端里只需: ```bash -clovapi switch --cli claude-code my-profile +clovapi switch --cli claude-code --vendor "Custom API" --model claude ``` diff --git a/landing/content/blog/desktop-app-vs-cli-workflow.en.md b/landing/content/blog/desktop-app-vs-cli-workflow.en.md index 0cf156b7..98002d1f 100644 --- a/landing/content/blog/desktop-app-vs-cli-workflow.en.md +++ b/landing/content/blog/desktop-app-vs-cli-workflow.en.md @@ -25,8 +25,8 @@ Download macOS / Windows builds from the home page—the installer bundles the ` ## When the CLI wins -- **Automation**: `clovapi switch --cli codex prod` in CI, devcontainers, or remote SSH hosts. -- **Speed**: if you already know profile names, one command beats opening a window. +- **Automation**: `clovapi switch --cli codex --vendor "Custom API" --model ` in CI, devcontainers, or remote SSH hosts. +- **Speed**: if you already know the vendor and model ID, one command beats opening a window. - **Terminal-native flow**: fits tmux, Makefiles, and `clovapi update` for self-updates. Install: @@ -34,7 +34,7 @@ Install: ```bash npm i -g @clovapi/cli clovapi add --name prod -clovapi switch --cli claude-code prod +clovapi switch --cli claude-code --vendor "Custom API" --model ``` ## Mixing both is fine diff --git a/landing/content/blog/desktop-app-vs-cli-workflow.zh-CN.md b/landing/content/blog/desktop-app-vs-cli-workflow.zh-CN.md index 6b54b15c..c269ed82 100644 --- a/landing/content/blog/desktop-app-vs-cli-workflow.zh-CN.md +++ b/landing/content/blog/desktop-app-vs-cli-workflow.zh-CN.md @@ -25,8 +25,8 @@ clovapi 提供两种入口:**终端 CLI**(`npm i -g @clovapi/cli`)与 **Cl ## 适合用 CLI 的场景 -- **脚本与自动化**:在 CI、devcontainer 或 SSH 机器上 `clovapi switch --cli codex prod`。 -- **快速切换**:已熟悉 profile 名称时,一条命令比打开 GUI 更快。 +- **脚本与自动化**:在 CI、devcontainer 或 SSH 机器上 `clovapi switch --cli codex --vendor "Custom API" --model `。 +- **快速切换**:已熟悉 vendor 与 model ID 时,一条命令比打开 GUI 更快。 - **与现有终端工作流共存**:配合 tmux、Makefile、`clovapi update` 自更新等。 安装: @@ -34,7 +34,7 @@ clovapi 提供两种入口:**终端 CLI**(`npm i -g @clovapi/cli`)与 **Cl ```bash npm i -g @clovapi/cli clovapi add --name prod -clovapi switch --cli claude-code prod +clovapi switch --cli claude-code --vendor "Custom API" --model ``` ## 可以混用 diff --git a/landing/content/blog/manage-multiple-api-profiles.en.md b/landing/content/blog/manage-multiple-api-profiles.en.md index 6b31d1f5..6fe50ab4 100644 --- a/landing/content/blog/manage-multiple-api-profiles.en.md +++ b/landing/content/blog/manage-multiple-api-profiles.en.md @@ -15,7 +15,7 @@ Typical layout: - `profiles`: every saved upstream. - `active`: the profile name last applied to each CLI via `switch`. -So your DeepSeek settings are stored once—you might `switch --cli claude-code deepseek` today and, when ready, point Codex at the same profile if the upstream fits. +So your DeepSeek settings are stored once—you might `switch --cli claude-code --vendor "Custom API" --model deepseek-chat` today and, when ready, point Codex at the same vendor/model binding if the upstream fits. ## Workflow: add once, switch per CLI @@ -24,8 +24,8 @@ clovapi add --name deepseek clovapi add --name openrouter-prod clovapi add --name claude-official -clovapi switch --cli claude-code claude-official -clovapi switch --cli codex openrouter-prod +clovapi switch --cli claude-code --vendor "Claude Subscription" --model claude-sonnet-4-20250514 +clovapi switch --cli codex --vendor "Custom API" --model ``` `add` probes connectivity before persisting. `switch` touches **one** CLI at a time—you will not rewrite Codex when you only meant to change Claude Code. diff --git a/landing/content/blog/manage-multiple-api-profiles.zh-CN.md b/landing/content/blog/manage-multiple-api-profiles.zh-CN.md index 51c1d73a..5ad505b6 100644 --- a/landing/content/blog/manage-multiple-api-profiles.zh-CN.md +++ b/landing/content/blog/manage-multiple-api-profiles.zh-CN.md @@ -15,7 +15,7 @@ date: 2026-05-24 - `profiles`:所有已保存的上游列表。 - `active`:每个 CLI 最近一次 `switch` 使用的 profile 名。 -因此「DeepSeek 配置」只存一份,既可以 `switch --cli claude-code deepseek`,也可以在准备好 Codex 适配后 `switch --cli codex deepseek`(若上游兼容)。 +因此「DeepSeek 配置」只存一份,既可以 `switch --cli claude-code --vendor "Custom API" --model deepseek-chat`,也可以在准备好 Codex 适配后 `switch --cli codex --vendor "Custom API" --model deepseek-chat`(若上游兼容)。 ## 工作流:先 add,再按 CLI switch @@ -24,8 +24,8 @@ clovapi add --name deepseek clovapi add --name openrouter-prod clovapi add --name claude-official -clovapi switch --cli claude-code claude-official -clovapi switch --cli codex openrouter-prod +clovapi switch --cli claude-code --vendor "Claude Subscription" --model claude-sonnet-4-20250514 +clovapi switch --cli codex --vendor "Custom API" --model ``` `add` 在写入前会探测连通性,避免保存无效 Key。`switch` 只影响**一个** CLI——不会误改 Codex 当你只想换 Claude Code。 diff --git a/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.en.md b/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.en.md index 1830e216..2c10445b 100644 --- a/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.en.md +++ b/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.en.md @@ -34,9 +34,9 @@ Change upstreams in profiles (base URL, key)—**no** extra Node/Python proxy pe ```bash clovapi add --name deepseek -clovapi switch --cli claude-code deepseek +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat # same profiles.json -clovapi switch --cli codex openrouter-prod +clovapi switch --cli codex --vendor "Custom API" --model ``` ## Versus “router” projects diff --git a/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.zh-CN.md b/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.zh-CN.md index f532e18e..2f2350b6 100644 --- a/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.zh-CN.md +++ b/landing/content/blog/stop-diy-proxy-sprawl-for-agent-cli.zh-CN.md @@ -34,9 +34,9 @@ clovapi 在 `switch` 时启动**同一个** Go 代理进程(默认 `127.0.0.1: ```bash clovapi add --name deepseek -clovapi switch --cli claude-code deepseek +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat # 同一 profiles.json -clovapi switch --cli codex openrouter-prod +clovapi switch --cli codex --vendor "Custom API" --model ``` ## 和「路由器」项目的差异 diff --git a/landing/content/blog/switch-between-claude-codex-opencode.en.md b/landing/content/blog/switch-between-claude-codex-opencode.en.md index d374c897..e92af781 100644 --- a/landing/content/blog/switch-between-claude-codex-opencode.en.md +++ b/landing/content/blog/switch-between-claude-codex-opencode.en.md @@ -31,9 +31,9 @@ clovapi add --name claude-official clovapi add --name codex-team clovapi add --name opencode-local -clovapi switch --cli claude-code claude-official -clovapi switch --cli codex codex-team -clovapi switch --cli opencode opencode-local +clovapi switch --cli claude-code --vendor "Claude Subscription" --model claude-sonnet-4-20250514 +clovapi switch --cli codex --vendor "Codex Subscription" --model gpt-5.5 +clovapi switch --cli opencode --vendor "Custom API" --model ``` `list` shows the matrix: supported API styles per CLI and current bindings—similar spirit to AgentHub or Hermes `/model --provider` discussions, but aligned with **official Claude/Codex/OpenCode config locations**. diff --git a/landing/content/blog/switch-between-claude-codex-opencode.zh-CN.md b/landing/content/blog/switch-between-claude-codex-opencode.zh-CN.md index ee58f6ce..f37c758d 100644 --- a/landing/content/blog/switch-between-claude-codex-opencode.zh-CN.md +++ b/landing/content/blog/switch-between-claude-codex-opencode.zh-CN.md @@ -31,9 +31,9 @@ clovapi add --name claude-official clovapi add --name codex-team clovapi add --name opencode-local -clovapi switch --cli claude-code claude-official -clovapi switch --cli codex codex-team -clovapi switch --cli opencode opencode-local +clovapi switch --cli claude-code --vendor "Claude Subscription" --model claude-sonnet-4-20250514 +clovapi switch --cli codex --vendor "Codex Subscription" --model gpt-5.5 +clovapi switch --cli opencode --vendor "Custom API" --model ``` `list` 输出会显示矩阵:每个 CLI 支持哪些 API 形态、当前绑定谁。这与社区里「AgentHub / Hermes 的 `/model --provider`」诉求类似,但 clovapi 更贴近 **已存在的 Claude/Codex/OpenCode 官方配置路径**。 diff --git a/landing/content/blog/switch-claude-code-api-without-env-vars.en.md b/landing/content/blog/switch-claude-code-api-without-env-vars.en.md index f5fc848b..06057773 100644 --- a/landing/content/blog/switch-claude-code-api-without-env-vars.en.md +++ b/landing/content/blog/switch-claude-code-api-without-env-vars.en.md @@ -13,7 +13,7 @@ clovapi models upstreams as **profiles** with two commands: ```bash npm i -g @clovapi/cli clovapi add --name deepseek -clovapi switch --cli claude-code deepseek +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat ``` `add` probes connectivity before saving; `switch` writes Claude Code config and routes traffic through the local proxy. The agent always talks to localhost — no need to memorize Anthropic env var combinations. @@ -33,7 +33,7 @@ Step-by-step guides: [Claude Code + DeepSeek](/guides/claude-code-deepseek) and Keep `official`, `deepseek`, and `openrouter-prod` side by side. To swap upstreams: ```bash -clovapi switch --cli claude-code openrouter-prod +clovapi switch --cli claude-code --vendor "Custom API" --model ``` No Claude Code reinstall, no shell `export` cleanup, no accidental keys in dotfiles. diff --git a/landing/content/blog/switch-claude-code-api-without-env-vars.zh-CN.md b/landing/content/blog/switch-claude-code-api-without-env-vars.zh-CN.md index d30d1f2b..72e7497f 100644 --- a/landing/content/blog/switch-claude-code-api-without-env-vars.zh-CN.md +++ b/landing/content/blog/switch-claude-code-api-without-env-vars.zh-CN.md @@ -13,7 +13,7 @@ clovapi 把上游抽象为 **profile**,用两条命令完成闭环: ```bash npm i -g @clovapi/cli clovapi add --name deepseek -clovapi switch --cli claude-code deepseek +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat ``` `add` 在持久化前会探测连通性;`switch` 把 profile 写入 Claude Code 所需配置,并经由本地代理转发请求。Agent 侧始终连 localhost,无需你记住 Anthropic 环境变量组合。 @@ -33,7 +33,7 @@ clovapi switch --cli claude-code deepseek 你可以同时保存 `official`、`deepseek`、`openrouter-prod` 等 profile。需要换上游时: ```bash -clovapi switch --cli claude-code openrouter-prod +clovapi switch --cli claude-code --vendor "Custom API" --model ``` 不需要卸载 Claude Code、不需要清理 shell profile 里的 export,也不会误把 Key 提交进 dotfiles。 diff --git a/landing/content/blog/switch-opencode-upstream-with-clovapi.en.md b/landing/content/blog/switch-opencode-upstream-with-clovapi.en.md index 97e26dcc..6828c004 100644 --- a/landing/content/blog/switch-opencode-upstream-with-clovapi.en.md +++ b/landing/content/blog/switch-opencode-upstream-with-clovapi.en.md @@ -8,7 +8,7 @@ date: 2026-05-26 ## What clovapi does for OpenCode -Running `clovapi switch --cli opencode ` will: +Running `clovapi switch --cli opencode ` will: 1. Resolve OpenCode’s **global** config directory (Windows: `%AppData%\opencode\` first, else `~/.config/opencode/`). 2. Pick or create `opencode.jsonc` (or an existing `opencode.json` / `config.json`). @@ -22,22 +22,22 @@ If a switch “does nothing”, check for project-level `opencode.json` override ```bash npm i -g @clovapi/cli clovapi add --name my-gateway -clovapi switch --cli opencode my-gateway +clovapi switch --cli opencode "Custom API/" ``` -During `add`, confirm the API style (Anthropic-compatible, OpenAI-compatible, Gemini, …). `switch` maps it into OpenCode’s provider layout. Keep multiple profiles and swap by name. +During `add`, confirm the API style (Anthropic-compatible, OpenAI-compatible, Gemini, ...). `switch` maps the selected vendor/model binding into OpenCode’s provider layout. Keep multiple models and swap the binding. ## Alongside other CLIs OpenCode is one supported CLI among several: ```bash -clovapi switch --cli claude-code deepseek -clovapi switch --cli codex openrouter-prod -clovapi switch --cli opencode my-gateway +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat +clovapi switch --cli codex --vendor "Custom API" --model +clovapi switch --cli opencode "Custom API/" ``` -`clovapi list` shows the active profile per CLI and the API-style matrix. +`clovapi list` shows the active vendor/model binding per CLI and the API-style matrix. ## Read more diff --git a/landing/content/blog/switch-opencode-upstream-with-clovapi.zh-CN.md b/landing/content/blog/switch-opencode-upstream-with-clovapi.zh-CN.md index d3e0f366..46e097c9 100644 --- a/landing/content/blog/switch-opencode-upstream-with-clovapi.zh-CN.md +++ b/landing/content/blog/switch-opencode-upstream-with-clovapi.zh-CN.md @@ -8,7 +8,7 @@ date: 2026-05-26 ## clovapi 如何写入 OpenCode -执行 `clovapi switch --cli opencode ` 时,clovapi 会: +执行 `clovapi switch --cli opencode ` 时,clovapi 会: 1. 定位 OpenCode **全局**配置目录(Windows 优先 `%AppData%\opencode\`,否则 `~/.config/opencode/`)。 2. 在 `opencode.jsonc` / `opencode.json` / `config.json` 中选择已有文件或创建 `opencode.jsonc`。 @@ -22,22 +22,22 @@ date: 2026-05-26 ```bash npm i -g @clovapi/cli clovapi add --name my-gateway -clovapi switch --cli opencode my-gateway +clovapi switch --cli opencode "Custom API/" ``` -`add` 阶段选择或确认 API 形态(Anthropic 兼容、OpenAI 兼容、Gemini 等),`switch` 会映射到 OpenCode 的 provider 结构。多个 profile 可并存,切换只需改 profile 名。 +`add` 阶段选择或确认 API 形态(Anthropic 兼容、OpenAI 兼容、Gemini 等),`switch` 会把选中的 vendor/model 绑定映射到 OpenCode 的 provider 结构。多个模型可并存,切换只需改绑定。 ## 与其他 CLI 并列管理 OpenCode 只是 clovapi 支持的 CLI 之一。同一台机器上你还可以: ```bash -clovapi switch --cli claude-code deepseek -clovapi switch --cli codex openrouter-prod -clovapi switch --cli opencode my-gateway +clovapi switch --cli claude-code --vendor "Custom API" --model deepseek-chat +clovapi switch --cli codex --vendor "Custom API" --model +clovapi switch --cli opencode "Custom API/" ``` -`clovapi list` 会展示各 CLI 当前绑定的 profile 与 API 形态矩阵。 +`clovapi list` 会展示各 CLI 当前绑定的 vendor/model 与 API 形态矩阵。 ## 延伸阅读 diff --git a/landing/public/llms.txt b/landing/public/llms.txt index 2a956389..9d9d001d 100644 --- a/landing/public/llms.txt +++ b/landing/public/llms.txt @@ -32,7 +32,7 @@ ## CLI 工作流 - 安装: npm i -g @clovapi/cli - 保存 profile: clovapi add --name -- 下发到 CLI: clovapi switch --cli [PROFILE] +- 下发到 CLI: clovapi switch --cli --vendor "Custom API" --model - 本地代理: clovapi proxy start ## 与 cc-switch 对比 diff --git a/landing/src/components/agents/agent-guide-content.tsx b/landing/src/components/agents/agent-guide-content.tsx index b2ba8f0a..4816d573 100644 --- a/landing/src/components/agents/agent-guide-content.tsx +++ b/landing/src/components/agents/agent-guide-content.tsx @@ -22,7 +22,7 @@ export function AgentGuideContent({ agent }: AgentGuideContentProps) { const workflowLines = [ "npm i -g @clovapi/cli", "clovapi add --name prod", - `clovapi switch --cli ${agent.cliFlag} prod`, + `clovapi switch --cli ${agent.cliFlag} --vendor "Custom API" --model `, ]; const relatedGuides = guidesForAgent(agent.slug); diff --git a/landing/src/components/home/hero.tsx b/landing/src/components/home/hero.tsx index 4fb37dd2..2731ed43 100644 --- a/landing/src/components/home/hero.tsx +++ b/landing/src/components/home/hero.tsx @@ -13,7 +13,7 @@ import styles from "@/app/page.module.css"; const WORKFLOW_LINES = [ { prompt: true, text: "npm i -g @clovapi/cli" }, { prompt: true, text: "clovapi add --name prod" }, - { prompt: true, text: "clovapi switch --cli claude-code prod" }, + { prompt: true, text: 'clovapi switch --cli claude-code --vendor "Custom API" --model ' }, ] as const; export function HomeHero() { diff --git a/landing/src/lib/guides-data.ts b/landing/src/lib/guides-data.ts index e3be1001..a1175377 100644 --- a/landing/src/lib/guides-data.ts +++ b/landing/src/lib/guides-data.ts @@ -53,8 +53,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "切换到 Claude Code", - body: "将 profile 下发到 Claude Code 配置。之后启动 claude 即走该上游。", - command: "clovapi switch --cli claude-code my-api", + body: "将 Custom API 下的模型绑定下发到 Claude Code 配置。之后启动 claude 即走该上游。", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model ", }, ], tips: "可同时保存多个 profile(官方订阅、不同第三方),随时 switch 切换。详见 /agents/claude-code。", @@ -80,7 +80,7 @@ const GUIDE_CONTENT: Record> = { { title: "应用到 Claude Code", body: "switch 时 clovapi 会选择 anthropic API 形态写入 Claude Code。", - command: "clovapi switch --cli claude-code deepseek", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model deepseek-chat", }, ], tips: "DeepSeek 端点需支持 Claude Code 所需的 Messages 协议;若连通性探测失败,请检查 Base URL 与模型 ID。", @@ -105,8 +105,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "切换到 Claude Code", - body: "下发 profile 到 Claude Code。", - command: "clovapi switch --cli claude-code openrouter", + body: "下发 OpenRouter 模型绑定到 Claude Code。", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model ", }, ], tips: "OpenRouter 模型 slug 可在 OpenRouter 文档中查询;切换官方订阅时只需 switch 到对应 subscription profile。", @@ -131,8 +131,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "切换到 Claude Code", - body: "一行命令写入 Claude Code 配置。", - command: "clovapi switch --cli claude-code siliconflow", + body: "一行命令写入 Claude Code 的模型绑定。", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model ", }, ], tips: "请确认所选 SiliconFlow 模型支持 Anthropic Messages 兼容模式;探测失败时检查 API 权限与模型 ID。", @@ -157,8 +157,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "切换到 Codex", - body: "将 profile 应用到 Codex CLI。", - command: "clovapi switch --cli codex codex-api", + body: "将模型绑定应用到 Codex CLI。", + command: "clovapi switch --cli codex --vendor \"Custom API\" --model ", }, ], tips: "Codex 官方订阅也可作为 profile 保存,与第三方 API 同样 switch。详见 /agents/codex。", @@ -185,8 +185,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "Apply to Claude Code", - body: "Write the profile into Claude Code config. Launch claude with that upstream.", - command: "clovapi switch --cli claude-code my-api", + body: "Write the Custom API model binding into Claude Code config. Launch claude with that upstream.", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model ", }, ], tips: "Save multiple profiles (official subscription, different vendors) and switch anytime. See /agents/claude-code.", @@ -212,7 +212,7 @@ const GUIDE_CONTENT: Record> = { { title: "Apply to Claude Code", body: "clovapi picks the anthropic API style when switching to Claude Code.", - command: "clovapi switch --cli claude-code deepseek", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model deepseek-chat", }, ], tips: "The endpoint must support what Claude Code needs for Messages API. If the probe fails, verify base URL and model ID.", @@ -237,8 +237,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "Apply to Claude Code", - body: "Switch the profile into Claude Code.", - command: "clovapi switch --cli claude-code openrouter", + body: "Switch the OpenRouter model binding into Claude Code.", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model ", }, ], tips: "Look up model slugs in OpenRouter docs. Switch back to official subscription by selecting that profile instead.", @@ -263,8 +263,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "Apply to Claude Code", - body: "One command writes Claude Code config.", - command: "clovapi switch --cli claude-code siliconflow", + body: "One command writes the Claude Code model binding.", + command: "clovapi switch --cli claude-code --vendor \"Custom API\" --model ", }, ], tips: "Confirm the SiliconFlow model supports Anthropic Messages compatibility. If probing fails, check API permissions and model ID.", @@ -289,8 +289,8 @@ const GUIDE_CONTENT: Record> = { }, { title: "Apply to Codex", - body: "Switch the profile into Codex CLI.", - command: "clovapi switch --cli codex codex-api", + body: "Switch the model binding into Codex CLI.", + command: "clovapi switch --cli codex --vendor \"Custom API\" --model ", }, ], tips: "Official Codex subscription profiles work the same way. See /agents/codex.", diff --git a/landing/src/lib/seo-data.ts b/landing/src/lib/seo-data.ts index c91500b9..09f03fc0 100644 --- a/landing/src/lib/seo-data.ts +++ b/landing/src/lib/seo-data.ts @@ -24,7 +24,7 @@ export const AGENT_PAGES: AgentPageDef[] = [ { slug: "opencode", cliFlag: "opencode", icon: "/agenticons/opencode.svg", apiStyleKey: "chatCompletions" }, { slug: "openclaw", cliFlag: "openclaw", icon: "/agenticons/opencode.svg", apiStyleKey: "chatCompletions" }, { slug: "hermes", cliFlag: "hermes", icon: "/agenticons/opencode.svg", apiStyleKey: "anthropicMessages" }, - { slug: "kimi-cli", cliFlag: "kimi-cli", icon: "/agenticons/opencode.svg", apiStyleKey: "chatCompletions" }, + { slug: "kimi-cli", cliFlag: "kimi-code", icon: "/agenticons/opencode.svg", apiStyleKey: "chatCompletions" }, ]; export function agentBySlug(slug: string): AgentPageDef | undefined { diff --git a/landing/src/lib/skill-markdown.ts b/landing/src/lib/skill-markdown.ts index 2b1a42ad..aa27a589 100644 --- a/landing/src/lib/skill-markdown.ts +++ b/landing/src/lib/skill-markdown.ts @@ -18,7 +18,7 @@ Site: ${baseUrl} \`\`\`bash npm i -g @clovapi/cli clovapi add --name prod -clovapi switch --cli claude-code prod +clovapi switch --cli claude-code --vendor "Custom API" --model \`\`\` Supported CLIs include Claude Code, Codex, OpenCode, OpenClaw, Hermes, and Kimi Code CLI.