From e7540395da8b2c751e8909626d79acaaf88f5405 Mon Sep 17 00:00:00 2001 From: 7Sageer <7sageer@djwcb.cn> Date: Tue, 26 May 2026 13:31:57 +0800 Subject: [PATCH 1/5] docs: document /connect command and model catalog Add a /connect row to the slash-commands reference (English and Chinese) and a new "/connect and the model catalog" section in providers.md that covers the bundled catalog, --refresh, --url, and the relationship with hand-written config.toml entries. --- docs/en/configuration/providers.md | 13 +++++++++++++ docs/en/reference/slash-commands.md | 1 + docs/zh/configuration/providers.md | 13 +++++++++++++ docs/zh/reference/slash-commands.md | 1 + 4 files changed, 28 insertions(+) diff --git a/docs/en/configuration/providers.md b/docs/en/configuration/providers.md index a7319dd17e..3dc245902e 100644 --- a/docs/en/configuration/providers.md +++ b/docs/en/configuration/providers.md @@ -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` lets you pick a provider, pick a model, enter an API key, and writes the resulting `[providers.]` and `[models.]` entries to `config.toml` for you. + +The default catalog is bundled with the CLI, so `/connect` works offline. Two flags adjust where the catalog comes from: + +- `/connect --refresh` fetches the latest catalog from [models.dev](https://models.dev/) before showing the picker. +- `/connect --url=` reads from a custom catalog endpoint that follows the same format. Only `http://` and `https://` URLs are accepted. + +`/connect` only offers the provider types listed in the table above. For provider types not covered by the catalog, 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.]` entry from `config.toml`. + ## `kimi` `kimi` connects to the Moonshot AI API using the OpenAI-compatible protocol. diff --git a/docs/en/reference/slash-commands.md b/docs/en/reference/slash-commands.md index b8aed90472..88339ff26e 100644 --- a/docs/en/reference/slash-commands.md +++ b/docs/en/reference/slash-commands.md @@ -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=]` | — | Configure a provider and model from a model catalog. The default catalog is bundled with the CLI; pass `--refresh` to fetch the latest from models.dev, or `--url` to use a custom catalog endpoint. 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 | diff --git a/docs/zh/configuration/providers.md b/docs/zh/configuration/providers.md index bb7e79d78c..54ccf0015b 100644 --- a/docs/zh/configuration/providers.md +++ b/docs/zh/configuration/providers.md @@ -29,6 +29,19 @@ ANTHROPIC_BASE_URL = "https://my-proxy.example.com" 切换供应商最常见的方式有两种:在 TUI 里用 `/model` 斜杠命令选择已配置的模型,或者直接编辑 `config.toml` 调整 `[providers.*]` 与 `[models.*]` 表。完整字段说明见 [配置文件](./config-files.md)。 +## `/connect` 与模型 catalog + +除了在 `config.toml` 里手写 `[providers.*]` 与 `[models.*]` 表外,也可以在 TUI 内运行 `/connect` 斜杠命令,从 **模型 catalog** 中添加供应商。catalog 列出了已知的供应商与模型,以及它们的上下文长度、输出长度和能力;`/connect` 让你挑选供应商、挑选模型、填入 API 密钥,然后把对应的 `[providers.]` 与 `[models.]` 写回 `config.toml`。 + +默认 catalog 随 CLI 内置,因此 `/connect` 离线可用。两个 flag 用来切换 catalog 来源: + +- `/connect --refresh`:在显示选择器前,从 [models.dev](https://models.dev/) 拉取最新 catalog。 +- `/connect --url=`:从自定义 catalog 端点读取(要求遵循同一格式)。只接受 `http://` 或 `https://` 的 URL。 + +`/connect` 只会呈现上表所列的供应商类型;catalog 未覆盖的供应商类型,请按下面各小节的说明,在 `config.toml` 里手写配置。 + +`/logout` 同样适用于通过 `/connect` 配置的供应商:执行后会从 `config.toml` 移除对应的 `[providers.]` 表项。 + ## `kimi` `kimi` 通过 OpenAI 兼容协议对接 Moonshot AI。 diff --git a/docs/zh/reference/slash-commands.md b/docs/zh/reference/slash-commands.md index ddecaed216..5717854a8a 100644 --- a/docs/zh/reference/slash-commands.md +++ b/docs/zh/reference/slash-commands.md @@ -14,6 +14,7 @@ | --- | --- | --- | --- | | `/login` | — | 选择账号或平台并登录:Kimi Code 走 OAuth device code 流程,Moonshot AI 开放平台通过 API 密钥登录。 | 否 | | `/logout` | — | 清除当前所选账号的凭据(Kimi Code OAuth 凭据,或对应开放平台的供应商配置)。 | 否 | +| `/connect [--refresh] [--url=]` | — | 从模型 catalog 配置一个供应商和模型。默认 catalog 随 CLI 内置;附加 `--refresh` 可从 models.dev 拉取最新数据,附加 `--url` 可指向自定义 catalog 端点。详见 [平台与模型 — `/connect` 与模型 catalog](../configuration/providers.md#connect-与模型-catalog)。 | 否 | | `/model` | — | 切换当前会话使用的 LLM 模型。 | 是 | | `/settings` | `/config` | 打开 TUI 内的设置面板。 | 是 | | `/permission` | — | 选择权限模式(permission mode)。 | 是 | From bee9c371878c6d77aba625391a5deb958c7ef9d0 Mon Sep 17 00:00:00 2001 From: 7Sageer <7sageer@djwcb.cn> Date: Tue, 26 May 2026 13:32:03 +0800 Subject: [PATCH 2/5] chore(changeset): trim /connect changesets to user-facing wording Drop internal phrasing (pruned snapshot, "not gated by models.dev", fallback mechanics, and the Anthropic catalog base URL path fix that landed alongside the initial /connect implementation) so the release notes describe behavior users can observe, not implementation details. --- .changeset/connect-model-catalog.md | 2 +- .changeset/connect-picker-search-pagination.md | 2 +- .changeset/model-picker-empty-hint.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/connect-model-catalog.md b/.changeset/connect-model-catalog.md index 8d55db8b99..b2ededf733 100644 --- a/.changeset/connect-model-catalog.md +++ b/.changeset/connect-model-catalog.md @@ -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. The default catalog is bundled with the CLI, so `/connect` works offline; pass `--refresh` to fetch the latest catalog from models.dev, or `--url` to point at a custom catalog. Model metadata (context window, output limit, capabilities) is filled in from the catalog, so models no longer need to be written by hand in config. diff --git a/.changeset/connect-picker-search-pagination.md b/.changeset/connect-picker-search-pagination.md index 144a3b4130..1bf760d93a 100644 --- a/.changeset/connect-picker-search-pagination.md +++ b/.changeset/connect-picker-search-pagination.md @@ -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. diff --git a/.changeset/model-picker-empty-hint.md b/.changeset/model-picker-empty-hint.md index 2b37cac954..e1e7bc3743 100644 --- a/.changeset/model-picker-empty-hint.md +++ b/.changeset/model-picker-empty-hint.md @@ -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). From 84adea1960151e4a2034864c1795addb5de81f99 Mon Sep 17 00:00:00 2001 From: 7Sageer <7sageer@djwcb.cn> Date: Tue, 26 May 2026 13:46:11 +0800 Subject: [PATCH 3/5] docs(zh): translate "catalog/flag/endpoint" in /connect section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rework the Chinese wording for the /connect docs: render "model catalog" as "模型目录" (with the English term in parentheses on first use), drop the leftover English "flag"/"endpoint" usage, and smooth out the translationese in the surrounding sentences. Update the cross-link anchor in slash-commands.md to match the new Chinese heading. --- docs/zh/configuration/providers.md | 14 +++++++------- docs/zh/reference/slash-commands.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/zh/configuration/providers.md b/docs/zh/configuration/providers.md index 54ccf0015b..c06be3e08f 100644 --- a/docs/zh/configuration/providers.md +++ b/docs/zh/configuration/providers.md @@ -29,18 +29,18 @@ ANTHROPIC_BASE_URL = "https://my-proxy.example.com" 切换供应商最常见的方式有两种:在 TUI 里用 `/model` 斜杠命令选择已配置的模型,或者直接编辑 `config.toml` 调整 `[providers.*]` 与 `[models.*]` 表。完整字段说明见 [配置文件](./config-files.md)。 -## `/connect` 与模型 catalog +## `/connect` 与模型目录 -除了在 `config.toml` 里手写 `[providers.*]` 与 `[models.*]` 表外,也可以在 TUI 内运行 `/connect` 斜杠命令,从 **模型 catalog** 中添加供应商。catalog 列出了已知的供应商与模型,以及它们的上下文长度、输出长度和能力;`/connect` 让你挑选供应商、挑选模型、填入 API 密钥,然后把对应的 `[providers.]` 与 `[models.]` 写回 `config.toml`。 +除了在 `config.toml` 中手写 `[providers.*]` 与 `[models.*]` 表,你也可以在 TUI 中运行 `/connect` 斜杠命令,从 **模型目录**(model catalog)添加供应商。模型目录记录了已知的供应商和模型,以及它们的上下文长度、输出长度和能力。`/connect` 会引导你选择供应商、选择模型、输入 API 密钥,然后把对应的 `[providers.]` 与 `[models.]` 写入 `config.toml`。 -默认 catalog 随 CLI 内置,因此 `/connect` 离线可用。两个 flag 用来切换 catalog 来源: +CLI 已经内置了默认的模型目录,因此 `/connect` 无需联网即可使用。如果想换用别的来源,可以传入以下参数: -- `/connect --refresh`:在显示选择器前,从 [models.dev](https://models.dev/) 拉取最新 catalog。 -- `/connect --url=`:从自定义 catalog 端点读取(要求遵循同一格式)。只接受 `http://` 或 `https://` 的 URL。 +- `/connect --refresh`:在打开选择器之前,从 [models.dev](https://models.dev/) 拉取最新模型目录。 +- `/connect --url=`:从自定义地址读取模型目录(格式需与默认目录一致),只接受 `http://` 或 `https://` 的 URL。 -`/connect` 只会呈现上表所列的供应商类型;catalog 未覆盖的供应商类型,请按下面各小节的说明,在 `config.toml` 里手写配置。 +`/connect` 只能配置上表列出的供应商类型;不在目录范围内的供应商类型,请按下面各小节的说明,在 `config.toml` 中手写配置。 -`/logout` 同样适用于通过 `/connect` 配置的供应商:执行后会从 `config.toml` 移除对应的 `[providers.]` 表项。 +对通过 `/connect` 配置的供应商,`/logout` 同样有效:它会从 `config.toml` 中删除对应的 `[providers.]` 配置块。 ## `kimi` diff --git a/docs/zh/reference/slash-commands.md b/docs/zh/reference/slash-commands.md index 5717854a8a..3c4da2906d 100644 --- a/docs/zh/reference/slash-commands.md +++ b/docs/zh/reference/slash-commands.md @@ -14,7 +14,7 @@ | --- | --- | --- | --- | | `/login` | — | 选择账号或平台并登录:Kimi Code 走 OAuth device code 流程,Moonshot AI 开放平台通过 API 密钥登录。 | 否 | | `/logout` | — | 清除当前所选账号的凭据(Kimi Code OAuth 凭据,或对应开放平台的供应商配置)。 | 否 | -| `/connect [--refresh] [--url=]` | — | 从模型 catalog 配置一个供应商和模型。默认 catalog 随 CLI 内置;附加 `--refresh` 可从 models.dev 拉取最新数据,附加 `--url` 可指向自定义 catalog 端点。详见 [平台与模型 — `/connect` 与模型 catalog](../configuration/providers.md#connect-与模型-catalog)。 | 否 | +| `/connect [--refresh] [--url=]` | — | 从模型目录中选择并配置供应商与模型。CLI 已内置默认目录;传入 `--refresh` 可从 models.dev 拉取最新目录,传入 `--url` 可指向自定义目录地址。详见 [平台与模型 — `/connect` 与模型目录](../configuration/providers.md#connect-与模型目录)。 | 否 | | `/model` | — | 切换当前会话使用的 LLM 模型。 | 是 | | `/settings` | `/config` | 打开 TUI 内的设置面板。 | 是 | | `/permission` | — | 选择权限模式(permission mode)。 | 是 | From bea4f51feb0879122ddc6d03813729048cdc9902 Mon Sep 17 00:00:00 2001 From: 7Sageer <7sageer@djwcb.cn> Date: Tue, 26 May 2026 13:48:17 +0800 Subject: [PATCH 4/5] docs(en): tighten /connect wording Fix the subject/verb mismatch in the /connect step description (the sentence switched subjects mid-list), replace "endpoint" with the more accurate "URL" since the catalog source is a static JSON file, and clarify that /connect is limited to the provider types in the table above rather than to whatever the catalog happens to cover. --- docs/en/configuration/providers.md | 8 ++++---- docs/en/reference/slash-commands.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/en/configuration/providers.md b/docs/en/configuration/providers.md index 3dc245902e..09ddf0f5a9 100644 --- a/docs/en/configuration/providers.md +++ b/docs/en/configuration/providers.md @@ -31,14 +31,14 @@ The most common ways to switch providers are: use the `/model` slash command ins ## `/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` lets you pick a provider, pick a model, enter an API key, and writes the resulting `[providers.]` and `[models.]` entries to `config.toml` for you. +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.]` and `[models.]` entries to `config.toml`. -The default catalog is bundled with the CLI, so `/connect` works offline. Two flags adjust where the catalog comes from: +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=` reads from a custom catalog endpoint that follows the same format. Only `http://` and `https://` URLs are accepted. +- `/connect --url=` reads the catalog from a custom URL that follows the same format. Only `http://` and `https://` URLs are accepted. -`/connect` only offers the provider types listed in the table above. For provider types not covered by the catalog, configure them by hand in `config.toml` as described in the per-type sections below. +`/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.]` entry from `config.toml`. diff --git a/docs/en/reference/slash-commands.md b/docs/en/reference/slash-commands.md index 88339ff26e..2f65ff1146 100644 --- a/docs/en/reference/slash-commands.md +++ b/docs/en/reference/slash-commands.md @@ -14,7 +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=]` | — | Configure a provider and model from a model catalog. The default catalog is bundled with the CLI; pass `--refresh` to fetch the latest from models.dev, or `--url` to use a custom catalog endpoint. See [Providers and models — `/connect` and the model catalog](../configuration/providers.md#connect-and-the-model-catalog). | No | +| `/connect [--refresh] [--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 | From 436319376b662dc3e883ba094c080adfbfd0cbad Mon Sep 17 00:00:00 2001 From: 7Sageer <7sageer@djwcb.cn> Date: Tue, 26 May 2026 14:07:40 +0800 Subject: [PATCH 5/5] chore(changeset): keep connect-model-catalog changelog to one line Defer --refresh, --url, and metadata details to the new docs section (`/connect` and the model catalog in configuration/providers.md). The changelog now just announces the command exists. --- .changeset/connect-model-catalog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/connect-model-catalog.md b/.changeset/connect-model-catalog.md index b2ededf733..7936033e32 100644 --- a/.changeset/connect-model-catalog.md +++ b/.changeset/connect-model-catalog.md @@ -4,4 +4,4 @@ "@moonshot-ai/kimi-code": minor --- -Add a `/connect` command that configures a provider and model from a model catalog. The default catalog is bundled with the CLI, so `/connect` works offline; pass `--refresh` to fetch the latest catalog from models.dev, or `--url` to point at a custom catalog. Model metadata (context window, output limit, capabilities) is filled in from the catalog, so models no longer need to be written by hand in config. +Add a `/connect` command that configures a provider and model from a model catalog.