You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: restore Python source from fork point 3bad72e instead of main
The branch forked from 3bad72e, so src/kimi_cli/, docs/, tests/ and
other Python files should match that commit, not the latest main.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
-23Lines changed: 0 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,29 +11,6 @@ Only write entries that are worth mentioning to users.
11
11
12
12
## Unreleased
13
13
14
-
- ReadFile: Add total line count to every read response and support negative `line_offset` for tail mode — the tool now reports `Total lines in file: N.` in its message so the model can plan subsequent reads; negative `line_offset` (e.g. `-100`) reads the last N lines using a sliding window, useful for viewing recent log output without shell commands; the absolute value is capped at 1000 (MAX_LINES)
15
-
- Shell: Fix black background on inline code and code blocks in Markdown rendering — `NEUTRAL_MARKDOWN_THEME` now overrides all Rich default `markdown.*` styles to `"none"`, preventing Rich's built-in `"cyan on black"` from leaking through on non-black terminals
16
-
17
-
## 1.30.0 (2026-04-02)
18
-
19
-
- Shell: Refine idle background completion auto-trigger — resumed shell sessions no longer auto-start a foreground turn from stale pending background notifications before the user sends a message, and fresh background completions now wait briefly while the user is actively typing to avoid stealing the prompt or breaking CJK IME composition
20
-
- Core: Fix interrupted foreground turns leaving unbalanced wire events — `TurnEnd` is now emitted even when a turn exits via cancellation or step interruption, preventing dirty session wire logs from accumulating across resume cycles
21
-
- Core: Improve session startup resilience — `--continue`/`--resume` now tolerate malformed `context.jsonl` records and corrupted subagent, background-task, or notification artifacts; the CLI skips invalid persisted state where possible instead of failing to restore the session
22
-
- CLI: Improve `kimi export` session export UX — `kimi export` now previews the previous session for the current working directory and asks for confirmation, showing the session ID, title, and last user-message time; adds `--yes` to skip confirmation; also fixes explicit session-ID invocations where `--output` after the argument was incorrectly parsed as a subcommand
23
-
- Grep: Add `include_ignored` parameter to search files excluded by `.gitignore` — when set to `true`, ripgrep's `--no-ignore` flag is enabled, allowing searches in gitignored artifacts such as build outputs or `node_modules`; sensitive files (like `.env`) remain filtered by the sensitive-file protection layer; defaults to `false` to preserve existing behavior
24
-
- Core: Add sensitive file protection to Grep and Read tools — `.env`, SSH private keys (`id_rsa`, `id_ed25519`, `id_ecdsa`), and cloud credentials (`.aws/credentials`, `.gcp/credentials`) are now detected and blocked; Grep filters them from results with a warning, Read rejects them outright; `.env.example`/`.env.sample`/`.env.template` are exempted
25
-
- Core: Fix parallel foreground subagent approval requests hanging the session — in interactive shell mode, `_set_active_approval_sink` no longer flushes pending approval requests to the live view sink (which cannot render approval modals); requests stay in the pending queue for the prompt modal path; also adds a 300-second timeout to `wait_for_response` so that any unresolved approval request eventually raises `ApprovalCancelledError` instead of hanging forever
26
-
- CLI: Add `--session`/`--resume` (`-S`/`-r`) flag to resume sessions — without an argument opens an interactive session picker (shell UI only); with a session ID resumes that specific session; replaces the reverted `--pick-session`/`--list-sessions` design with a unified optional-value flag
27
-
- CLI: Add CJK-safe `shorten()` utility — replaces all `textwrap.shorten` calls so that CJK text without spaces is truncated gracefully instead of collapsing to just the placeholder
28
-
- Core: Fix skills in brand directories (e.g. `~/.kimi/skills/`) silently disappearing when a generic directory (`~/.config/agents/skills/`) exists but is empty — skill directory discovery now searches brand and generic directory groups independently and merges both results, instead of stopping at the first existing directory across all candidates
29
-
- Core: Add `merge_all_available_skills` config option — when enabled, skills from all existing brand directories (`~/.kimi/skills/`, `~/.claude/skills/`, `~/.codex/skills/`) are loaded and merged instead of using only the first one found; same-name skills follow priority order kimi > claude > codex; disabled by default
30
-
- CLI: Add `--plan` flag and `default_plan_mode` config option — start new sessions in plan mode via `kimi --plan` or by setting `default_plan_mode = true` in `~/.kimi/config.toml`; resumed sessions preserve their existing plan mode state
31
-
- Shell: Add `/undo` and `/fork` commands for session forking — `/undo` lets you pick a previous turn and fork a new session with the selected message pre-filled for re-editing; `/fork` duplicates the entire session history into a new session; the original session is always preserved
32
-
- CLI: Add `-r` as a short alias for `--session` and print a resume hint (`kimi -r <session-id>`) whenever a session exits — covers normal exit, Ctrl-C, `/undo`, `/fork`, and `/sessions` switch so users can always find their way back
33
-
- Core: Fix `custom_headers` not being passed to non-Kimi providers — OpenAI, Anthropic, Google GenAI, and Vertex AI providers now correctly forward custom headers configured in `providers.*.custom_headers`
34
-
35
-
## 1.29.0 (2026-04-01)
36
-
37
14
- Core: Support hierarchical `AGENTS.md` loading — the CLI now discovers and merges `AGENTS.md` files from the git project root down to the working directory, including `.kimi/AGENTS.md` at each level; deeper files take priority under a 32 KiB budget cap, ensuring the most specific instructions are never truncated
38
15
- Core: Fix empty sessions lingering on disk after exit — sessions created but never used are now cleaned up on all exit paths (failure exit, session switch, unexpected errors), not just on successful exit
39
16
- Shell: Add `KIMI_CLI_PASTE_CHAR_THRESHOLD` and `KIMI_CLI_PASTE_LINE_THRESHOLD` environment variables to control when pasted text is folded into a placeholder — lowering these thresholds works around CJK input method breakage after multiline paste on some terminals (e.g., XShell over SSH)
Copy file name to clipboardExpand all lines: docs/en/configuration/config-files.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,8 @@ The configuration file contains the following top-level configuration items:
27
27
|`default_model`|`string`| Default model name, must be a model defined in `models`|
28
28
|`default_thinking`|`boolean`| Whether to enable thinking mode by default (defaults to `false`) |
29
29
|`default_yolo`|`boolean`| Whether to enable YOLO (auto-approve) mode by default (defaults to `false`) |
30
-
|`default_plan_mode`|`boolean`| Whether to start new sessions in plan mode by default (defaults to `false`); resumed sessions preserve their existing state |
|`theme`|`string`| Terminal color theme, either `"dark"` or `"light"` (defaults to `"dark"`) |
33
-
|`merge_all_available_skills`|`boolean`| Whether to merge skills from all brand directories (defaults to `false`); see [Skills configuration](../customization/skills.md)|
34
32
|`providers`|`table`| API provider configuration |
35
33
|`models`|`table`| Model configuration |
36
34
|`loop_control`|`table`| Agent loop control parameters |
@@ -44,10 +42,8 @@ The configuration file contains the following top-level configuration items:
Copy file name to clipboardExpand all lines: docs/en/configuration/overrides.md
-3Lines changed: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,12 +36,9 @@ The model specified by `--model` must be defined in the configuration file's `mo
36
36
|`--thinking`| Enable thinking mode |
37
37
|`--no-thinking`| Disable thinking mode |
38
38
|`--yolo, --yes, -y`| Auto-approve all operations |
39
-
|`--plan`| Start in plan mode |
40
39
41
40
`--thinking` / `--no-thinking` overrides the thinking state saved from the last session. If not specified, uses the last session's state.
42
41
43
-
`--plan` enables plan mode for new sessions; when resuming an existing session, it forces plan mode on. You can also set `default_plan_mode = true` in the config file to start new sessions in plan mode by default.
44
-
45
42
## Environment variable overrides
46
43
47
44
Environment variables can override provider and model settings without modifying the configuration file. This is particularly useful in the following scenarios:
Copy file name to clipboardExpand all lines: docs/en/customization/agents.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,12 +215,12 @@ When `run_in_background=true`, the command is launched as a background task and
215
215
### `ReadFile`
216
216
217
217
- **Path**: `kimi_cli.tools.file:ReadFile`
218
-
- **Description**: Read text file content. Max 1000 lines per read, max 2000 characters per line. Files outside working directory require absolute paths. Every read returns the total number of lines in the file.
218
+
- **Description**: Read text file content. Max 1000 lines per read, max 2000 characters per line. Files outside working directory require absolute paths.
219
219
220
220
| Parameter | Type | Description |
221
221
|-----------|------|-------------|
222
222
| `path` | string | File path |
223
-
| `line_offset` | int | Starting line number, default 1. Supports negative values to read from the end of the file (e.g. `-100` reads the last 100 lines); absolute value cannot exceed 1000 |
223
+
| `line_offset` | int | Starting line number, default 1 |
224
224
| `n_lines` | int | Number of lines to read, default/max 1000 |
Copy file name to clipboardExpand all lines: docs/en/customization/skills.md
+14-29Lines changed: 14 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,54 +19,39 @@ For details about plugins, see the [Plugins](./plugins.md) documentation.
19
19
20
20
## Skill discovery
21
21
22
-
Kimi Code CLI uses a layered loading mechanism to discover skills, loading in the following priority order (earlier ones take priority for skills with the same name):
22
+
Kimi Code CLI uses a layered loading mechanism to discover skills, loading in the following priority order (later ones override skills with the same name):
23
23
24
24
**Built-in skills**
25
25
26
26
Skills shipped with the package, providing basic capabilities.
27
27
28
28
**User-level skills**
29
29
30
-
Stored in the user's home directory, effective across all projects. Candidate directories are split into two groups; within each group, the first existing directory is selected, and results from both groups are merged independently (brand group has higher specificity and priority):
30
+
Stored in the user's home directory, effective across all projects. Kimi Code CLI checks the following directories in priority order and uses the first one that exists:
31
31
32
-
-**Brand group** (mutually exclusive):
33
-
1.`~/.kimi/skills/`
34
-
2.`~/.claude/skills/`
35
-
3.`~/.codex/skills/`
36
-
-**Generic group** (mutually exclusive):
37
-
1.`~/.config/agents/skills/` (recommended)
38
-
2.`~/.agents/skills/`
39
-
40
-
Both groups are searched independently and results are merged. When a skill with the same name exists in both groups, the brand group version takes priority.
41
-
42
-
To load skills from all existing brand directories instead of only the first one, enable `merge_all_available_skills` in your config file:
43
-
44
-
```toml
45
-
merge_all_available_skills = true
46
-
```
47
-
48
-
When enabled, all existing brand directories are loaded and merged, with same-name skills resolved by priority: kimi > claude > codex. The generic group is not affected.
32
+
1.`~/.config/agents/skills/` (recommended)
33
+
2.`~/.agents/skills/`
34
+
3.`~/.kimi/skills/`
35
+
4.`~/.claude/skills/`
36
+
5.`~/.codex/skills/`
49
37
50
38
**Project-level skills**
51
39
52
-
Stored in the project directory, only effective within that project's working directory. Similarly split into two groups:
53
-
54
-
-**Brand group** (mutually exclusive):
55
-
1.`.kimi/skills/`
56
-
2.`.claude/skills/`
57
-
3.`.codex/skills/`
58
-
-**Generic group**: `.agents/skills/`
40
+
Stored in the project directory, only effective within that project's working directory. Kimi Code CLI checks the following directories in priority order and uses the first one that exists:
59
41
60
-
The `merge_all_available_skills` config applies to project-level skills as well.
42
+
1.`.agents/skills/` (recommended)
43
+
2.`.kimi/skills/`
44
+
3.`.claude/skills/`
45
+
4.`.codex/skills/`
61
46
62
-
You can also specify additional skills directories with the `--skills-dir` flag. This flag can be specified multiple times, and the directories override the auto-discovered user/project directories:
47
+
You can also append additional skills directories with the `--skills-dir` flag. This flag can be specified multiple times, and the directories are merged with the auto-discovered ones:
63
48
64
49
```sh
65
50
kimi --skills-dir /path/to/my-skills --skills-dir /path/to/more-skills
66
51
```
67
52
68
53
::: tip
69
-
Skills paths are independent of [`KIMI_SHARE_DIR`](../configuration/env-vars.md#kimi-share-dir). `KIMI_SHARE_DIR` customizes the storage location for configuration, sessions, logs, and other runtime data, but does not affect Skills search paths. Skills are cross-tool shared capability extensions (compatible with Kimi CLI, Claude, Codex, and others), which is a different type of data from application runtime data. To specify custom skills paths, use the `--skills-dir` flag.
54
+
Skills paths are independent of [`KIMI_SHARE_DIR`](../configuration/env-vars.md#kimi-share-dir). `KIMI_SHARE_DIR` customizes the storage location for configuration, sessions, logs, and other runtime data, but does not affect Skills search paths. Skills are cross-tool shared capability extensions (compatible with Kimi CLI, Claude, Codex, and others), which is a different type of data from application runtime data. To append additional skills paths, use the `--skills-dir` flag.
Copy file name to clipboardExpand all lines: docs/en/guides/interaction.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,15 +33,12 @@ In plan mode, the AI can only use read-only tools (`Glob`, `Grep`, `ReadFile`) t
33
33
34
34
### Entering plan mode
35
35
36
-
There are four ways to enter plan mode:
36
+
There are three ways to enter plan mode:
37
37
38
-
-**CLI flag**: Use `kimi --plan` to start a new session directly in plan mode
39
38
-**Keyboard shortcut**: Press `Shift-Tab` to toggle plan mode
40
39
-**Slash command**: Enter `/plan` or `/plan on`
41
40
-**AI-initiated**: When facing complex tasks, the AI may request to enter plan mode via the `EnterPlanMode` tool — you can accept or decline
42
41
43
-
You can also set `default_plan_mode = true` in the config file to start every new session in plan mode by default. See [Configuration files](../configuration/config-files.md).
44
-
45
42
When plan mode is active, the prompt changes to `📋` and a blue `plan` badge appears in the status bar.
46
43
47
44
### Reviewing plans
@@ -85,6 +82,8 @@ While the AI is executing a task, you can type and send follow-up messages in th
85
82
86
83
Steer messages are appended to the context after the current step completes, and the AI will see and respond to your message before the next step begins. Approval requests and question panels are also handled inline with keyboard navigation during agent execution.
87
84
85
+
Any text you type in the input box during a turn but haven't yet submitted is preserved when the turn ends — it won't be lost. You can press `Enter` to send it as the next message, or continue editing.
86
+
88
87
::: tip
89
88
Steer messages do not interrupt the AI's currently executing step — they are processed between steps. To interrupt immediately, use `Ctrl-C`.
Copy file name to clipboardExpand all lines: docs/en/guides/sessions.md
+3-15Lines changed: 3 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,26 +16,14 @@ Use the `--continue` flag to continue the most recent session in the current wor
16
16
kimi --continue
17
17
```
18
18
19
-
**Interactively pick a session**
19
+
**Switch to a specific session**
20
20
21
-
Use `--session`(or `--resume`, `-S`, `-r`) without an argument to open an interactive session picker, where you can use arrow keys to select the session to resume:
21
+
Use the `--session`flag to switch to a session with a specific ID:
22
22
23
23
```sh
24
-
kimi --session
24
+
kimi --session abc123
25
25
```
26
26
27
-
> The interactive picker is only available in shell mode.
28
-
29
-
**Resume a specific session**
30
-
31
-
Use `--session` (or `--resume`) with a session ID to resume that specific session:
32
-
33
-
```sh
34
-
kimi -r abc123
35
-
```
36
-
37
-
If the specified session ID does not exist, a new session is created automatically.
38
-
39
27
**Switch sessions during runtime**
40
28
41
29
Enter `/sessions` (or `/resume`) to view all sessions in the current working directory, and use arrow keys to select the session you want to switch to:
Copy file name to clipboardExpand all lines: docs/en/reference/kimi-command.md
+5-16Lines changed: 5 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,9 +55,9 @@ The working directory determines the root directory for file operations. Relativ
55
55
| Option | Short | Description |
56
56
|--------|-------|-------------|
57
57
|`--continue`|`-C`| Continue the previous session in the current working directory |
58
-
|`--session [ID]` / `--resume [ID]`|`-S`/ `-r`| Resume a session. With ID: resume that session (creates new if not found). Without ID: open interactive session picker (shell mode only)|
58
+
|`--session ID`|`-S`| Resume session with specified ID, creates new session if not exists|
59
59
60
-
`--continue` and `--session`/`--resume` are mutually exclusive.
60
+
`--continue` and `--session` are mutually exclusive.
In YOLO mode, all file modifications and shell commands are automatically executed. Use with caution.
127
127
:::
128
128
129
-
## Plan mode
130
-
131
-
| Option | Description |
132
-
|--------|-------------|
133
-
|`--plan`| Start a new session in plan mode |
134
-
135
-
When started with `--plan`, the AI can only use read-only tools to explore the codebase and write an implementation plan. When resuming an existing session, `--plan` forces plan mode on; resuming without `--plan` preserves the session's existing state.
136
-
137
-
You can also set `default_plan_mode = true` in the config file to start new sessions in plan mode by default. See [Configuration files](../configuration/config-files.md).
138
-
139
129
## Thinking mode
140
130
141
131
| Option | Description |
@@ -185,17 +175,16 @@ kimi logout
185
175
186
176
### `kimi export`
187
177
188
-
Export session data as a ZIP file. The ZIP contains all files in the session directory (`context.jsonl`, `wire.jsonl`, `state.json`, etc.).
178
+
Export the data of a specified session as a ZIP file. The ZIP contains all files in the session directory (`context.jsonl`, `wire.jsonl`, `state.json`, etc.).
189
179
190
180
```sh
191
-
kimi export[<session_id>] [-o <output_path>] [--yes]
181
+
kimi export<session_id> [-o <output_path>]
192
182
```
193
183
194
184
| Argument / Option | Description |
195
185
|--------|-------------|
196
-
|`<session_id>`| Session ID to export. If omitted, the CLI previews the previous session for the current working directory and asks for confirmation before exporting|
186
+
|`<session_id>`| Session ID to export |
197
187
|`--output, -o`| Output ZIP file path (defaults to `session-<id>.zip` in the current directory) |
198
-
|`--yes, -y`| Skip the confirmation prompt when exporting the default previous session |
Copy file name to clipboardExpand all lines: docs/en/reference/kimi-vis.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ At the top of the session detail page, you can use `Open Dir` to open the curren
66
66
You can export session data as a ZIP file for offline analysis or sharing.
67
67
68
68
-**ZIP download**: Click the download button in the session explorer or session detail page to download the session directory as a ZIP file
69
-
-**CLI export**: Use `kimi export [<session_id>]`to export a session as a ZIP file; when `<session_id>` is omitted, the CLI previews the previous session for the current working directory and asks for confirmation
69
+
-**CLI export**: Use the `kimi export <session_id>` command to export a specified session as a ZIP file
0 commit comments