Anonymous shared terminal over Cloudflare Workers and Durable Objects.
apps/web: React + Vite frontend and Cloudflare Workeragent: Go host agentagent-zig: Zig host agentscripts: local development and bootstrap helpers
- The web app can create a session, attach viewers, and bridge host/viewer websocket traffic through the Worker.
- The Zig agent is the default implementation used by bootstrap downloads.
- The Go agent remains available as a reference implementation and local development fallback.
apps/web: browser UI, Worker routes, Durable Object logicagent/cmd/ttys-agent: Go CLI entrypointagent/internal: Go PTY, websocket transport, platform handling, session flowagent-zig/src: Zig PTY, transport, terminal, and session flow.github/workflows/build-agents.yml: CI build matrix for Go and Zig release assets
- Node.js with
pnpm - Go
1.24.2or compatible toolchain - Zig
0.16.0foragent-zig - A Cloudflare account for deployment
Install dependencies:
pnpm installRun the web app locally:
pnpm devBuild the web app:
pnpm buildDeploy the Worker:
pnpm deployBuild:
cd agent
go build ./...Run against a local server:
./scripts/start.sh http://localhost:5173Attach to an existing session:
./scripts/start.sh http://localhost:5173 <session-id>Windows PowerShell entrypoint:
./scripts/start.ps1 -Server http://localhost:5173Direct Go CLI usage:
cd agent
go run ./cmd/ttys-agent -server http://localhost:5173Flags:
-server: HTTP base URL or direct host websocket URL-session: existing session ID when using an HTTP server URL-shell: shell to launch
Build the default native target:
cd agent-zig
zig buildBuild Windows:
cd agent-zig
zig build -Dtarget=x86_64-windows-gnuBuild Linux:
cd agent-zig
zig build -Dtarget=x86_64-linux-gnuNotes:
- Unix-like targets use the built-in Zig WebSocket transport; no
libcurlruntime dependency is required. - Windows uses
WinHTTPplusConPTY; this path builds successfully but still needs more runtime validation.
Build a local Zig agent into the web download directory:
./scripts/build-local-agent.shThis writes the current machine's Zig agent binary to:
apps/web/public/downloads/local/ttys-agent-zig-<os>-<arch>[.exe]apps/web/public/downloads/local/checksums.txt
GitHub Actions workflow:
.github/workflows/build-agents.yml
It builds:
- Go:
ttys-agent-darwin-amd64ttys-agent-darwin-arm64ttys-agent-linux-amd64ttys-agent-linux-arm64ttys-agent-windows-amd64.exe
- Zig:
ttys-agent-zig-darwin-amd64ttys-agent-zig-darwin-arm64ttys-agent-zig-linux-amd64ttys-agent-zig-linux-arm64ttys-agent-zig-windows-amd64.exe
On v* tags, the workflow also publishes all assets plus checksums.txt to GitHub Releases.
Bootstrap downloads use the Zig agent by default.
On Linux, the Zig release binary uses the portable transport by default.