Overview
ZCode is Z.ai's coding agent workbench. One repository contains the Electron desktop client, the web client with its HTTP/WebSocket backend, shared React UI, and the Agent CLI and runtime source. The same zcode command covers all terminal-side entry points: run with no arguments for the TUI, pass --web to start the browser workbench, or hand other arguments to the agent CLI.
Key Features
- Three delivery forms from one codebase: Electron desktop app, self-hosted web workbench, and terminal agent (TUI/CLI).
- Single
zcodelauncher — TUI by default,--webfor browser mode with configurable workspace, port, and host binding. - Remote development over SSH/WSL, with runtime assets uploaded from the local machine via SFTP instead of pulling from a CDN.
- Web mode security by default: binds
127.0.0.1, and automatically issues an access token when listening on a non-local address. - Pluggable provider layer (
packages/provider,provider-node) for model access, with an agent client SDK and RPC framework for embedding.
Use Cases
- Terminal-first vibe coding with the
zcodeTUI, as a drop-in agent CLI in any shell or editor workflow. - Running a browser-based coding workbench on a local or remote machine and accessing it from any device on the LAN.
- Using the desktop app for a native Electron experience with the same agent runtime as the CLI and web versions.
Technical Details
- pnpm-workspace monorepo in TypeScript:
packages/desktop(Electron main/host/renderer),packages/web,packages/server(HTTP/WebSocket service and remote connections),packages/ui(shared React components and Zustand state), pluspackages/rpcandpackages/client(RPC framework and agent client SDK). - The Agent CLI (
apps/zcode-cli) is not just a frontend — it provides the agent runtime that the desktop and web clients embed, so all three entry points share one execution engine. - CLI distribution is assembled as a tar.gz with SHA-256 checksums, a
latest.jsonversion index, and aninstall.shscript that installs to~/.zcode/runtime; API/WebSocket authentication is controlled viaZCODE_SERVER_AUTH_TOKENor a programmaticauthTokenoption. - Web dev mode runs the Vite dev server and backend together, proxying
/wsand/apito the local backend while routing OAuth token exchange separately.