univer-workspace README

项目的 README,来自 github.com/dream-num/univer-workspace。合并为一个 markdown 文件:README.md。

Univer Workspace

An open-source Office workspace where people and AI agents create, collaborate, and review together.

Univer Docs · Server SDK · CLI guide · Workspace Agent · Issues

License Node.js pnpm

English | 简体中文

Univer Workspace is a deployable knowledge and collaboration workspace built on the Univer Office SDK. It brings Sheets, Docs, Slides, relational tables, canvases, and more into one shared runtime, with data and references staying connected across artifacts as the workspace changes.

Choose the Workspace Browser for direct editing, Workspace Agent for document conversations and change review, or the CLI for automation. All three connect to the Workspace Server, which owns document storage and permissions. Agents work in isolated Worktrees, verify their changes, and hand the result to a person for review. Humans can continue editing and stay in control of what gets merged.

Univer Workspace showing an English team space with Sheet, Board, Doc, Slide, Base, and folder examples

Why Univer Workspace

For people For agents For operators
Organize content in Personal and Team Spaces Create and edit rich Office content through the Univer Facade API Deploy one Browser and Server application
Co-edit Sheets, Docs, Slides, Bases, and Boards Inspect data, render screenshots/PDFs, and run layout checks Keep product, collaboration, and Blob data under application control
Share content with role- and node-aware access control, including anonymous viewing Discover version-matched Skills and APIs offline Integrate password, GitHub, Discord, or application OAuth login
Use Recent, Trash, file import/export, and review views Work through multiple rounds without changing trunk Operate a documented HTTP API with explicit recovery boundaries

Spreadsheet-based mini-apps · Watch the demo

A Workspace mini-app beside its linked spreadsheet, with metrics, charts, and controls bound to cells

Choose your entry point

Entry point Use it for Get started
Workspace Browser Edit documents directly, collaborate, organize Spaces, and review changes Start Workspace
Workspace Agent Chat with an agent beside your documents, reference local or remote files and folders, and review Worktree changes Install and use Agent
Workspace CLI Automate document tasks from a terminal, scripts, or an existing agent environment CLI installation and usage
Workspace MCP Let Claude, ChatGPT, Cursor, VS Code, Codex, and other AI assistants work in Workspace with one URL Connect an AI assistant

Workspace Agent is a local web application built on DSH (DeepSeek Harness). Its local file references point to the machine running Agent; Workspace documents remain on the connected service. Both Agent and CLI can connect to your existing Workspace deployment or one you start locally.

Connect an AI assistant (MCP)

Workspace runs a remote MCP server. An assistant connected to it can find your files, open a pull request, edit Sheets, Docs, and Slides, read the result back, and mark the pull request ready for you to review in the browser. Nothing is installed on your machine.

Install in Cursor Install in VS Code

See the agent handoff showcase for guest agents, link sharing, claiming, copies, and review through pull requests. How an AI agent signs in explains what happens between adding the URL and the first tool call, including OAuth and CIMD.

Setting Value
Server URL https://space.univer.ai/mcp. For your own deployment, use https://<your-workspace>/mcp (MCP server guide)
Transport Streamable HTTP
Sign-in OAuth in your browser. The consent page lists read, write, publish, and worktree:merge; uncheck anything you do not want to grant. A client on your computer whose browser is not signed in to Workspace connects as a new guest agent with no page. Signed in, the consent page connects it by default as an agent that you own, the one this client used before or a new one, and Yourself connects it as you
Toolsets core by default. Add ?toolsets=core,files for Blob, Asset, Markdown, Typst, SVG, and HTML View tools, admin for repository and label management, or all

A client that cannot run OAuth can send a personal access token as Authorization: Bearer <token>. Create one from Access tokens in the Workspace account menu. On space.univer.ai, editing tools (execute, inspect, import, and export) are currently enabled only for invited accounts; every account can browse, search, and manage issues and pull requests.

Claude Code
claude mcp add --transport http univer-workspace https://space.univer.ai/mcp

