Skip to content
Open
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
4 changes: 2 additions & 2 deletions electron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kind> <name>` to write Codex / OpenCode / etc. configs
- Bind each installed CLI to a vendor/model selection (`active` map in `profiles.json`)
- **应用** runs `clovapi switch --cli <kind> --vendor "<vendor>" --model <model-id>` to write Codex / OpenCode / etc. configs

## UI

Expand Down
8 changes: 4 additions & 4 deletions landing/content/blog/anthropic-oauth-ban-agent-workflow.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <model-id>
```

## Path B: API keys into OpenCode and other CLIs
Expand All @@ -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 <responses-model-id>
clovapi switch --cli opencode --vendor Ollama --model llama3.1
```

You change which upstream the active agent eats—not reinstall three env-var scripts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <model-id>
```

## 路径 B:API Key 进 OpenCode / 其他 CLI
Expand All @@ -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 <responses-model-id>
clovapi switch --cli opencode --vendor Ollama --model llama3.1
```

换的是「当前 Agent 吃哪条上游」,不是重装三套环境变量。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 路由表。

Expand Down
10 changes: 5 additions & 5 deletions landing/content/blog/codex-subscription-to-local-api.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <responses-model-id>
```

## 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 filepick 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/<responses-model-id>` 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

Expand Down
10 changes: 5 additions & 5 deletions landing/content/blog/codex-subscription-to-local-api.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <responses-model-id>
```

## 与 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/<responses-model-id>`。桌面端与 CLI 读写同一份配置,适合在 GUI 里点选、在终端里脚本化。

## 延伸阅读

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <model-id>
claude
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <model-id>
claude
```

Expand Down
6 changes: 3 additions & 3 deletions landing/content/blog/desktop-app-vs-cli-workflow.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ 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 <responses-model-id>` 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:

```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 <model-id>
```

## Mixing both is fine
Expand Down
6 changes: 3 additions & 3 deletions landing/content/blog/desktop-app-vs-cli-workflow.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ 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 <responses-model-id>`。
- **快速切换**:已熟悉 vendor 与 model ID 时,一条命令比打开 GUI 更快。
- **与现有终端工作流共存**:配合 tmux、Makefile、`clovapi update` 自更新等。

安装:

```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 <model-id>
```

## 可以混用
Expand Down
6 changes: 3 additions & 3 deletions landing/content/blog/manage-multiple-api-profiles.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 <responses-model-id>
```

`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.
Expand Down
6 changes: 3 additions & 3 deletions landing/content/blog/manage-multiple-api-profiles.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 <responses-model-id>
```

`add` 在写入前会探测连通性,避免保存无效 Key。`switch` 只影响**一个** CLI——不会误改 Codex 当你只想换 Claude Code。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <responses-model-id>
```

## Versus “router” projects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <responses-model-id>
```

## 和「路由器」项目的差异
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <model-id>
```

`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**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <model-id>
```

`list` 输出会显示矩阵:每个 CLI 支持哪些 API 形态、当前绑定谁。这与社区里「AgentHub / Hermes 的 `/model --provider`」诉求类似,但 clovapi 更贴近 **已存在的 Claude/Codex/OpenCode 官方配置路径**。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 <openrouter-model-slug>
```

No Claude Code reinstall, no shell `export` cleanup, no accidental keys in dotfiles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 环境变量组合。
Expand All @@ -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 <openrouter-model-slug>
```

不需要卸载 Claude Code、不需要清理 shell profile 里的 export,也不会误把 Key 提交进 dotfiles。
Expand Down
14 changes: 7 additions & 7 deletions landing/content/blog/switch-opencode-upstream-with-clovapi.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ date: 2026-05-26

## What clovapi does for OpenCode

Running `clovapi switch --cli opencode <profile>` will:
Running `clovapi switch --cli opencode <VENDOR/MODEL>` 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`).
Expand All @@ -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/<model-id>"
```

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 <responses-model-id>
clovapi switch --cli opencode "Custom API/<model-id>"
```

`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

Expand Down
Loading