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

# Roo Code 插件

> 本文档仅供参考，演示如何配置我们的 API 与第三方 AI 聊天界面配合使用。文中提及的任何第三方软件、网站或服务均非由我们运营、控制或背书。

<Frame>
  <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-62.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=ad0019a1e064d52a049fdf714d85e6a4" alt="Image" width="120" height="21" data-path="images/image-62.webp" />
</Frame>

# **Roo Code 简介**

[**Roo Code**](https://github.com/RooCodeInc/Roo-Code) 能为您做什么？

* 根据自然语言描述和规格生成代码
* 自适应模式：代码、架构、问答、调试及自定义模式
* 重构与调试现有代码
* 编写与更新文档
* 回答关于代码库的问题
* 自动化重复性任务
* 利用 MCP 服务器

# 步骤

<Steps>
  <Step title="安装 Roo Code">
    从 [**VS Code**](https://code.visualstudio.com/download) 应用市场 **安装** [Roo Code **扩展**](https://marketplace.visualstudio.com/items?itemName=RooVeterinaryInc.roo-cline)**。**

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-63.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=9fdb38ee6310d5d67376163494d84abc" alt="Image" width="965" height="267" data-path="images/image-63.webp" />
    </Frame>
  </Step>

  <Step title="模型配置与 API Key">
    点击侧边栏的 "Roo Code" 图标启动插件，然后点击右上角的设置按钮。如果 Roo Code 提示你创建账户，请选择“use without an account”和"第三方供应商"。

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-64.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=342ad372c2a340e2c0baba07acce6b28" alt="Image" width="1360" height="940" data-path="images/image-64.webp" />
    </Frame>

    在以下字段中输入配置信息。

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-65.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=9e302ab25f09ccb44c39517fb7d1ef39" alt="Image" width="533" height="680" data-path="images/image-65.webp" />
    </Frame>

    以下示例使用 claude-opus-4.7，API 格式设置为 OpenAI。完成后点击 "Save"。

    | **字段**       | **内容**                                            |
    | :----------- | :------------------------------------------------ |
    | API Provider | 选择 "OpenAI Compatible"                            |
    | Base URL     | [**https://api.x6.ai/v1**](https://api.x6.ai/v1)  |
    | API Key      | 从 [**x6.ai**](https://x6.ai/settings/api-keys) 获取 |
    | Model        | claude-opus-4-7                                   |

    您可以通过改变 Model ID 手动切换[模型](https://x6.ai/models)（需要使用 OpenAI 兼容的 API 格式）：

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-92.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=ef9f3c656edfaf3e9ab3efcaa88b089b" alt="Image" width="1180" height="913" data-path="images/image-92.webp" />
    </Frame>
  </Step>

  <Step title="模型配置与 API Key">
    点击侧边栏的 "Roo Code" 图标启动插件，然后点击右上角的设置按钮。如果 Roo Code 提示你创建账户，请选择“use without an account”和"第三方供应商"。

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-64.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=342ad372c2a340e2c0baba07acce6b28" alt="Image" width="1360" height="940" data-path="images/image-64.webp" />
    </Frame>

    在以下字段中输入配置信息。

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-65.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=9e302ab25f09ccb44c39517fb7d1ef39" alt="Image" width="533" height="680" data-path="images/image-65.webp" />
    </Frame>

    以下示例使用 claude-opus-4.7，API 格式设置为 OpenAI。完成后点击 "Save"。

    | **字段**       | **内容**                                            |
    | :----------- | :------------------------------------------------ |
    | API Provider | 选择 "OpenAI Compatible"                            |
    | Base URL     | [**https://api.x6.ai/v1**](https://api.x6.ai/v1)  |
    | API Key      | 从 [**x6.ai**](https://x6.ai/settings/api-keys) 获取 |
    | Model        | claude-opus-4-7                                   |

    您可以通过改变 Model ID 手动切换[模型](https://x6.ai/models)（需要使用 OpenAI 兼容的 API 格式）：

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-92.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=ef9f3c656edfaf3e9ab3efcaa88b089b" alt="Image" width="1180" height="913" data-path="images/image-92.webp" />
    </Frame>
  </Step>

  <Step title="使用 Roo Code">
    在面板底部的聊天框中，清晰简洁地描述您希望 Roo Code 执行的任务。有效任务示例：

    * "创建一个名为 `hello.txt` 的文件，内容为 'Hello, world!'。"
    * "编写一个将两个数字相加的 Python 函数。"
    * "创建一个标题为 'Roo test' 的简单网站 HTML 文件"

    无需特殊命令或语法，直接用自然语言即可。

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-66.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=a5562d0987f87e667489b49590450823" alt="Image 66" width="1360" height="940" data-path="images/image-66.webp" />
    </Frame>

    你可以点击下方的"default"来添加更多的 model。

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-79.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=96641334970df0f2aeca2d6e7519a040" alt="Image 79" width="1360" height="940" data-path="images/image-79.webp" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-80.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=df7f8346cc80ef3ee5bb2095d2cd6f9e" alt="Image 80" width="1360" height="940" data-path="images/image-80.webp" />
    </Frame>
  </Step>
</Steps>

## **故障排除**

<Frame>
  <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-67.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=8e33c5343af9025a21217d32786724fd" alt="Image" width="1600" height="395" data-path="images/image-67.webp" />
</Frame>

*VS Code 输出面板显示 Roo Code 日志，用于故障排除*

**扩展不可见**

* 重启 VS Code
* 在扩展列表中确认 Roo Code 已安装并启用
* 尝试禁用后重新启用
* 在输出面板中检查错误（视图 → 输出，选择 "Roo Code"）

**安装问题**

* 确保网络连接稳定
* 确认 VS Code 版本为 1.84.0 或更高
* 如果 VS Code 应用市场无法访问，请尝试 Open VSX Registry 方式