Run /mcp in a Claude Code session, select univer-workspace, and sign in. Add --scope user to use it in every project. Claude Code skips OAuth when an Authorization header is configured, so do not set one together with it.

Claude.ai and Claude Desktop

Open Customize → Connectors, choose + Add → Add custom connector, enter Univer Workspace and https://space.univer.ai/mcp, then sign in. Claude Desktop uses the same connector list. On Team and Enterprise plans an owner adds the connector under Organization settings → Connectors first, and members click Connect. These connectors connect from Anthropic's cloud, so a self-hosted Workspace must be reachable from the internet.

ChatGPT

In ChatGPT on the web, open the apps settings (labelled Apps, Plugins, or Connectors depending on your version), turn on Developer mode if your plan requires it, and create a custom MCP app with https://space.univer.ai/mcp and OAuth. Select it with @ in a new chat. Availability depends on the plan; Business and Enterprise admins may need to allow custom MCP apps first.

Codex
codex mcp add univer-workspace --url https://space.univer.ai/mcp
codex mcp login univer-workspace

codex mcp add may start the sign-in by itself. The CLI, IDE extension, and desktop app share ~/.codex/config.toml:

[mcp_servers.univer-workspace]
url = "https://space.univer.ai/mcp"
Cursor

Use the button above, or add this to ~/.cursor/mcp.json (or .cursor/mcp.json in a project). Cursor asks you to sign in the first time it connects.

{
  "mcpServers": {
    "univer-workspace": { "url": "https://space.univer.ai/mcp" }
  }
}
VS Code (GitHub Copilot)

Use the button above, or run:

code --add-mcp '{"name":"univer-workspace","type":"http","url":"https://space.univer.ai/mcp"}'

Then run MCP: List Servers, start univer-workspace, and sign in in the browser. Remote OAuth needs VS Code 1.101 or later. For a single workspace, put the server in .vscode/mcp.json under servers with "type": "http".

Gemini CLI
gemini mcp add --transport http --scope user univer-workspace https://space.univer.ai/mcp

Run /mcp auth univer-workspace to sign in. In settings.json, Streamable HTTP servers use httpUrl; url means SSE.

opencode
opencode mcp add univer-workspace --url https://space.univer.ai/mcp --global
opencode mcp auth univer-workspace
Windsurf

Open the MCP config file from Windsurf Settings (Add Server or Open MCP config file), add the server, and refresh. Windsurf asks you to sign in when it connects.

{
  "mcpServers": {
    "univer-workspace": { "serverUrl": "https://space.univer.ai/mcp" }
  }
}
WorkBuddy

Open Connectors → Custom Connector → Configure MCP, add the server, save, and enable it. When it shows "Authentication required", click Connect and sign in.

{
  "mcpServers": {
    "univer-workspace": { "type": "streamableHttp", "url": "https://space.univer.ai/mcp" }
  }
}
Grok

On grok.com, open Connectors → New Connector → Custom, enter https://space.univer.ai/mcp, and sign in. Grok connects from xAI's cloud, so a self-hosted Workspace must be reachable from the internet.

Other clients

Any client that supports Streamable HTTP and OAuth 2.1 can use the server URL directly. Workspace supports Client ID Metadata Documents and dynamic client registration, as How an AI agent signs in explains. A client that only runs local stdio servers can use a bridge such as npx -y mcp-remote https://space.univer.ai/mcp.

If a client keeps asking you to sign in, sign out of the server in that client (for example claude mcp logout univer-workspace, opencode mcp logout univer-workspace, or /mcp auth in Gemini CLI) and sign in again. If a tool you expect is missing, check the ?toolsets= part of the URL.

Space Preview

Space is a proof-of-concept plugin for Univer Workspace that you install in official DeepSeek Harness (DSH). It connects to your Workspace service so you can browse files, edit Univer Docs and Sheets, and chat with an AI alongside an open document.

Space Preview in DeepSeek Harness: file navigation, a Univer document, and the chat composer

See the Space plugin guide for the package, installation steps, and known limitations. Space is optional and does not replace Workspace Agent. Use non-critical documents while evaluating this preview.

How it works

