# 开始使用

> 根据目标选择 Runtime、Collaboration、CLI 或 Worktree，并找到对应的 Univer 文档入口。

- Human documentation: [https://office.univer.ai/zh-CN/getting-started](https://office.univer.ai/zh-CN/getting-started)

- Agent Markdown: [https://office.univer.ai/zh-CN/getting-started.md](https://office.univer.ai/zh-CN/getting-started.md)

- Language: `zh-CN`

- Source file: `content/docs/getting-started.zh-CN.mdx`

- Upstream source: [https://github.com/dream-num/office.univer.ai/blob/main/content/docs/getting-started.zh-CN.mdx](https://github.com/dream-num/office.univer.ai/blob/main/content/docs/getting-started.zh-CN.mdx)

---

**Univer** 是一套用于构建人类与 AI Agent 共同操作 Office 内容的 SDK。Runtime 提供 Web
编辑器，Collaboration SDK 提供自托管的权威协同服务，CLI SDK 让 Agent 读取和修改同一个
Unit；配合 Worktree，Agent 可以提交隔离、可审阅、可合入的修改。

## 根据目标选择入口

| 目标                | 使用                                             | 开始                                                                                    |
| ----------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------- |
| 嵌入 Office 编辑器     | Runtime SDK 展示和编辑 Sheet、Doc、Slide、Board 与 Base | [Runtime 快速开始](https://docs.univer.ai/guides/docs/getting-started/quickstart)         |
| 增加自托管实时协同         | Collaboration SDK 让多个 Client 共同编辑一个权威 Unit     | [Collaboration SDK 快速开始](https://office.univer.ai/zh-CN/collaboration/quick-start.md) |
| 让 Agent 读取和修改内容   | CLI SDK 在 Node.js 中检查、编辑和验证 Unit               | [CLI SDK 概览](https://office.univer.ai/zh-CN/cli/overview.md)                          |
| 让 Agent 修改可审阅、可合入 | Worktree 隔离修改，并支持人类审阅后合入 trunk                 | [Worktree 完整工作流](https://office.univer.ai/zh-CN/cli/worktree.md)                      |

## 两个文档站如何分工

| 文档入口                                                | 负责的内容                                                 |
| --------------------------------------------------- | ----------------------------------------------------- |
| [docs.univer.ai](https://docs.univer.ai/)           | Runtime SDK、前端编辑器能力、Preset、Plugin、Facade API 与 API 参考 |
| [office.univer.ai](https://office.univer.ai/zh-CN/) | 应用架构、自托管 Collaboration SDK、CLI SDK 与 Agent Worktree   |

两个站点描述的是同一套 Univer 技术栈。构建 Web 编辑器时从 Runtime 文档开始；为现有 Web
应用增加新的自托管协同后端时，回到本站的 Collaboration SDK 文档。

> **不要接入 Legacy Univer Server**
>
> `docs.univer.ai` 中仍可能搜索到旧版 Univer Server、Universer 或 Server API 页面。它们不是新应用的
> Collaboration 后端接入路径。新应用只使用本站记录的自托管 **Univer Collaboration SDK**；旧集成已
> 废弃且不再支持。

## 完整应用如何组合

一个同时支持人类编辑与 Agent 操作的应用通常由 Web、CLI 与 Server 组成：

```mermaid
flowchart LR
    Human([人类用户]) --> Web["Web<br/>Runtime SDK"]
    Agent([AI Agent]) --> CLI["CLI<br/>CLI SDK"]
    Web --> Server["Server<br/>Collaboration SDK + 业务代码"]
    CLI --> Server
    Server --> Storage[(产品与协同存储)]
```

Web 提供展示、交互式编辑和人工审阅；CLI 为 Agent 提供内容操作入口；Server 是两者共享的
内容权威。三个组件可以按需裁剪，也可以全部部署在本机。完整边界见
[Univer SDK 概览](https://office.univer.ai/zh-CN/overview/overview.md)。

推荐按目标逐步增加能力：

1. 先通过 Runtime 文档建立一个可编辑的 Web 应用。
2. 需要多人同步时，完成 [Collaboration SDK 快速开始](https://office.univer.ai/zh-CN/collaboration/quick-start.md)。
3. 需要 Agent 入口时，完成 [CLI 内容加载与读写](https://office.univer.ai/zh-CN/cli/content-operations.md)。
4. 需要隔离修改和人工审阅时，再增加 [Worktree](https://office.univer.ai/zh-CN/cli/worktree.md)。

## 示例集合

### 教学示例

> **Collaboration Examples**
>
> 查看 Web + Server 的最小组合与各项协同能力。先阅读[示例索引](https://office.univer.ai/zh-CN/collaboration/examples.md&#x29;，或直接
> **[在 GitHub 查看完整仓库](https://github.com/dream-num/univer-collaboration-examples)**。

> **CLI Examples**
>
> 查看 Agent CLI 的内容操作、文件交换、视觉检查与 Worktree。先阅读[示例索引](https://office.univer.ai/zh-CN/cli/examples.md&#x29;， 或直接
> **[在 GitHub 查看完整仓库](https://github.com/dream-num/univer-cli-examples)**。

### 实际应用示例

> **univer-cli**
>
> `univer-cli` 是一个供 Agent 使用的本地优先 Office CLI 应用。Agent 可以读取、修改和检查内容，
> 再通过本地文件、协同 Unit 或 Worktree 交付结果。**[在 GitHub
> 查看仓库](https://github.com/dream-num/univer-cli)**。

> **univer-workspace**
>
> `univer-workspace` 是一个面向知识库管理和团队协作的 Office 工作空间。人类可以组织、共同编辑和
> 审阅内容，Agent 通过 CLI 和 Worktree 参与处理。**[在 GitHub
> 查看仓库](https://github.com/dream-num/univer-workspace)**。

> **dsh-univer-office**
>
> `dsh-univer-office` 是 DeepSeek Harness 的 Univer Office 插件。用户可以通过自然语言让 Agent
> 创建或编辑 Office 内容，并在会话中预览、继续修改、合并或丢弃结果。**[在 GitHub
> 查看仓库](https://github.com/dream-num/dsh-univer-office)**。
