docs(zh): improve CLI section — env-vars, mcp, interaction, datasource, and more#372
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abdf74ad07
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| 1. **定位配置文件**:`KIMI_CODE_HOME` 决定数据根目录,配置文件路径因此变为 `$KIMI_CODE_HOME/config.toml`。这一步先于其他所有解析,不是普通参数的后备来源。 | ||
| 2. **运行时开关**:`KIMI_DISABLE_TELEMETRY` 等少量变量直接关闭对应子系统——即使 `config.toml` 里 `telemetry = true`,只要这个变量是真值,遥测就会被禁用。语义是"额外禁用",不是"普通覆盖"。 | ||
| 3. **运行端点与诊断**:`KIMI_CODE_OAUTH_HOST`、`KIMI_CODE_BASE_URL`、`KIMI_LOG_LEVEL` 等在 OAuth 或日志子系统初始化时读取。完整列表见[环境变量](./environment-variables.md)。 |
There was a problem hiding this comment.
Point internal docs links at existing slugs
This link now targets ./environment-variables.md, but the page in this VitePress docs tree is still docs/zh/configuration/env-vars.md; similarly, this commit introduces many configuration-files.md, providers-and-models.md, and overrides-and-precedence.md links while the actual files are config-files.md, providers.md, and overrides.md. In the generated docs these links resolve to missing pages, so readers following the cross-references from the updated Chinese docs hit 404s instead of the referenced sections.
Useful? React with 👍 / 👎.
| 1. 在 Kimi Code CLI 内运行 `/plugin` | ||
| 2. 在弹出的菜单中选择 **Marketplace** | ||
| 3. 找到 **Kimi Datasource**,选择安装 | ||
| 4. 安装完成后运行 `/new` 开启新会话,再次运行 `/plugin` 确认插件状态为已安装 |
There was a problem hiding this comment.
Use the actual
/plugins command
The installation steps tell users to run /plugin, but the slash-command registry only defines plugins and gives it no aliases (apps/kimi-code/src/tui/commands/registry.ts lines 104-105), and the dispatcher only handles the plugins command. Following these steps will therefore produce an unknown slash command instead of opening the plugin manager; this should be /plugins in both places.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,93 @@ | |||
| # 官方插件 | |||
There was a problem hiding this comment.
Wire new docs page into the mirrored docs tree
This adds a new Chinese docs page, but I checked docs/.vitepress/config.ts and docs/en/customization/: the page has no sidebar entry in the actual VitePress config and no English mirror. The docs/AGENTS.md guide requires non-changelog pages to be mirrored across docs/en and docs/zh and any new page to be wired for both locales, so as committed this page is orphaned in the built docs and has no locale counterpart.
Useful? React with 👍 / 👎.
| | `custom_headers` | `table<string, string>` | 否 | 请求时附加的自定义 HTTP 头 | | ||
| | `default_model` | `string` | — | 默认模型别名,必须在 `models` 中定义 | | ||
| | `default_thinking` | `boolean` | `false` | 新会话是否默认开启 Thinking(深度推理)模式;可在会话内从模型菜单切换。即使设为 `true`,`[thinking].mode = "off"` 也会强制关闭 | | ||
| | `default_permission_mode` | `string` | `manual` | 新会话的默认权限模式,可选 `manual`(逐次询问)、`auto`(自动批准读操作)、`yolo`(全部自动批准) | |
There was a problem hiding this comment.
Describe auto mode as approving writes too
auto is described here as automatically approving only read operations, but the permission policy denies AskUserQuestion and configured/plan-blocked calls first, then AutoModeApprovePermissionPolicy approves the remaining tool calls regardless of whether they write files or run Bash. Users setting default_permission_mode = "auto" from this table may expect writes and shell commands to still ask, when they will not.
Useful? React with 👍 / 👎.
|
|
||
| ::: tip 例外 | ||
| **内置工具缓存**(例如自动下载的 ripgrep 二进制)不走 `KIMI_CODE_HOME`,而是走 `KIMI_CODE_CACHE_DIR`;未设置时使用平台缓存目录——macOS 上是 `~/Library/Caches/kimi-code`,Linux 上是 `$XDG_CACHE_HOME/kimi-code`(缺省 `~/.cache/kimi-code`),Windows 上是 `%LOCALAPPDATA%\kimi-code`。 | ||
| **内置工具缓存**(ripgrep 二进制)走的是 `KIMI_CODE_CACHE_DIR`,未设时使用平台缓存目录:macOS 的 `~/Library/Caches/kimi-code`、Linux 的 `~/.cache/kimi-code`、Windows 的 `%LOCALAPPDATA%\kimi-code`。 |
There was a problem hiding this comment.
Remove unsupported KIMI_CODE_CACHE_DIR guidance
This says the ripgrep cache uses KIMI_CODE_CACHE_DIR and is unaffected by KIMI_CODE_HOME, but rg-locator only reads KIMI_CODE_HOME in getShareDir() and installs the binary under <shareDir>/bin/rg; there is no KIMI_CODE_CACHE_DIR reference in the repo. Users following this will set a no-op variable and still see the cache move with KIMI_CODE_HOME.
Useful? React with 👍 / 👎.
|
|
||
| **自主 Goal 模式(实验)**:输入 `/goal <目标>` 后,Kimi 会在多个轮次里持续推进同一个目标,直到完成、被暂停或遇到阻塞,省去了一轮一轮手动催的步骤。用 `/goal pause` / `/goal resume` / `/goal cancel` 管理进度,需提前设置 `KIMI_CODE_EXPERIMENTAL_GOAL_COMMAND=1` 启用。→ [自主 goal](/kimi-code-cli/reference/slash-commands#自主-goal实验功能) | ||
|
|
||
| **后台结构化提问**:Agent 遇到需要你做选择的问题时,会将提问挂到后台,同时继续处理其他步骤,不再因为一个小问题卡住整个流程。→ [AskUserQuestion](/kimi-code-cli/reference/tools#协作类) |
There was a problem hiding this comment.
Mark background questions as experimental
This presents background structured questions as generally available in v0.8.0, but the implementation is still gated by the background-ask experimental flag whose registry entry defaults to false, and AskUserQuestion only exposes/executes the background path when that flag is enabled. Users on the default build will not get this behavior unless they set KIMI_CODE_EXPERIMENTAL_BACKGROUND_ASK, so the release note should either mention the flag or avoid advertising it as always on.
Useful? React with 👍 / 👎.
abdf74a to
d1920af
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1920af195
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ::: tip 提示 | ||
| 如果你想使用 Anthropic、OpenAI、Google 等其他供应商,需要直接编辑 `config.toml` 配置 API 密钥,详见 [平台与模型](../configuration/providers.md)。模型、供应商等运行时配置也写入 `config.toml`。配置项说明见 [配置文件](../configuration/config-files.md)、[环境变量](../configuration/env-vars.md) 和 [配置覆盖](../configuration/overrides.md)。 | ||
| ::: tip 使用其他 AI 供应商 | ||
| 如果你想接入 Anthropic、OpenAI、Google 等其他供应商,需要直接编辑 `~/.kimi-code/config.toml` 配置 API 密钥,详见[平台与模型](./configuration/providers-and-models.md)。配置项完整说明见[配置文件](./configuration/configuration-files.md)、[环境变量](./configuration/environment-variables.md)和[配置覆盖](./configuration/overrides-and-precedence.md)。 |
There was a problem hiding this comment.
Restore the correct relative docs targets
On this guide page, these ./configuration/... links resolve under docs/zh/guides/configuration/, but I checked the docs tree and those files do not exist there; the actual Chinese configuration pages are under docs/zh/configuration/ with slugs like providers.md, config-files.md, env-vars.md, and overrides.md. Readers following the “其他 AI 供应商” tip therefore hit 404s instead of the referenced setup docs.
Useful? React with 👍 / 👎.
|
|
||
| ```sh | ||
| kimi --yolo | ||
| kimi --yolo -p "批量重命名以下文件..." |
There was a problem hiding this comment.
Avoid recommending a rejected CLI flag combination
This example combines --yolo with -p, but validateOptions rejects prompt mode when opts.yolo is true (Cannot combine --prompt with --yolo.), so users copying this batch example will get an immediate startup error instead of a non-interactive run. Use an interactive kimi --yolo example or a valid prompt-mode command without --yolo.
Useful? React with 👍 / 👎.
…omization, reference zh improvements: - interaction: add image/video paste, expand approval flow, Plan/YOLO/Auto modes - slash-commands: add /btw, /reload, /reload-tui - kimi-command: add kimi login, kimi acp subcommands - environment-variables: restructure with KIMI_CODE_HOME, KIMI_DISABLE_TELEMETRY, KIMI_MODEL_* sections - mcp: fix anchor link text - datasource: rewrite as official plugin page (new) - use-in-ides: ACP IDE integration for Zed/JetBrains (new) - kimi-acp: ACP capability matrix and method coverage (new) en: full zh→en translation of all 22 CLI pages, zh/en aligned Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
d1920af to
caa9661
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59d5efc1f6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| | `/reload` | — | Reload the current session and apply the latest `config.toml` settings (providers, models, etc.) and `tui.toml` UI preferences, without restarting the CLI | No | | ||
| | `/reload-tui` | — | Reload only the `tui.toml` UI preferences (theme, editor, notifications, etc.) without rebuilding the session | Yes | |
There was a problem hiding this comment.
Remove unsupported reload slash commands
This table now tells users to run /reload and /reload-tui, but I checked the slash-command registry and repo-wide command handlers: BUILTIN_SLASH_COMMANDS has no reload or reload-tui entries, and rg "reload-tui|name: 'reload'" apps/kimi-code/src packages only finds plugin-internal reload handling. In the TUI these rows document commands that are not registered, so users following them will hit the unknown-command path rather than reloading config.
Useful? React with 👍 / 👎.
|
|
||
| ## Next steps | ||
|
|
||
| - [Keyboard Shortcuts](./keyboard-shortcuts.md) — Quick reference for TUI keyboard operations |
There was a problem hiding this comment.
Point keyboard next-step link at the existing slug
This new next-step link targets ./keyboard-shortcuts.md, but the reference page in both locale trees is keyboard.md (rg --files docs/en/reference docs/zh/reference shows no keyboard-shortcuts.md). In the generated docs, readers following this link from the slash-command reference get a missing page instead of the keyboard shortcut reference.
Useful? React with 👍 / 👎.
| Active [Agent Skills](./customization/skills.md) are automatically registered as slash commands and invoked with `/skill:<name>`. If a skill name does not conflict with a built-in command, you can also drop the `skill:` prefix and type `/<name>` directly. | ||
|
|
||
| YOLO mode automatically approves most tool calls, skipping the approval step. Enter `/yolo` (or `/yes`) to toggle; available both idle and streaming. | ||
| Some commands are only available when the agent is idle — you need to press `Esc` to interrupt streaming output or context compression before using them. Mode-toggle and query commands like `/yolo`, `/plan`, `/help`, and `/btw` are always available. For the full list, see [Slash commands reference](./reference/slash-commands.md). |
There was a problem hiding this comment.
Fix guide links to leave the guides directory
These links now use ./customization/... and ./reference/... from a page under docs/en/guides, so VitePress resolves them under docs/en/guides/customization/ and docs/en/guides/reference/, which do not exist (rg --files docs/en/guides docs/en/customization docs/en/reference shows the targets are under ../customization and ../reference). Readers following the Skill or slash-command references from this guide will hit 404s instead of the referenced pages.
Useful? React with 👍 / 👎.
| @@ -1,227 +1,233 @@ | |||
| # kimi Command | |||
| # `kimi` Command | |||
There was a problem hiding this comment.
docs/AGENTS.md explicitly says “Do not change H1 titles or nav/sidebar labels,” but this commit changes this page title from # kimi Command to # kimi Command (and similar H1 rewrites occur across the docs). Please restore the existing H1 titles unless the nav/sidebar contract is intentionally being updated as well.
Useful? React with 👍 / 👎.
改动概述
对 CLI 文档中文版(
docs/zh/)的一批改进,涉及 20 个文件。主要变化如下:核心改动
docs/zh/configuration/env-vars.mdKIMI_CODE_HOME/KIMI_DISABLE_TELEMETRY/KIMI_MODEL_*,与开头提到的三个常用场景对应docs/zh/customization/mcp.mddocs/zh/guides/interaction.mddocs/zh/customization/datasource.md(新增)其他文件
其余 16 个文件(配置、参考手册、指南等)均为在上游版本基础上的内容改进,diff 可在 PR 中查看。