flowchart LR
    Human([Human]) --> Browser[Workspace Browser]
    Agent([AI agent]) --> CLI[Workspace CLI]
    Human --> AgentApp[Workspace Agent: local conversation and review]
    AgentApp --> Server
    Browser --> Server[Workspace Server]
    CLI --> Server
    Server --> Product[(Product data)]
    Server --> Collaboration[(Collaboration data)]
    Server --> Blobs[(Blob and asset bytes)]

The Browser is the direct editing and collaboration surface. Workspace Agent combines a conversation with document previews and Worktree review. The CLI gives agents a structured way to load, understand, edit, validate, and render the same content. The Server resolves authoritative identity and permissions, owns Workspace product workflows, and composes the Univer Collaboration SDK.

Worktree turns agent editing into an explicit review workflow:

create Worktree
→ agent edits and verifies an isolated draft
→ Ready
→ human reviews in the Browser or Workspace Agent
→ Merge or Reopen
→ trunk

Intermediate changes remain isolated from shared content until a person accepts them. See the CLI guide for the complete product workflow.

Quick start

These commands start the Workspace service and Browser. To add the conversation interface, follow the Workspace Agent guide.

Requirements

Install dependencies and prepare the application configuration:

pnpm install
cp apps/workspace/.env.example apps/workspace/.env

Start the Server:

pnpm workspace:dev:server

In another terminal, start the Browser development server:

pnpm workspace:dev:web

Open http://127.0.0.1:5173. Vite provides hot module replacement and proxies API and WebSocket traffic to the Server at http://127.0.0.1:3020.

The Server can also serve the latest built Browser from port 3020 when apps/workspace/dist/public exists. Its product API is available at http://127.0.0.1:3020/api-docs and http://127.0.0.1:3020/openapi.yaml.

For database, file storage and sign-in settings, see the Workspace configuration guide. For Docker deployment and upgrades, see the Workspace application guide.

One-Click Deploy

Deploy on RepoCloud

Use Workspace Agent

Workspace Agent is a desktop app built on DSH for Univer Workspace. Reference Workspace files with @, create and edit documents through conversation, then review changes and choose whether to merge or discard them.

The Agent guide includes a prompt you can give a coding agent before cloning the repository, as well as manual setup and usage instructions. It walks through choosing or starting your own Workspace service, registering the OAuth callback, configuring model credentials, and opening the complete token URL printed by the local launcher.

Desktop Agent packaging and manual CI are described in the desktop guide. Downloads use GitHub Releases; Agent release tags never trigger automatic publication.

Use the Workspace CLI

To use Workspace with an existing agent such as Claude, Codex, or Kimi Work, install the CLI and Workspace CLI Skill in the environment where the agent runs:

npm install --global univer-workspace-cli@latest
npx skills add dream-num/univer-workspace --skill univer-workspace-cli -g

Point the CLI at your own Workspace deployment, then begin browser-approved login:

uvw config set workspace.origin <origin>
uvw auth login

After the user approves the displayed URL and verification code, complete the one-time exchange:

uvw auth login --complete

The installed package includes version-matched Skills, structured JSON output, Facade API discovery, content inspection, PNG/PDF rendering, Office exchange, and Worktree workflows. See the CLI guide for the complete usage and login contract.

Repository layout

apps/workspace                 Workspace Browser, Server, HTTP contract, and deployment app
apps/cli                       Agent-ready remote Workspace automation application
apps/mcp                       Private remote MCP gateway, executor, and renderer
apps/agent                     Workspace Agent application for document conversations and review
apps/space-plugin              Space content workspace plugin for DSH Desktop (separate npm graph)
packages/client-core           Private Node-hosted Workspace Agent Client capabilities
packages/reference-provider   Private Browser-only referenced-Unit policy
packages/workspace-agent-runtime   Private content execution layer shared by Agent hosts
packages/workspace-editor-presets  Private Univer editor plugin composition shared by Web and Space
packages/workspace-file-browser    Private Workspace file navigation UI
packages/workspace-html-viewer Private shared HTML View sandbox and binding host
packages/workspace-markdown-viewer Private shared read-only Markdown preview
packages/workspace-ui          Private shared Workspace UI primitives
packages/unit-comparison-viewer    Private read-only Unit comparison viewer
packages/dsh-runtime           Pinned DSH CLI runtime cohort, materialized with pnpm deploy
packages/dsh-univer-workspace-plugin        Workspace Agent Workspace capabilities and browser UI
packages/dsh-univer-workspace-skin-plugin   Workspace Agent Workspace visual skin
scripts                       SDK version and local CLI release tooling

