# Get started

> Build your first Office application with a coding agent, then integrate and deploy it.

- Human documentation: [https://docs.univer.ai/overview/get-started](https://docs.univer.ai/overview/get-started)

- Agent Markdown: [https://docs.univer.ai/overview/get-started.md](https://docs.univer.ai/overview/get-started.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.6.0`

- Source: [get-started.mdx](https://github.com/dream-num/documentation/blob/dev/content/docs/get-started.mdx)

---

This page presents three worked examples: a spreadsheet bound to page inputs, a two-person document collaboration setup, and a CLI that an agent can operate. Choose one example, give its prompt to your coding agent, then follow the integration and deployment steps.

## Decide what to build first

Office SDK covers Sheets, Docs, Slides, Relational Tables, Canvases, and PDFs. Identify the integration path that matches your application goal:

| Your goal | Start here | First success criterion |
| --- | --- | --- |
| Embed an Office editor | [Web SDK installation](https://docs.univer.ai/guides/sheets/getting-started/installation.md) | Create content, edit it, save it, and reopen it. |
| Connect content to a business interface | [Facade APIs](https://docs.univer.ai/guides/sheets/getting-started/facade.md) | Bind page inputs and cells in both directions, and show the real calculation results. |
| Add collaborative editing | [Server SDK collaboration quick start](https://docs.univer.ai/server/collaboration/quick-start.md) | Two independent sessions edit the same content and receive each other's changes. |
| Import, process, and export Office files | [File conversion](https://docs.univer.ai/server/import-export/node.md) | Import a real file, edit it, export it, and inspect the result. |
| Let an agent or CLI operate content | [AI SDK content operations](https://docs.univer.ai/ai/content-operations.md) | Load content, inspect its structure, edit it, and verify the commit or output. |
| Build a workspace for people and agents | [Worktree and review](https://docs.univer.ai/ai/worktree.md) | Keep agent changes in an isolated draft so a person can compare, review, and merge them. |

Combine these capabilities as needed. [Features](https://docs.univer.ai/overview/features.md) lists what each product supports; the three examples below present one complete workflow from start to finish.

## Start with your coding agent

Give your agent the requirements and the [llms.txt](/llms.txt) documentation index link. You do not need to copy the entire SDK documentation into the prompt. Start from the reusable template below, or paste one of the three complete examples.

### One requirements template

Replace `<…>` with your own requirements. Describe one visible result before planning an entire office suite.

```text
Build a locally runnable <application name> with Univer Office SDK.
First read https://docs.univer.ai/llms.txt and the relevant complete examples.
Keep SDK packages on the same version.

Initial content: <a small, ready-to-edit dataset or document>.
Core experience: <one user action and the immediate visible result>.
Acceptance criteria: <two or three concrete, interactive checks>.

Implement only this minimal workflow with the native Univer editor
and real SDK capabilities. Start it, verify it in a browser,
and provide a preview link. Identify any missing required configuration.
```

#### Optional: install the application-building Skill

If your coding agent supports Skills, install [`build-with-univer`](https://github.com/dream-num/skills/tree/main/skills/build-with-univer) so that it can consult the SDK documentation independently and determine how Web SDK, Server SDK, and AI SDK fit into your application.

```bash
npx skills add dream-num/skills --skill build-with-univer
```

Run the command in the project that your agent has open. Confirm the installation with `npx skills list`, then use the template above or one of the examples below. Follow the current documentation and the SDK versions that your project actually uses.

### Example 1: spreadsheet binding

Bind a quantity input to a spreadsheet cell and display the formula result on the page.

```text
Build a locally runnable, single-page quote workspace with Univer Office SDK.
First read https://docs.univer.ai/llms.txt and the relevant complete examples.
Keep SDK packages on the same version.

Use the basic Sheets preset and an editable native spreadsheet.
Seed 2 monitors at 1200 each, 5 keyboards at 300 each,
and 3 headsets at 200 each. Use sheet formulas for line totals and the total.

Place a monitor quantity input and a quote total card beside the sheet.
Bind the input to its cell in both directions. Read the real formula result
for the card; do not recalculate the quote in page code.
Support browser-local saving and restoration on refresh.

Verify: the initial total is 4500; quantity 3 produces 5700;
editing the cell updates the input and card; saving and refreshing
restores the changes. Implement only these features,
verify the running application, and provide a preview link.
```

**Try it:** Change the monitor quantity from 2 to 3, and the total goes from 4500 to 5700. Editing the sheet directly updates the page as well. After you save and refresh, the data is restored. Continue with [Web SDK installation](https://docs.univer.ai/guides/sheets/getting-started/installation.md) and [Facade APIs](https://docs.univer.ai/guides/sheets/getting-started/facade.md).

### Example 2: document collaboration

Open two independent sessions on the same document and verify that edits appear on both sides.

```text
Build a locally runnable, two-person document collaboration demo
with Univer Office SDK. First read https://docs.univer.ai/llms.txt
and the current examples at
https://github.com/dream-num/univer-collaboration-examples.
Keep frontend and server SDK packages on the same version.
Place native Univer modern document editors side by side for Alice and Bob.
Use separate runtimes and online sessions connected to a real Server SDK
collaboration service. Follow the official example to explicitly load
the same server-created document. Seed a few short sentences.

Typing on the left appears on the right; typing on the right updates the left.
Synchronize through the SDK collaboration protocol. Use two fixed demo users,
in-memory storage, and one local service for frontend and backend.
Omit login, file management, and AI chat. Read a Pro License from the environment;
retain the SDK's default behavior and notices when none is configured.

Verify that edits in both directions converge, the server commits updates,
and refreshing reloads the edited content. Explain that restarting the service
resets in-memory data. Implement only these features,
verify the running application, and provide a preview link.
```

**Try it:** Type a sentence on the left, then continue typing on the right. Both sides receive the updates. Refresh the page, and the text remains. This demo stores all data in memory, so a service restart clears it; connect a persistent database before deployment. Continue with the [Server SDK collaboration quick start](https://docs.univer.ai/server/collaboration/quick-start.md).

### Example 3: build your own you-cli

Build your own Office tooling and provide it to the agent that you already use. The tooling should cover Sheet, Doc, Slide, Relational Table, and Canvases, but start with a single Doc to try the "generate → preview → revise through conversation" workflow.

```text
Build a project-local you-cli and Web preview with Univer Office SDK.
First read https://docs.univer.ai/llms.txt and the complete content-operation
examples at https://github.com/dream-num/univer-cli-examples.
Align frontend, server, and AI SDK versions; check the installed API types.

Support Sheet, Doc, Slide, Relational Table, Canvases; start with Doc.
Provide ./you-cli create <type> --name <name>, inspect --unit <id>,
execute --unit <id> --file <path>, open --unit <id>, and --help.
Keep the tool in this project. Supply instructions or a Skill for the current agent.
Return JSON with the relevant unitId, type, commit result, and preview URL.

CLI and Web must use the same real collaborative content and native editor.
Wait for confirmed writes, read them back, and persist content and its catalog.
open returns a URL; the agent opens it in the host preview panel when available.
Use the existing agent for language understanding. Read licenses from the environment.

Verify: create a weekly report through conversation and open its preview;
then add a risk and owner using the same unitId, updating the open preview.
Refreshing and restarting the service must restore content. Run these checks,
provide the preview and usage guide, and start only this example's service.
```

#### Use it through conversation

Give the prompt above to your coding agent. Once the tool exists and the agent has read its project instructions, enter the following in the same conversation:

```text
Use you-cli to create a weekly project report with progress, risks, and next steps.
Open its Web preview.
```

After you have reviewed the result, continue:

```text
Add a risk to that same report: delivery may be delayed, with Alice as the owner.
Update the preview that is already open.
```

The agent reuses the `unitId` of the same document. If the host provides a preview panel, the page appears beside the conversation; other environments use the returned browser link.

#### you-cli command reference

The following are the project-local commands that the prompt specifies. Replace `UNIT_ID` with the `unitId` that `create` returns. The agent writes `edit.js` using the Facade APIs.

| Action | Command | Result |
| --- | --- | --- |
| Create | `./you-cli create doc --name "Weekly report"` | Create a document and return `unitId`; other types are `sheet`, `slide`, `base`, and `board`. |
| Inspect | `./you-cli inspect --unit UNIT_ID` | Read the real content and the current revision. |
| Edit | `./you-cli execute --unit UNIT_ID --file edit.js` | Execute the changes, wait for the commit, and return the result. |
| Preview | `./you-cli open --unit UNIT_ID` | Return the same document's Web URL for the agent to open. |

`./you-cli --help` prints the complete interface. For the APIs behind these commands, see [AI SDK content operations](https://docs.univer.ai/ai/content-operations.md) and the complete [CLI SDK Examples](https://docs.univer.ai/overview/examples/cli-sdk.md).

## Connect the first workflow to your application

Web SDK provides the shared content runtime. Add Server SDK when multiple people need to edit together, and AI SDK when an agent needs to operate content. See [Office SDK overview](https://docs.univer.ai/overview.md) for the role of each package.

| Integration step | What to connect in your application | Continue reading |
| --- | --- | --- |
| Mount the editor | Mount a preset, connect business interactions through Facade APIs, save snapshots, and dispose of instances. | [Web SDK integration](https://docs.univer.ai/guides/sheets/getting-started/installation.md) |
| Connect the backend | Reuse existing identity and permissions, configure a database for shared documents, and add file import and export as needed. | [Collaboration](https://docs.univer.ai/server/collaboration/quick-start.md), [file conversion](https://docs.univer.ai/server/import-export/node.md) |
| Connect an existing agent | Expose content operations, calculation, and verification as tools or a CLI; add Worktree when review is required. | [AI SDK content operations](https://docs.univer.ai/ai/content-operations.md), [Worktree](https://docs.univer.ai/ai/worktree.md) |

## Application architecture

Your application and the agent that you already run can work on the same Office content. The interface handles interaction, the agent calls tools, and your backend retains ownership of identity, permissions, and storage.

**Blue nodes are supplied and managed by you:** your interface, your existing agent, the business API with identity and permissions, the database, and file storage. The nodes marked SDK are Univer capabilities that you integrate into the application.

```mermaid
%%{init: {"themeVariables":{"fontSize":"13px"},"flowchart":{"padding":10,"nodeSpacing":20,"rankSpacing":20}}}%%
flowchart TB
    UI["Your application interface"]
    UI --> Editor["Web SDK · Editor"]
    Agent["Your existing agent"] --> Tools["AI SDK · Office tools"]
    Editor <-->|Shared editing| App["Your business API · Identity and permissions"]
    Tools <-->|Content operations and commits| App
    App --> Server["Server SDK · Collaboration and conversion"]
    Tools --> Runtime["Web SDK · Headless content runtime"]
    Server --> Runtime
    Server --> Storage[("Your database and file storage")]
    classDef appOwned fill:#e8f0ff,stroke:#4771c4,color:#163d75,stroke-width:2px
    class UI,Agent,App,Storage appOwned
```

If you only embed an editor, local snapshots are sufficient; shared editing requires a backend. Retain the model and orchestration that your agent already uses, let AI SDK handle content operations, and add Worktree when you need isolated edits, comparison, and review.

## Build and deploy with Workspace

[Univer Workspace](https://github.com/dream-num/univer-workspace) combines all three SDKs in a complete office workspace. Run the following commands from the root of the Workspace repository, and follow its [README](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/README.md) for prerequisites.

1. **Develop locally.** Install the dependencies, run `pnpm workspace:dev:server` and `pnpm workspace:dev:web` in two separate terminals, and open `http://127.0.0.1:5173`. The Web development server proxies API and WebSocket requests to the backend.
2. **Build and run.** Build only the Workspace application, then start its production entry point:

```bash
pnpm --filter @univerjs/univer-workspace build
pnpm workspace:start
```

The build places Web assets in `dist/public` and server code in `dist/server`; a single Node.js process serves both the static pages and the APIs.

3. **Prepare deployment.** Configure licenses, identity, and data directories. Persist product data, collaboration data, and uploaded assets, then restart the service and confirm that the data is restored. See [Docker deployment](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/README.md#docker) and the [architecture](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/docs/architecture.md).

When a single process is no longer sufficient, [Server SDK deployment guidance](https://docs.univer.ai/server/deployment.md) explains how to split the services.

## Explore more open-source projects

- [Univer CLI](https://docs.univer.ai/overview/examples/cli.md): Create, edit, and inspect Office content from an agent or a terminal in a local workspace, then review the changes in the Viewer.
- [DeepSeek Harness](https://docs.univer.ai/overview/examples/deepseek-harness.md): Add Office tools, live previews, and draft review to a conversation that your agent already has.

[All examples](https://docs.univer.ai/overview/examples.md) collects the project demos and their repository links.
