> ## 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.