Get started
Build your first Office application with a coding agent, then integrate and deploy it.
This guide uses three examples to introduce spreadsheet binding, document collaboration, and a CLI for agents. Choose one example, give its prompt to your coding agent, then follow the integration and deployment steps.
Decide what to build first
Office SDK supports Sheets, Docs, Slides, Relational Tables, Canvases, and PDFs. Choose an integration path for your application goal.
| Your goal | Start here | First success criterion |
|---|---|---|
| Embed an Office editor | Web SDK installation | Create content, edit it, save it, and reopen it. |
| Connect content to a business interface | Facade APIs | Bind page inputs and cells in both directions, and display real calculation results. |
| Add collaborative editing | Server SDK collaboration quick start | Two independent sessions edit the same content and receive each other’s changes. |
| Import, process, and export Office files | File conversion | Import a real file, edit it, export it, and inspect the result. |
| Let an agent or CLI operate content | AI SDK content operations | Load content, inspect its structure, edit it, and verify the commit or output. |
| Build a workspace for people and agents | Worktree and review | Keep agent changes in an isolated draft for human comparison, review, and merging. |
Combine these capabilities as needed. Check Features for product support; the three examples below let you experience one complete workflow first.
Start with your coding agent
Give your agent the requirements and the llms.txt documentation index link. You do not need to copy the full SDK documentation. Use the reusable template or paste one of the three complete examples below.
One requirements template
Replace <…> with your requirements. Describe one visible result before planning a complete office suite.
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 editorand 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 to help it find SDK documentation and plan how Web SDK, Server SDK and AI SDK fit into your application.
npx skills add dream-num/skills --skill build-with-univerRun this in the project your agent has open. Confirm installation with npx skills list, then use the template above or an example below. Follow the current documentation and your project’s SDK versions.
Example 1: Spreadsheet binding
Bind a quantity input to a spreadsheet cell and display the formula result on the page.
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 resultfor 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 refreshingrestores 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 watch the total go from 4500 to 5700. Edit the sheet directly and watch the page follow. Save, refresh, and confirm restoration. Continue with Web SDK installation and Facade APIs.
Example 2: Document collaboration
Use two independent sessions to edit the same document and verify that changes appear on both sides.
Build a locally runnable, two-person document collaboration demowith Univer Office SDK. First read https://docs.univer.ai/llms.txtand the current examples athttps://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 SDKcollaboration service. Follow the official example to explicitly loadthe 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 serviceresets 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 on the right. Observe updates in both directions and refresh to confirm the text remains. This demo uses in-memory storage, which resets when the service restarts; connect a persistent database for deployment. Continue with the Server SDK collaboration quick start.
Example 3: Build your own you-cli
Give your current agent an Office tool of your own. Support Sheet, Doc, Slide, Relational Table, and Canvases, starting with one Doc to experience “generate → preview → revise through conversation.”
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-operationexamples 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 it has built the tool and read its project instructions, say in the same conversation:
Use you-cli to create a weekly project report with progress, risks, and next steps.Open its Web preview.After viewing the result, continue:
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 document's unitId. Hosts with a preview panel can display it beside the conversation; other environments use the returned browser link.
you-cli command reference
These are the project-local commands specified by the prompt. Replace UNIT_ID with the unitId returned by create. The agent writes edit.js using 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 real content and the current revision. |
| Edit | ./you-cli execute --unit UNIT_ID --file edit.js | Execute 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. |
Use ./you-cli --help to inspect the interface. See AI SDK content operations and the complete CLI SDK Examples.
Connect the first workflow to your application
Web SDK supplies the shared content runtime. Build on it with Server SDK and AI SDK when you need shared editing or agent operations. See Office SDK overview for their roles.
| 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 instances. | Web SDK integration |
| Connect the backend | Reuse identity and permissions, configure a database for shared documents, and add file import/export as needed. | Collaboration, file conversion |
| Connect an existing agent | Expose content operations, calculation, and verification as tools or a CLI; add Worktree when review is needed. | AI SDK content operations, Worktree |
Application architecture
Your application and existing agent can share 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, existing agent, business API with identity and permissions, database, and file storage. The other nodes labeled SDK represent Univer capabilities integrated into your application.
Start with local snapshots for an embedded editor; connect a backend for shared editing. Keep your agent's existing model and orchestration, and use AI SDK to operate content. Add Worktree for isolated edits, comparison, and review.
Build and deploy with Workspace
Univer Workspace shows the three SDKs in a complete office workspace. Run the following commands from the Workspace repository root. Follow its README for prerequisites.
- Develop locally. Install dependencies, then run
pnpm workspace:dev:serverandpnpm workspace:dev:webin separate terminals. Openhttp://127.0.0.1:5173. The Web development server proxies API and WebSocket requests to the backend. - Build and run. Build only the Workspace application, then start its production entry point:
pnpm --filter @univerjs/univer-workspace buildpnpm workspace:startWeb assets are built into dist/public and Server code into dist/server. One Node.js process serves static pages and APIs.
- Prepare deployment. Configure licenses, identity, and data directories. Persist product data, collaboration data, and uploaded assets, then check restoration after a restart. See Docker deployment and the architecture.
As your application grows, use Server SDK deployment guidance to separate services.
Explore more open-source projects
- Univer CLI: Create, edit, and inspect Office content through an agent or terminal in a local workspace, then review changes in the Viewer.
- DeepSeek Harness: Add Office tools, live previews, and draft review to an existing agent conversation.
Explore all examples for project demos and repository links.
How is this guide?