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
2 changes: 1 addition & 1 deletion .changeset/connect-model-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"@moonshot-ai/kimi-code": minor
---

Add a `/connect` command that configures a provider and model from a model catalog. By default it reads from a pruned catalog snapshot bundled with the CLI, so the command works offline and is not gated by models.dev availability. Model metadata (context window, output limit, and capabilities) is filled in automatically, so models no longer need to be written by hand in config. Pass `--refresh` to fetch the latest catalog from models.dev (falling back to the bundled snapshot on failure), or `--url` to point at a custom catalog endpoint that uses the same format. When connecting an Anthropic-compatible provider whose catalog base URL already includes a version segment, the request path no longer duplicates that segment, so connections that previously failed with a not-found error now succeed.
Add a `/connect` command that configures a provider and model from a model catalog.
2 changes: 1 addition & 1 deletion .changeset/connect-picker-search-pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@moonshot-ai/kimi-code": minor
---

The `/connect` provider and model pickers now support type-to-search filtering, and long selection lists are paginated instead of rendering every entry at once. The model picker also paginates when many models are configured.
The `/connect` provider and model pickers now support type-to-search filtering, and long lists are paginated. The `/model` picker is also paginated when many models are configured.
2 changes: 1 addition & 1 deletion .changeset/model-picker-empty-hint.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@moonshot-ai/kimi-code": patch
---

Show a hint pointing to /login (Kimi) and /connect (other providers) when /model is opened with no configured models, and surface the same hint on the welcome panel when no model is set.
When no models are configured, `/model` and the welcome panel now point users to `/login` (for Kimi) and `/connect` (for other providers).
13 changes: 13 additions & 0 deletions docs/en/configuration/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ ANTHROPIC_BASE_URL = "https://my-proxy.example.com"

The most common ways to switch providers are: use the `/model` slash command inside the TUI to pick from already-configured models, or edit `config.toml` directly to adjust the `[providers.*]` and `[models.*]` tables. See [Config files](./config-files.md) for the full field reference.

## `/connect` and the model catalog

Instead of writing `[providers.*]` and `[models.*]` tables by hand, run the `/connect` slash command inside the TUI to add a provider from a **model catalog**. The catalog lists known providers and models together with their context window, output limit, and capabilities. `/connect` prompts you to pick a provider and a model, asks for an API key, and writes the resulting `[providers.<name>]` and `[models.<alias>]` entries to `config.toml`.

The default catalog is bundled with the CLI, so `/connect` works offline. Two flags change the catalog source:

- `/connect --refresh` fetches the latest catalog from [models.dev](https://models.dev/) before showing the picker.
- `/connect --url=<catalog-url>` reads the catalog from a custom URL that follows the same format. Only `http://` and `https://` URLs are accepted.

`/connect` only configures the provider types listed in the table above. For other provider types, configure them by hand in `config.toml` as described in the per-type sections below.

`/logout` works on `/connect`-configured providers too: it removes the corresponding `[providers.<name>]` entry from `config.toml`.

## `kimi`

`kimi` connects to the Moonshot AI API using the OpenAI-compatible protocol.
Expand Down
1 change: 1 addition & 0 deletions docs/en/reference/slash-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Some commands are only available in the idle state. Running them while the sessi
| --- | --- | --- | --- |
| `/login` | — | Pick an account or platform and sign in: Kimi Code uses the OAuth device code flow, while the Moonshot AI Open Platform signs in with an API key. | No |
| `/logout` | — | Clear the credentials of the currently selected account (Kimi Code OAuth credentials, or the corresponding open platform provider config). | No |
| `/connect [--refresh] [--url=<catalog-url>]` | — | Configure a provider and model from a model catalog. The default catalog is bundled with the CLI; pass `--refresh` to fetch the latest catalog from models.dev, or `--url` to read it from a custom URL. See [Providers and models — `/connect` and the model catalog](../configuration/providers.md#connect-and-the-model-catalog). | No |
| `/model` | — | Switch the LLM model used by the current session. | Yes |
| `/settings` | `/config` | Open the settings panel inside the TUI. | Yes |
| `/permission` | — | Choose a permission mode. | Yes |
Expand Down
13 changes: 13 additions & 0 deletions docs/zh/configuration/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ ANTHROPIC_BASE_URL = "https://my-proxy.example.com"

切换供应商最常见的方式有两种:在 TUI 里用 `/model` 斜杠命令选择已配置的模型,或者直接编辑 `config.toml` 调整 `[providers.*]` 与 `[models.*]` 表。完整字段说明见 [配置文件](./config-files.md)。

## `/connect` 与模型目录

除了在 `config.toml` 中手写 `[providers.*]` 与 `[models.*]` 表,你也可以在 TUI 中运行 `/connect` 斜杠命令,从 **模型目录**(model catalog)添加供应商。模型目录记录了已知的供应商和模型,以及它们的上下文长度、输出长度和能力。`/connect` 会引导你选择供应商、选择模型、输入 API 密钥,然后把对应的 `[providers.<name>]` 与 `[models.<alias>]` 写入 `config.toml`。

CLI 已经内置了默认的模型目录,因此 `/connect` 无需联网即可使用。如果想换用别的来源,可以传入以下参数:

- `/connect --refresh`:在打开选择器之前,从 [models.dev](https://models.dev/) 拉取最新模型目录。
- `/connect --url=<catalog-url>`:从自定义地址读取模型目录(格式需与默认目录一致),只接受 `http://` 或 `https://` 的 URL。

`/connect` 只能配置上表列出的供应商类型;不在目录范围内的供应商类型,请按下面各小节的说明,在 `config.toml` 中手写配置。

对通过 `/connect` 配置的供应商,`/logout` 同样有效:它会从 `config.toml` 中删除对应的 `[providers.<name>]` 配置块。

## `kimi`

`kimi` 通过 OpenAI 兼容协议对接 Moonshot AI。
Expand Down
1 change: 1 addition & 0 deletions docs/zh/reference/slash-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| --- | --- | --- | --- |
| `/login` | — | 选择账号或平台并登录:Kimi Code 走 OAuth device code 流程,Moonshot AI 开放平台通过 API 密钥登录。 | 否 |
| `/logout` | — | 清除当前所选账号的凭据(Kimi Code OAuth 凭据,或对应开放平台的供应商配置)。 | 否 |
| `/connect [--refresh] [--url=<catalog-url>]` | — | 从模型目录中选择并配置供应商与模型。CLI 已内置默认目录;传入 `--refresh` 可从 models.dev 拉取最新目录,传入 `--url` 可指向自定义目录地址。详见 [平台与模型 — `/connect` 与模型目录](../configuration/providers.md#connect-与模型目录)。 | 否 |
| `/model` | — | 切换当前会话使用的 LLM 模型。 | 是 |
| `/settings` | `/config` | 打开 TUI 内的设置面板。 | 是 |
| `/permission` | — | 选择权限模式(permission mode)。 | 是 |
Expand Down
Loading