Tech Stack
openclaw
| Language |
Usage |
| TypeScript |
Core application (ES2023 target, strict mode, NodeNext modules) — ~558k LOC across 3,100+ files |
| Swift |
iOS and macOS native apps (apps/ios/, apps/macos/, apps/shared/OpenClawKit/) |
| Kotlin/Java |
Android native app (apps/android/, Gradle-based) |
| CSS/HTML |
Control UI (ui/ — Lit web components) |
TypeScript dominates. The native apps are thin wrappers around the core Node.js process.
- Node.js >= 22.12.0 (required; uses modern APIs like
fs.promises, structuredClone, etc.)
- Bun supported as optional alternative runtime
- pnpm 10.23.0 — monorepo workspace manager
| Dependency |
Purpose |
@mariozechner/pi-agent-core |
Agent execution loop, message management, tool dispatch |
@mariozechner/pi-ai |
LLM streaming (streamSimple), image content types |
@mariozechner/pi-coding-agent |
createAgentSession(), SessionManager, SettingsManager — the coding agent SDK |
@mariozechner/pi-tui |
Terminal UI for interactive agent sessions |
@agentclientprotocol/sdk |
ACP (Agent Client Protocol) integration |
The Pi agent framework is the backbone. OpenClaw wraps it with its own tool definitions, system prompt construction, channel routing, and plugin system. The SDK owns the inner agentic loop (LLM call → tool dispatch → result feedback → repeat), while OpenClaw manages everything around it: session lifecycle, multi-channel I/O, configuration, and extensibility.
| Dependency |
Channel |
@whiskeysockets/baileys |
WhatsApp (unofficial API) |
grammy + @grammyjs/* |
Telegram |
discord-api-types |
Discord |
@slack/bolt + @slack/web-api |
Slack |
@line/bot-sdk |
LINE |
8 channels built-in, 20+ more via extensions.
| Dependency |
Purpose |
express@^5 |
HTTP server for gateway and web channel |
ws@^8 |
WebSocket server for real-time gateway communication |
undici@^7 |
Modern HTTP client |
playwright-core |
Browser automation for web tools |
| Dependency |
Purpose |
sqlite-vec |
SQLite with vector extension for embeddings |
proper-lockfile |
File-based session locking |
yaml, zod@^4 |
Config parsing and schema validation |
| Dependency |
Purpose |
@lydell/node-pty |
Pseudo-terminal for bash tool execution |
commander@^14 |
CLI argument parsing |
chalk@^5 |
Terminal colors |
sharp@^0.34 |
Image processing/resizing |
croner |
Cron job scheduling |
| Tool |
Purpose |
tsdown@^0.20 (backed by rolldown) |
TypeScript bundler — outputs to dist/ |
vitest@^4 |
Test runner (unit, e2e, live, extension, gateway configs) |
oxlint@^1.48 |
Linter (Rust-based, fast) |
oxfmt@0.33 |
Formatter (Rust-based, fast) |
typescript@^5.9 |
Type checking |
tsx@^4 |
Development-time TypeScript execution |
| Tool |
Purpose |
lit@^3.3.2 |
Web component framework for control UI |
vite@7.3.1 |
UI dev server and bundler |
dompurify@^3 |
HTML sanitization |
marked@^17 |
Markdown rendering |
- Pi agent SDK: Provides a battle-tested agentic loop with tool dispatch, streaming, and context compaction. OpenClaw builds on top rather than reimplementing.
- Express + WebSocket: The gateway needs both HTTP (for REST-style config/management) and persistent connections (for streaming agent output). Express v5 + ws is the simplest combo for this.
- Lit over React: The control UI is a sidebar/panel, not a full SPA. Lit's web component model is lighter and has no virtual DOM overhead.
- SQLite-vec: Embeddings for memory search need to live alongside conversation data. A single SQLite file with vector extension avoids a separate vector DB service.
- pnpm workspaces: 4 workspace packages (core, UI, clawdbot shim, moltbot shim) with shared dependencies. pnpm's strict node_modules prevents phantom dependency issues.
- Rust-based tooling (oxlint, oxfmt, rolldown): Performance. The codebase is 558k+ LOC — fast linting and formatting matters.
pnpm-workspace.yaml defines:
- . (root — main openclaw package)
- ui/ (control UI — Lit + Vite)
- packages/clawdbot/ (compatibility shim)
- packages/moltbot/ (compatibility shim)
tsdown bundles into dist/ with these entry points:
| Entry |
Output |
src/entry.ts |
dist/entry.js — CLI bootstrap |
src/index.ts |
dist/index.js — library API |
src/cli/daemon-cli.ts |
dist/daemon-cli.js — daemon mode |
src/plugin-sdk/index.ts |
dist/plugin-sdk/index.js — public plugin SDK |
src/extensionAPI.ts |
dist/extensionAPI.js — extension runtime |
src/hooks/bundled/*/handler.ts |
Bundled hook handlers |