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

# 配置导入

> 控制 Devin CLI 如何从 Cursor、Windsurf、Claude Code、OpenCode、VS Code 和 Zed 导入设置

Devin CLI 可以自动从项目中已安装的其他 AI 编程工具导入规则和配置。当在你的工作区中检测到标准项目规则文件或 Cursor、Windsurf、Claude Code、OpenCode、VS Code 或 Zed 的配置文件时，就会自动执行此操作。

***

<div id="how-it-works">
  ## 工作原理
</div>

当你启动会话时，Devin CLI 会检查标准项目规则文件以及受支持工具的配置文件，并导入找到的内容。

<div id="standard-project-rules">
  ### 标准项目规则
</div>

| 导入内容 | 源文件                                                          |
| ---- | ------------------------------------------------------------ |
| 规则   | `AGENTS.md`, `AGENTS.local.md`, `AGENT.md`, `.windsurfrules` |

<div id="cursor">
  ### Cursor
</div>

| 导入内容    | 源文件                                         |
| ------- | ------------------------------------------- |
| 规则      | `.cursor/rules/*.md`, `.cursor/rules/*.mdc` |
| MCP 服务器 | `.cursor/mcp.json`                          |

<div id="windsurf">
  ### Windsurf
</div>

| 导入内容    | 源文件                                                                        |
| ------- | -------------------------------------------------------------------------- |
| 规则      | `.windsurf/rules/*.md`、`.windsurf/global_rules.md` (位于工作区根目录和子目录中)         |
| 技能      | `.windsurf/skills/` (项目级) ，`~/.codeium/<channel>/skills/` (全局，取决于 channel) |
| MCP 服务器 | `~/.codeium/<channel>/mcp_config.json` (取决于 channel)                       |

<Note>
  Devin CLI 会从与自身 channel 对应的 Windsurf 配置目录中读取：stable 读取 `~/.codeium/windsurf/`，next 读取 `~/.codeium/windsurf-next/`，insiders 读取 `~/.codeium/windsurf-insiders/`。你的项目中可在多个层级存在 `.windsurf/rules/` 目录。工作区根目录中的规则会在会话开始时加载。子目录中的规则会在 Agent 访问该目录中的文件时按需发现。
</Note>

<Note>
  Windsurf 工作流程 (`.windsurf/workflows/` 和 `~/.codeium/<channel>/global_workflows/`) **不会** 作为技能导入。
</Note>

<div id="claude-code">
  ### Claude Code
</div>

| 导入内容      | 源文件                                                                                                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 规则        | `CLAUDE.md`, `~/.claude/CLAUDE.md`                                                                                                                                              |
| 技能        | `.claude/skills/**/SKILL.md`                                                                                                                                                    |
| 命令 (作为技能) | `.claude/commands/**/*.md`                                                                                                                                                      |
| MCP 服务器   | `.mcp.json`, `.claude/settings.json`, `.claude/settings.local.json`, `~/.claude.json`, `~/.claude/settings.json`, `~/.claude/settings.local.json`, `~/.claude/mcp_servers.json` |

<div id="opencode">
  ### OpenCode
</div>

| 导入内容    | 源文件                                                            |
| ------- | -------------------------------------------------------------- |
| MCP 服务器 | `opencode.json` (项目) , `~/.config/opencode/opencode.json` (全局) |

<Note>
  OpenCode 使用的 MCP 架构与标准格式不同。命令可以是数组或字符串，环境变量使用 `"environment"` 密钥，服务器则使用 `"enabled"` 标记 (与标准的 `"disabled"` 标记相反) 。这些差异会在导入时自动转换。
</Note>

<div id="vs-code">
  ### VS Code
</div>

| 导入内容    | 源文件                      |
| ------- | ------------------------ |
| MCP 服务器 | `.vscode/mcp.json` (仅项目) |

<Note>
  VS Code 使用 `"servers"` 密钥，而不是标准的 `"mcpServers"` 密钥。
</Note>

<div id="zed">
  ### Zed
</div>

| 导入内容    | 源文件                                                           |
| ------- | ------------------------------------------------------------- |
| MCP 服务器 | `.zed/settings.json` (项目) ，`~/.config/zed/settings.json` (全局) |

<Note>
  Zed 在其设置文件中使用 `"context_servers"` 密钥。
</Note>

***

<div id="disabling-configuration-import">
  ## 禁用配置导入
</div>

如果要停止从特定工具导入，请在配置中将其设为 `false`：

<Tabs>
  <Tab title="用户配置">
    ```json theme={null}
    // ~/.config/devin/config.json
    // （Windows 上：%APPDATA%\devin\config.json）
    {
      "read_config_from": {
        "agents_standard": false,
        "cursor": false,
        "windsurf": false,
        "claude": false,
        "opencode": false,
        "vscode": false,
        "zed": false
      }
    }
    ```
  </Tab>

  <Tab title="项目配置">
    ```json theme={null}
    // .devin/config.json
    {
      "read_config_from": {
        "windsurf": false
      }
    }
    ```
  </Tab>
</Tabs>

你可以按需禁用导入——例如，只从 Cursor 导入，而不从 Windsurf 导入：

```json theme={null}
{
  "read_config_from": {
    "cursor": true,
    "windsurf": false
  }
}
```

***

<div id="options">
  ## 选项
</div>

| 选项                | 类型      | 默认值    | 描述                                                                     |
| ----------------- | ------- | ------ | ---------------------------------------------------------------------- |
| `agents_standard` | boolean | `true` | 从 `AGENTS.md`、`AGENTS.local.md`、`AGENT.md` 和 `.windsurfrules` 导入标准项目规则 |
| `cursor`          | boolean | `true` | 从 Cursor 配置文件中导入规则和 MCP 服务器                                            |
| `windsurf`        | boolean | `true` | 从 Windsurf 导入规则、技能和 MCP 服务器                                            |
| `claude`          | boolean | `true` | 从 Claude Code 导入规则、技能、命令和 MCP 服务器                                      |
| `opencode`        | boolean | `true` | 从 OpenCode 配置文件中导入 MCP 服务器                                             |
| `vscode`          | boolean | `true` | 从 VS Code 配置文件中导入 MCP 服务器                                              |
| `zed`             | boolean | `true` | 从 Zed 设置文件中导入 MCP 服务器                                                  |

将某个值设置为 `true` (或留空) 会启用导入。将其设置为 `false` 则会禁用该工具的导入。

***

<div id="default-behavior">
  ## 默认行为
</div>

如果你没有显式配置 `read_config_from`，则会默认启用所有导入。将任一选项设为 `false`，即可禁用从该工具导入。
