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

# theo init

> 在项目中初始化 Theo——创建配置、检测 IDE、写入 MCP 配置。

```bash theme={null}
theo init [directory]
```

`theo init` 会通过以下步骤在你的项目中设置 Theo：

1. **创建 `theo.config.json`** —— 项目级配置，包含角色、技能和默认模式
2. **检测已安装的 IDE** —— Cursor、Claude Code、Warp、Windsurf、VS Code
3. **写入 MCP 配置** —— 为每个检测到的 IDE 生成正确的 JSON（参见 [MCP / Overview](/mcp/overview)）
4. **生成 `.theo/RULES.md`** —— 上下文文件，让 IDE 智能体了解如何使用 Theo

## 示例

```bash theme={null}
$ theo init
[theo] Initializing Theo in this project...

[theo]   ✓ Created theo.config.json

[theo] Detecting IDEs...
[theo]   Found: Cursor, Warp

[theo] Writing MCP configurations...
[theo]   ✓ Cursor: .cursor/mcp.json
[theo]   ✓ Warp: .warp/mcp.json

[theo] Generating agent context...
[theo]   ✓ Created .theo/RULES.md

[theo] ✅ Theo initialized!
```

## 生成的内容

### theo.config.json

```json theme={null}
{
  "persona": "You are an AI assistant for the my-project project.",
  "skills": [],
  "defaultMode": "auto"
}
```

### MCP 配置（按 IDE 划分）

```json theme={null}
{
  "mcpServers": {
    "theo": {
      "command": "npx",
      "args": ["-y", "@hitheo/mcp"],
      "env": { "THEO_API_KEY": "${env:THEO_API_KEY}" }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.