# AI use cases for ZCode (zai-org/ZCode)

Repo: [zai-org/ZCode](https://github.com/zai-org/ZCode) | Use cases: 4 | Page: https://dedupedai.com/use-cases/zai-org-zcode/

ZCode is Z.ai's AI coding workbench, offering a desktop app, a browser interface and a terminal agent, all built from one TypeScript monorepo.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run a browser coding workspace on a local project: https://dedupedai.com/use-cases/zai-org-zcode/run-browser-coding-workspace-locally/
- Run the terminal agent from source on a project: https://dedupedai.com/use-cases/zai-org-zcode/run-terminal-agent-from-source/
- Package the zcode command and test it locally: https://dedupedai.com/use-cases/zai-org-zcode/package-and-test-zcode-command/
- Build a UI plugin from the Excalidraw example: https://dedupedai.com/use-cases/zai-org-zcode/build-ui-plugin-from-excalidraw-example/

## How to run a browser coding workspace on a local project with ZCode

Repo: [zai-org/ZCode](https://github.com/zai-org/ZCode) | Difficulty: Intermediate | Time: 60 minutes | Basis: From the README

Start the web client and backend against one project folder and open it in a browser.

**Who it is for:** A developer who wants a browser-based AI coding workspace on a local repository.

**The problem:** Setting up the web client and backend by hand is slow without the repo's dev command.

**The outcome:** A running web workspace at localhost:5173 that works on the chosen project folder.

### Steps

1. Install Git, Node.js 24.14.0 and pnpm 10.33.2 as listed in mise.toml.
2. Clone the repository and run `pnpm bootstrap` from the repository root.
3. Run `ZCODE_SERVER_WORKSPACE=/path/to/project pnpm dev:web` on macOS or Linux.
4. Open `http://localhost:5173` in a browser.

### Prompt to paste into your agent

```text
In the zai-org/ZCode repo, run `pnpm bootstrap`, then `ZCODE_SERVER_WORKSPACE=<project-path> pnpm dev:web`. Report the web dev server URL and confirm that the backend at http://localhost:3030 responds.
```

### Caveat

The README gives the ZCODE_SERVER_WORKSPACE example only for macOS and Linux, and the browser must use port 5173 while the backend uses 3030.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/zai-org-zcode/run-browser-coding-workspace-locally/

## How to run the terminal agent from source on a project with ZCode

Repo: [zai-org/ZCode](https://github.com/zai-org/ZCode) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Build and launch the Agent CLI and TUI directly from the apps/zcode-cli source.

**Who it is for:** A developer who wants the terminal coding agent without the desktop app or a packaged release.

**The problem:** The packaged zcode command may point at an older install, so source runs are needed to test changes.

**The outcome:** An interactive TUI session started from the current source, with the CLI help output confirmed first.

### Steps

1. Complete the setup in the repository root with `pnpm bootstrap`.
2. Check the entry point with `pnpm --filter @zcode/cli dev --help`.
3. Start the interactive terminal agent with `pnpm --filter @zcode/cli dev`.
4. Read the CLI usage guide at apps/zcode-cli/docs/usage/README.md for model setup, non-interactive calls and trajectory recording.

### Prompt to paste into your agent

```text
In the zai-org/ZCode repo, run `pnpm bootstrap` and then `pnpm --filter @zcode/cli dev --help`. Report the available options and state whether the help text lists a non-interactive mode.
```

### Caveat

This entry point runs the Agent CLI directly and skips the --web routing that the packaged zcode command provides.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/zai-org-zcode/run-terminal-agent-from-source/

## How to package the zcode command and test it locally with ZCode

Repo: [zai-org/ZCode](https://github.com/zai-org/ZCode) | Difficulty: Advanced | Time: 90 minutes | Basis: From the README

Build the release bundle, unpack it to a debug folder and start Web mode from it.

**Who it is for:** A maintainer who needs to check the packaged zcode command before publishing it.

**The problem:** Source runs do not prove the full release bundle works, so the packaged output needs its own test.

**The outcome:** A tested unpacked zcode runtime that serves the web interface on port 3030 from the built bundle.

### Steps

1. Set `ZCODE_DIST_BASE_URL` in `.env` or the environment, or pass `--base-url` to the build with your own hosting address.
2. Run `pnpm build:zcode --base-url https://downloads.example.com/zcode/`, replacing the placeholder with the real download address.
3. Read the version from dist/zcode/latest.json and extract `dist/zcode/releases/<version>/zcode-<version>.tar.gz` into `dist/zcode/debug`.
4. Start the unpacked runtime with `node dist/zcode/debug/zcode/bin/zcode.mjs --web --workspace "$PWD" --port 3030 --no-open`. (inferred, check the README)
5. Open `http://127.0.0.1:3030` in a browser to confirm the web page and agent run from the same backend.

### Prompt to paste into your agent

```text
In the zai-org/ZCode repo, run `pnpm build:zcode --base-url <download-root-url>`, extract the tarball listed in dist/zcode/latest.json into dist/zcode/debug, and start it with --web on port 3030. Report the URL and confirm that http://127.0.0.1:3030 returns a page.
```

### Caveat

pnpm build:zcode only creates the release package and does not replace an existing zcode command already on PATH.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/zai-org-zcode/package-and-test-zcode-command/

## How to build a UI plugin from the Excalidraw example with ZCode

Repo: [zai-org/ZCode](https://github.com/zai-org/ZCode) | Difficulty: Advanced | Time: 120 minutes | Basis: From the README

Follow the UI Plugin guide to start a plugin from the Excalidraw canvas example.

**Who it is for:** A developer who wants to add a custom page or panel to the ZCode interface.

**The problem:** Plugin APIs and the install and update flow are documented separately from the code, so a guided start saves time.

**The outcome:** A working UI plugin tested in the web dev server and prepared for a zcode-plugins pull request.

### Steps

1. Read UI_PLUGIN.md for plugin capabilities, the page API, install and update steps and host debugging entry points.
2. Start from the Excalidraw canvas collaboration example described in that guide.
3. Run `pnpm dev:web` and open `http://localhost:5173` to check the plugin page in the browser.
4. Before opening a PR to zcode-plugins, declare whether it is a UI Plugin and enter the plugin name in the PR template.

### Prompt to paste into your agent

```text
In the zai-org/ZCode repo, read UI_PLUGIN.md and build a plugin named <plugin-name> following the Excalidraw example. Report the files created and confirm that the plugin page loads at http://localhost:5173 under `pnpm dev:web`.
```

### Caveat

The README only links to UI_PLUGIN.md, so the exact plugin API details must be taken from that file rather than from this README.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/zai-org-zcode/build-ui-plugin-from-excalidraw-example/
