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
5 changes: 5 additions & 0 deletions .changeset/add-lowercase-continue-shorthand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Add `-c` as a shorthand for `--continue`.
5 changes: 3 additions & 2 deletions apps/kimi-code/src/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export function createProgram(
.hideHelp()
.argParser((val: string | boolean) => (val === true ? '' : (val as string))),
)
.option('-C, --continue', 'Continue the previous session for the working directory.', false)
.option('-c, --continue', 'Continue the previous session for the working directory.', false)
.addOption(new Option('-C').hideHelp().default(false))
.option('-y, --yolo', 'Automatically approve all actions.', false)
.option('--auto', 'Start in auto permission mode.', false)
.addOption(
Expand Down Expand Up @@ -123,7 +124,7 @@ export function createProgram(

const opts: CLIOptions = {
session: sessionValue,
continue: raw['continue'] as boolean,
continue: raw['continue'] === true || raw['C'] === true,
yolo: yoloValue,
auto: autoValue,
plan: raw['plan'] as boolean,
Expand Down
4 changes: 4 additions & 0 deletions apps/kimi-code/test/cli/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ describe('CLI options parsing', () => {
expect(parse(['-C']).continue).toBe(true);
});

it('-c is an alias for --continue', () => {
expect(parse(['-c']).continue).toBe(true);
});

it('--continue and --session combined raises a conflict', () => {
const opts = parse(['--continue', '--session', 'abc123']);
expect(() => validateOptions(opts)).toThrow(OptionConflictError);
Expand Down
2 changes: 1 addition & 1 deletion docs/en/configuration/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Options passed at startup have the highest priority and apply only to the curren
| Option | Effect |
| --- | --- |
| `-S, --session [id]` | Resume a specific session; enters interactive selection when no id is given |
| `-C, --continue` | Resume the last session for the current working directory |
| `-c, --continue` | Resume the last session for the current working directory |
| `-y, --yolo` | Auto-approve all tool calls |
| `--plan` | Start in Plan mode |
| `-m, --model <model>` | Use a specific model alias for this session |
Expand Down
4 changes: 2 additions & 2 deletions docs/en/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ To run a single instruction without entering the interactive UI, use `-p`:
kimi -p "Take a look at this project's directory structure"
```

To resume the previous session, add `-C`:
To resume the previous session, add `-c`:

```sh
kimi -C
kimi -c
```

On first launch you need to configure an API source. In the interactive UI, enter `/login` to begin the login flow:
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/kimi-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ All flags are optional — run `kimi` directly to enter an interactive session:
| `--version` | `-V` | Print the version number and exit |
| `--help` | `-h` | Show help information and exit |
| `--session [id]` | `-S` | Resume a session. With an ID, opens that session directly; without an ID, enters an interactive selector |
| `--continue` | `-C` | Continue the most recent session in the current working directory, without specifying an ID manually |
| `--continue` | `-c` | Continue the most recent session in the current working directory, without specifying an ID manually |
| `--model <model>` | `-m` | Specify a model alias for this launch. When omitted, new sessions use `default_model` from the config file |
| `--prompt <prompt>` | `-p` | Run a single prompt non-interactively and stream the Assistant output to stdout. This mode does not open the TUI |
| `--output-format <format>` | | Set the non-interactive output format; supports `text` and `stream-json`. Can only be used with `--prompt`; defaults to `text` |
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/configuration/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Kimi Code CLI 有三个地方可以影响运行参数:配置文件、命令行
| 选项 | 作用 |
| --- | --- |
| `-S, --session [id]` | 恢复指定会话;不带 id 时进入交互式选择 |
| `-C, --continue` | 续上当前目录的上一次会话 |
| `-c, --continue` | 续上当前目录的上一次会话 |
| `-y, --yolo` | 自动批准所有工具调用 |
| `--plan` | 以 Plan 模式启动 |
| `-m, --model <model>` | 指定本次使用的模型别名 |
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ kimi
kimi -p "帮我看一下这个项目的目录结构"
```

继续上一次会话加 `-C`:
继续上一次会话加 `-c`:

```sh
kimi -C
kimi -c
```

首次启动时需要配置 API 来源。在交互界面中输入 `/login` 进入登录流程:
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/reference/kimi-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kimi <subcommand> [options]
| `--version` | `-V` | 打印版本号并退出 |
| `--help` | `-h` | 显示帮助信息并退出 |
| `--session [id]` | `-S` | 恢复一个会话。带 ID 时直接打开指定会话;不带 ID 时进入交互式选择器 |
| `--continue` | `-C` | 继续当前工作目录下最近一次的会话,无需手动指定 ID |
| `--continue` | `-c` | 继续当前工作目录下最近一次的会话,无需手动指定 ID |
| `--model <model>` | `-m` | 为本次启动指定模型别名。省略时新会话使用配置文件中的 `default_model` |
| `--prompt <prompt>` | `-p` | 非交互执行单次 prompt,并把 Assistant 输出流式写到 stdout。该模式不会打开 TUI |
| `--output-format <format>` | | 设置非交互输出格式,支持 `text` 与 `stream-json`。仅可与 `--prompt` 一起使用,默认 `text` |
Expand Down
Loading