Skip to content

Commit 270f84e

Browse files
committed
docs: rewrite workspace readme
1 parent e398d1b commit 270f84e

2 files changed

Lines changed: 360 additions & 103 deletions

File tree

README.md

Lines changed: 190 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,175 @@
1+
<div align="center">
2+
13
# Univer Workspace
24

3-
English | [简体中文](README.zh-CN.md)
5+
**An open-source Office workspace where people and AI agents create, collaborate, and review together.**
6+
7+
[Live Workspace](https://workspace.univer.plus/) · [Univer Docs](https://docs.univer.ai/) · [CLI guide](apps/cli/README.md) · [Issues](https://github.com/dream-num/univer-workspace/issues)
48

59
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
10+
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D24-339933?logo=node.js&logoColor=white)](package.json)
11+
[![pnpm](https://img.shields.io/badge/pnpm-10-F69220?logo=pnpm&logoColor=white)](package.json)
612

7-
Univer Workspace is the product repository for the Workspace browser and server,
8-
its HTTP contract, the Workspace CLI, and the private reference-provider package.
9-
The product organizes collaborative office content, access, sharing, Trash, history,
10-
and isolated Worktree changes.
13+
English | [简体中文](README.zh-CN.md)
1114

12-
## Repository layout
15+
</div>
16+
17+
Univer Workspace is a deployable knowledge and collaboration product built on the
18+
[Univer SDK](https://docs.univer.ai/). It combines a human-facing Browser, a shared
19+
Server, and an agent-ready CLI so people and AI agents can work on the same Sheets,
20+
Docs, Slides, Bases, and Boards.
21+
22+
Agents work in isolated Worktrees, verify their changes, and hand the result to a
23+
person for review. People stay in control of what is merged into the shared trunk.
24+
25+
## Why Univer Workspace
26+
27+
| For people | For agents | For operators |
28+
| ------------------------------------------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------- |
29+
| Organize content in Personal and Team Spaces | Create and edit rich Office content through the Univer Facade API | Deploy one Browser and Server application |
30+
| Co-edit Sheets, Docs, Slides, Bases, and Boards | Inspect structured data, render screenshots, and run layout checks | Keep product, collaboration, and Blob data under application control |
31+
| Share content with role- and node-aware access control | Discover version-matched Skills and APIs offline | Integrate password, GitHub, Discord, or application OAuth login |
32+
| 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 |
33+
34+
## How it works
35+
36+
```mermaid
37+
flowchart LR
38+
Human([Human]) --> Browser[Workspace Browser]
39+
Agent([AI agent]) --> CLI[Workspace CLI]
40+
Browser --> Server[Workspace Server]
41+
CLI --> Server
42+
Server --> Product[(Product data)]
43+
Server --> Collaboration[(Collaboration data)]
44+
Server --> Blobs[(Blob and asset bytes)]
45+
```
46+
47+
The Browser is the interactive editing and review surface. The CLI gives agents a
48+
structured way to load, understand, edit, validate, and render the same content. The
49+
Server resolves authoritative identity and permissions, owns Workspace product
50+
workflows, and composes the Univer Collaboration SDK.
51+
52+
Worktree turns agent editing into an explicit review workflow:
1353

1454
```text
15-
apps/workspace Workspace browser, server, and HTTP contract
16-
apps/cli Agent-ready Workspace CLI
17-
packages/reference-provider Private browser reference-provider policy
55+
create Worktree
56+
→ agent edits and verifies an isolated draft
57+
→ Ready
58+
→ human reviews in the Browser
59+
→ Merge or Reopen
60+
→ trunk
1861
```
1962

20-
The repository consumes version-matched `@univer-cli/*`, `@univerjs/*`, and
21-
`@univerjs-pro/*` packages from the internal npm registry. The application and
22-
reference provider are private workspace packages. Only `univer-workspace-cli`
23-
is packaged for the internal npm registry.
63+
Intermediate changes remain isolated from shared content until a person accepts
64+
them. See the [CLI guide](apps/cli/README.md) for the complete product workflow.
2465

25-
## Development
66+
## Quick start
2667

27-
Requirements:
68+
### Requirements
2869

2970
- Node.js 24 or newer
3071
- pnpm 10
31-
- access to the internal Univer npm registry
72+
- Access to the internal Univer npm registry
73+
74+
Install dependencies and prepare the application configuration:
3275

3376
```bash
3477
pnpm install
78+
cp apps/workspace/.env.example apps/workspace/.env
79+
```
80+
81+
Start the Server:
82+
83+
```bash
3584
pnpm workspace:dev:server
85+
```
86+
87+
In another terminal, start the Browser development server:
88+
89+
```bash
3690
pnpm workspace:dev:web
3791
```
3892

39-
`workspace:dev:server` watches the backend and listens on
40-
<http://127.0.0.1:3020>. When `apps/workspace/dist/public` exists, the server also
41-
serves that last-built static web application; it does not rebuild or hot-reload web
42-
changes.
93+
Open <http://127.0.0.1:5173>. Vite provides hot module replacement and proxies API
94+
and WebSocket traffic to the Server at <http://127.0.0.1:3020>.
95+
96+
The Server can also serve the latest built Browser from port 3020 when
97+
`apps/workspace/dist/public` exists. Its product API is available at
98+
<http://127.0.0.1:3020/api-docs> and
99+
<http://127.0.0.1:3020/openapi.yaml>.
100+
101+
Configuration, authentication, storage, Docker, and database migration details live
102+
in the [Workspace application guide](apps/workspace/README.md).
103+
104+
## Use the Workspace CLI
105+
106+
Install the agent-facing CLI from the internal registry:
107+
108+
```bash
109+
npm install --global univer-workspace-cli@latest \
110+
--registry=https://insider-npm-registry.univer.work/
111+
```
112+
113+
The CLI targets <https://workspace.univer.plus/> by default. Point it at another
114+
deployment when needed, then begin browser-approved login:
115+
116+
```bash
117+
univer-workspace-cli config set workspace.origin <origin>
118+
univer-workspace-cli login
119+
```
120+
121+
After the user approves the displayed URL and verification code, complete the
122+
one-time exchange:
43123

44-
`workspace:dev:web` starts the Vite web development server at
45-
<http://127.0.0.1:5173>, enables hot module replacement, and proxies API and WebSocket
46-
requests to port 3020. Run both commands and open port 5173 for web development.
47-
Use port 3020 alone for backend work or to inspect the latest built web application.
124+
```bash
125+
univer-workspace-cli login --complete
126+
```
48127

49-
See [the Workspace application README](apps/workspace/README.md) for configuration,
50-
deployment, and data migration details.
128+
The installed package includes version-matched Skills, structured JSON output,
129+
Facade API discovery, content inspection, rendering, Office exchange, and Worktree
130+
workflows. See the [CLI guide](apps/cli/README.md) for the complete usage and login
131+
contract.
51132

52-
## Verification
133+
## Repository layout
134+
135+
```text
136+
apps/workspace Workspace Browser, Server, HTTP contract, and deployment app
137+
apps/cli Agent-ready remote Workspace automation application
138+
packages/reference-provider Private Browser-only referenced-Unit policy
139+
scripts SDK version and local CLI release tooling
140+
```
141+
142+
This repository is the product composition root, not a replacement for the upstream
143+
SDKs. Univer Runtime owns the Unit model, rendering, Facade APIs, and Office content
144+
capabilities. Univer Collaboration SDK owns snapshots, revisions, OT, realtime
145+
collaboration, and Worktree protocol contracts. Univer CLI SDK owns the reusable
146+
headless runtime, execution, inspection, and rendering capabilities.
147+
148+
Workspace owns product identity, Spaces, hierarchy, ACLs, sharing, Trash, Recent,
149+
Blob storage policy, remote workflows, and deployment. The reference-provider package
150+
is a private Browser implementation detail, not a third public application or SDK.
151+
152+
## Architecture principles
153+
154+
- **One authoritative Server.** Client-provided users, roles, Resources, Units,
155+
Worktrees, and revisions are never trusted as authority.
156+
- **Separate storage boundaries.** Product data, collaboration state, and Blob bytes
157+
have distinct owners and are coordinated through durable, idempotent operations.
158+
- **Published SDK contracts only.** The repository consumes public package exports and
159+
never depends on adjacent source checkouts.
160+
- **One exact SDK baseline.** Version-coupled `@univer-cli/*`, `@univerjs/*`, and
161+
`@univerjs-pro/*` packages always move together.
162+
- **Contract-first HTTP.** OpenAPI source, generated types, Server routes, Browser, and
163+
CLI must describe the same behavior.
164+
165+
Read the [technical architecture](apps/workspace/docs/architecture.md),
166+
[application design](apps/workspace/docs/application-design.md), and
167+
[data model](apps/workspace/docs/data-model.md) before changing these boundaries.
168+
169+
## Development and verification
170+
171+
Run the smallest relevant check while iterating, then use the repository-level suite
172+
before claiming a complete change:
53173

54174
```bash
55175
pnpm typecheck
@@ -59,48 +179,62 @@ pnpm --filter @univerjs/univer-workspace test:production-import
59179
pnpm package:workspace-cli
60180
```
61181

62-
All version-coupled Univer SDK packages use one exact release. Update them and the
63-
lockfile together:
182+
HTTP contract changes also require:
183+
184+
```bash
185+
pnpm --filter @univerjs/univer-workspace api:verify
186+
```
187+
188+
Update every version-coupled Univer dependency and the lockfile with the repository
189+
script rather than editing individual manifests:
64190

65191
```bash
66192
pnpm update:sdk --sdk_version <exact-sdk-version>
67193
```
68194

69-
## Delivery
195+
## Delivery model
196+
197+
The CLI and Workspace deployment are delivered independently from the same source:
198+
199+
- A stable `vX.Y.Z` tag on `main` publishes `univer-workspace-cli@X.Y.Z` to the
200+
internal registry with the `latest` dist-tag. The source manifest remains `0.0.0`;
201+
packaging injects the release version.
202+
- A manual workflow on `main` publishes exact `X.Y.Z-insider.<suffix>` builds to the
203+
`insiders` channel. Local development releases use `X.Y.Z-dev.<suffix>` and the
204+
`dev` channel.
205+
- Workspace deployment is a separate manual workflow. It builds either an existing
206+
stable tag or an exact commit as `sha-<commit>`. Pushing a release tag does not
207+
deploy the Server.
70208

71-
The source manifest for `univer-workspace-cli` remains at version `0.0.0`; release
72-
versions are injected while building the package and must match the installed CLI
73-
runtime.
209+
Stable and insiders CLI releases validate the repository-wide SDK baseline and test
210+
the actual package artifact before publication. The current workflow publishes only
211+
to insider-npm; public npm promotion is a separate concern.
74212

75-
- Pushing a stable `vX.Y.Z` tag whose commit belongs to `main` publishes
76-
`univer-workspace-cli@X.Y.Z` to insider-npm with the `latest` dist-tag.
77-
- The `Release CLI to insider-npm` workflow can be dispatched manually from `main`
78-
with an exact `X.Y.Z-insider.<suffix>` version for the `insiders` dist-tag.
79-
- Development packages use `X.Y.Z-dev.<suffix>` and can only be published locally:
213+
## Documentation
80214

81-
```bash
82-
pnpm release:cli:dev -- --version X.Y.Z-dev.<suffix>
83-
```
215+
| Resource | Scope |
216+
| ------------------------------------------------------------------- | ---------------------------------------------------------------------- |
217+
| [Univer Runtime documentation](https://docs.univer.ai/) | Browser Runtime, presets, plugins, Facade API, and editor capabilities |
218+
| [Workspace application guide](apps/workspace/README.md) | Configuration, authentication, storage, Docker, and upgrades |
219+
| [Workspace CLI guide](apps/cli/README.md) | Installation, login, agent workflows, and package contract |
220+
| [Technical architecture](apps/workspace/docs/architecture.md) | Browser, Server, storage, OpenAPI, and module boundaries |
221+
| [HTTP contract](apps/workspace/contracts/http/README.md) | Product API source and generation workflow |
222+
| [Reference-provider package](packages/reference-provider/README.md) | Private Browser referenced-Unit policy |
84223

85-
The `latest` and `insiders` paths verify that every version-coupled Univer dependency
86-
uses one exact SDK baseline before packaging. The local `dev` path deliberately skips
87-
that graph check. All three paths build, verify, install, and smoke-test the actual
88-
tarball before publication. This workflow ends at insider-npm and does not perform a
89-
Public Registry Promotion.
224+
## Contributing
90225

91-
Workspace deployment is a separate manual workflow. It can build a selected existing
92-
stable `vX.Y.Z` release tag and use that tag for the image, or, when no release tag is
93-
provided, build the workflow dispatch commit and tag the image as `sha-<commit>`. It
94-
hands the resulting image to the selected deployment environment. Pushing a tag does
95-
not deploy the server.
226+
Issues and pull requests are welcome. Before changing code, read [AGENTS.md](AGENTS.md)
227+
and the README or design document closest to the target. Preserve unrelated changes,
228+
do not edit generated files by hand, and include the verification required by the
229+
affected boundary.
96230

97231
## Runtime development license
98232

99-
The Workspace browser and CLI contain synchronized copies of the approved runtime
100-
development credential for local use. It is rotated every 90 days and is not the
101-
repository software license. Set `VITE_UNIVER_LICENSE` for browser builds or
102-
`UNIVER_LICENSE` for the CLI to override it.
233+
The Browser and CLI contain synchronized copies of the approved runtime development
234+
credential for local use. It rotates every 90 days and is not the repository software
235+
license. Set `VITE_UNIVER_LICENSE` for Browser builds or `UNIVER_LICENSE` for the CLI
236+
to override it.
103237

104238
## License
105239

106-
[Apache-2.0](LICENSE)
240+
Univer Workspace is licensed under [Apache-2.0](LICENSE).

0 commit comments

Comments
 (0)