> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siflow.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Continue

> 了解如何在 Continue CLI、VS Code 和 JetBrains 插件中配置 config.yaml，接入 siflow endpoint，并使用 AI coding assistant。

[Continue](https://continue.dev) 是一个开源 AI coding assistant，提供 VS Code / JetBrains plugin 和命令行工具（`cn`）。两者共用同一个 `config.yaml`，所以下面的配置同时适用于 CLI 和 extension。

## 配置 CLI

### 1. 安装 CLI

<CodeGroup>
  ```bash npm theme={null}
  node -v   # needs 20+ — upgrade via https://nodejs.org/en/download if older
  npm install -g @continuedev/cli
  ```

  ```bash install script (macOS/Linux) theme={null}
  curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bash
  ```
</CodeGroup>

### 2. 配置模型

在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建 API Key，然后编辑 `~/.continue/config.yaml`。如果是新机器，请先运行 `mkdir -p ~/.continue` 创建目录。

```yaml theme={null}
name: siflow
version: 0.0.1
schema: v1

models:
  - name: glm-5.2
    provider: openai
    model: glm-5.2
    apiBase: https://api.siflow.cn/model-api/v1
    apiKey: <Your API Key>
    roles:
      - chat
      - edit
      - apply
```

### 3. 创建 onboarding marker

截至 CLI 1.5.47，如果没有该 marker，交互式 `cn` 会显示首次登录提示，要求输入 Anthropic API key，并忽略本地配置。Headless `cn -p` 不受影响。参考 [continuedev/continue#12258](https://github.com/continuedev/continue/issues/12258)。

```bash theme={null}
touch ~/.continue/.onboarding_complete
```

### 4. 运行 CLI

直接运行 `cn` 会打开交互式 chat TUI。输入 `/` 可查看 slash commands。`cn -p "<prompt>"` 会回答一次并退出。

```bash theme={null}
cn                                           # interactive chat
cn -p "introduce yourself in one sentence"  # one-shot
```

对于会修改文件或运行命令的任务，可以添加 `--auto` 自动批准 tool calls，或保持交互模式逐项确认。也可以使用更细粒度的 flags：`--readonly` 表示 plan mode 且只使用只读 tools；`--allow <tool>` / `--exclude <tool>` 可重复指定。

## 配置 VS Code / JetBrains Extension

1. 在 VS Code 或 JetBrains marketplace 中搜索 **Continue** 并安装 extension。
2. 打开 chat sidebar。VS Code 中使用 `Cmd/Ctrl+L`；JetBrains 中使用 `Cmd/Ctrl+J`。
3. 单击输入框上方的 config selector，然后单击 **Local Config** 旁边的齿轮图标。
4. 将上面相同的 `models` entry 添加到 `~/.continue/config.yaml`。Windows 路径为 `%USERPROFILE%\.continue\config.yaml`。
5. 从模型下拉菜单选择 `glm-5.2`，然后发送消息。

<Note>
  CLI 和 extension 共用 `~/.continue/config.yaml`。如果已登录 Continue Hub，请确认当前 active config 是本地配置。
</Note>

## 参数说明

CLI 和 extension 共用 `config.yaml`。

| 参数                         | 说明                                                                                                                             |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `provider`                 | 对于 OpenAI-compatible 服务，保持为 `openai`。                                                                                          |
| `model`                    | 模型 ID，例如 `glm-5.2`。                                                                                                            |
| `apiBase`                  | siflow OpenAI-compatible endpoint：`https://api.siflow.cn/model-api/v1`。                                                        |
| `apiKey`                   | 您在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建的 API Key。                                                 |
| `roles`                    | 使用该模型的 Continue 功能。有效值包括：`chat`、`autocomplete`、`embed`、`rerank`、`edit`、`apply`。                                                |
| `capabilities`             | 可选。如果 agent tool calls 无法直接工作，可设置 `[tool_use]`。它会覆盖 Continue 的 autodetection；OpenAI-compatible endpoints 上 autodetection 可能漏判。 |
| `defaultCompletionOptions` | 可选。将 `contextLength` / `maxTokens` 设置为模型的实际限制。                                                                                 |

<Tip>
  如需 Tab autocomplete，请添加第二个轻量模型 entry，并设置 `roles: [autocomplete]`。可以使用 `DeepSeek-V4-Flash` 这类快速模型。
</Tip>

## 常见问题

* 对于 `glm-5.2`，chat TUI 会显示 **Model Capability Warning**。截至 1.5.47，CLI 会根据内置列表检查模型 ID，对未识别模型发出警告，即使已经声明 `capabilities`。可以忽略：chat、edit 和 tool calls 都可以通过 siflow endpoint 工作。