This repository is the product composition root, not a replacement for the upstream SDKs. Univer Runtime owns the Unit model, rendering, Facade APIs, and Office content capabilities. Univer Collaboration SDK owns snapshots, revisions, OT, realtime collaboration, and Worktree protocol contracts. Univer CLI SDK owns the reusable headless runtime, execution, inspection, and rendering capabilities.

Workspace owns product identity, Spaces, hierarchy, ACLs, sharing, Trash, Recent, Blob storage policy, remote workflows, and deployment. Client Core shares storage-neutral authentication, Workspace workflows, local Node-hosted Blob/Asset transfer, and the worker-backed content runtime between repository applications, including Node-hosted Office exchange, Markdown compile/create/native-readback/update, Typst compile/materialize/apply, render Unit assembly, screenshots, PNG/PDF output, Slide and Board layout lint, the render-page source, and the SVG compile/measure/apply workflow; the reference-provider package remains Browser-only. Both are private implementation modules, not additional public applications or SDKs.

Architecture principles

Read the technical architecture, application design, and data model before changing these boundaries.

Development and verification

Run the smallest relevant check while iterating. Before opening a PR, run the same verification entry used by CI on Linux or macOS:

pnpm verify
pnpm verify --stage test-mcp

The six stages are static, test-workspace, test-cli, test-mcp, test-rest and package. They include HTTP contract generation verification, typechecks, SDK dependency and type-identity checks against installed published packages, all workspace tests, builds, an isolated installation of the actual CLI tarball, and Workspace production import/migration checks. pnpm check remains the shorter typecheck/test loop.

An existing installation can hide dependency-resolution problems. To verify a committed change with a fresh dependency graph and build state, use Node 24 and the pinned pnpm version in a separate worktree:

git worktree add --detach ../univer-ci-check HEAD
cd ../univer-ci-check
node scripts/verify.mjs --install

--install records pnpm install --frozen-lockfile before verification. CI uses this entry in its fresh checkout. The worktree recipe checks HEAD; uncommitted changes in the original directory are not included. A normal local run records whether its source tree is dirty and does not claim a clean installation.

Reports live in .verification/. Each invocation keeps separate command logs, process exit codes/signals, structured Vitest and node:test results, and a summary with commit, attempt, stage, file and test. A failed process remains a failure even if its test report is missing. CI uploads each stage under a distinct run/attempt artifact name for 30 days, including failed runs. Rerunning does not overwrite the first attempt. Setup failures before the verification entry and forcibly terminated runners may have incomplete artifacts; their workflow status still counts.

With gh authenticated, inspect recent first-attempt outcomes and recurring failures:

pnpm ci:reliability --limit 20

The first-pass denominator excludes cancelled and unfinished first attempts. Signature analysis covers failed first attempts. Its coverage is reported separately because older or expired artifacts cannot identify individual failing tests. Reports can contain test fixture data; keep them within the repository's existing access boundary.

Update every version-coupled Univer dependency and the lockfile with the repository script rather than editing individual manifests:

pnpm update:univer-sdk --sdk_version <exact-sdk-version>

Delivery model

The CLI package and Workspace deployment are delivered independently from the same source. Internal CLI build, validation, and publication procedures are documented in the maintainer release guide.

Documentation

Resource Scope
Univer Web SDK documentation Browser Runtime, presets, plugins, Facade API, and editor capabilities
Univer Server SDK documentation Server SDK: collaboration, import and export, deployment, and license
Workspace application guide Running Workspace, Docker deployment and upgrades
Workspace configuration Environment variables, defaults and deployment examples
Workspace CLI guide Installation, login, agent workflows, and package contract
Workspace Agent guide Local profile, browser OAuth, sessions, files, Worktree, and identity switching
Client Core package Private Node-hosted client capability boundary
Technical architecture Browser, Server, storage, OpenAPI, and module boundaries
HTTP contract Product API source and generation workflow
Reference-provider package Private Browser referenced-Unit policy

Contributing

Issues and pull requests are welcome. Before changing code, read AGENTS.md and the README or design document closest to the target. Preserve unrelated changes, do not edit generated files by hand, and include the verification required by the affected boundary.

Univer SDK License

You can try Workspace locally with the bundled development license on localhost or 127.0.0.1. For another hostname, such as workspace.example.com, use a Univer Office SDK license that covers that domain. For license plans and prices, see Univer pricing.

  1. When building the frontend, set the VITE_UNIVER_LICENSE environment variable to the contents of license.txt. Rebuild the frontend when you change the license.
  2. When starting the server, set both environment variables. Set UNIVER_LICENSE to the contents of the same license.txt file and UNIVER_LICENSE_KEY to the contents of the matching licenseKey.txt file.

If you also import or export Office files with the CLI, set UNIVER_LICENSE and UNIVER_LICENSE_KEY in the CLI environment.

For the Docker build argument and container environment settings, see the Docker deployment example.

License

Univer Workspace is licensed under Apache-2.0.

Space 和原 Workspace Agent 共用 packages/workspace-agent-runtime 的既有 Headless Facade / Worktree changeset 实现。它只负责内容 worker,不提供另一个 DSH Runtime。先运行 pnpm --filter @univerjs/univer-workspace-agent-runtime build,再构建相应消费者;Space 将该公开入口与 worker 内联/复制到自己的安装包,不把 file: 开发依赖带入 Host。

univer-workspace (dream-num/univer-workspace)

正在搜索数据库…

这是什么?Univer Workspace 是一个开源、可自托管的 Office 工作区,把 Sheets、Docs、Slides、关系表、画布和白板整合进同一个共享运行时,让人和 AI 智能体在其中共同创建、协作和审阅内容。
这是一个应用、一个 SDK,还是两者都是?它是一个可部署的应用,由 Browser 和 Server 组成,另有独立的 CLI 和本地 Agent 应用,全部构建于 Univer Office SDK 之上——你也可以直接用这个 SDK 构建自己的工具。
怎么把它跑起来?用 pnpm 安装依赖并准备好应用配置,启动 Server,然后在另一个终端启动 Browser 开发服务器,并在浏览器中打开它。
运行之前需要安装什么?安装依赖并运行 Server 和 Browser,需要 Node.js 24 或更高版本以及 pnpm 11。
正式部署之前有什么坑要注意吗?推送 release 标签并不会自动部署 Server,而且 Browser/CLI 自带一个每 90 天轮换一次的“运行时开发许可证”凭据,正式使用时必须用你自己的许可证环境变量覆盖它。
我的文档数据实际存在哪里?文档存储和权限由 Workspace Server 掌管,运营者把产品、协作和文件(Blob)数据保留在自己应用的控制之下,而不是交给第三方。
AI 智能体的修改在影响我的真实文档之前如何接受审查?智能体在隔离的 Worktree 中工作,可以在不触碰共享主干的情况下跨多轮进行修改和验证;之后由人工审查并明确接受结果,然后才会合并。
Workspace Agent 基于什么构建?Workspace Agent 是一个基于 DSH(DeepSeek Harness)构建的本地 Web 应用,让你可以在文档旁边与智能体对话、引用本地或远程文件,并审查 Worktree 变更。
用户如何登录 Workspace Server?Server 支持密码登录,也支持通过 GitHub、Discord 或你自己的应用进行 OAuth 登录。
智能体在电子表格里究竟能构建什么?智能体可以生成基于电子表格的迷你应用,例如决策仪表盘和业务报告,页面上的指标、图表和控件都绑定到单元格,实现实时的协同数据读写。
作者
dream-num
大小
23.9 MB
星标
2.3K
时长
3个月
提交 · 90 天