Project Overview
OpenClaw is a personal AI assistant gateway that runs on your own device. It connects multiple messaging platforms (Telegram, Discord, WhatsApp, Slack, Signal, and more) to a single AI Agent, allowing you to talk to your AI assistant from any device and any platform.
Core Positioning
Unlike traditional chatbot frameworks, OpenClaw is not designed to "build a bot." Instead, its goal is to be your personal AI assistant. All channels connect to the same session system. The AI remembers context across platforms, executes tools, manages schedules, and can even control your browser.
Tech Stack
| Technology | Purpose |
|---|---|
| TypeScript (ESM) | Core language, strict mode |
| Node.js >=22 | Runtime baseline |
| pnpm | Package manager + monorepo workspace |
| Vitest | Test framework, 70% coverage threshold |
| Oxlint / Oxfmt | Linting and formatting |
| Commander.js | CLI framework |
| ws | WebSocket implementation |
| grammy / discord.js / @slack/bolt | Channel SDKs |
| Swift / Kotlin | Native apps (macOS, iOS, Android) |
Version Strategy
OpenClaw uses date-based version numbers: YYYY.M.D-patch, for example 2026.2.6-3.
Release channels:
- stable -- Tagged releases (
vYYYY.M.D), npm dist-taglatest - beta -- Pre-releases (
vYYYY.M.D-beta.N), dist-tagbeta - dev -- main branch HEAD, dist-tag
dev
Entry Points
OpenClaw has two main entry files:
src/entry.ts -- CLI Startup Entry
// src/entry.ts
process.title = "openclaw";
installProcessWarningFilter();
normalizeEnv();
// Respawn to suppress ExperimentalWarning
if (!ensureExperimentalWarningSuppressed()) {
import("./cli/run-main.js")
.then(({ runCli }) => runCli(process.argv))
.catch((error) => { /* ... */ });
}The entry file handles several critical tasks:
- Installs a Node.js experimental warning filter
- Normalizes environment variables
- If experimental warnings have not been suppressed, respawns a child process with the
--disable-warning=ExperimentalWarningflag - Parses CLI profile arguments and ultimately calls
runCli()
src/index.ts -- Program Entry + Public API
// src/index.ts
loadDotEnv({ quiet: true });
normalizeEnv();
ensureOpenClawCliOnPath();
enableConsoleCapture();
assertSupportedRuntime();
const program = buildProgram();
if (isMain) {
installUnhandledRejectionHandler();
void program.parseAsync(process.argv);
}This file serves a dual purpose: it is the buildProgram() entry point for the CLI, and it also exports the public API (config loader, session utilities, channel senders, etc.) for use by other packages and plugins.
Goals of This Tutorial
This tutorial focuses on source-level implementation -- it is not a usage guide for OpenClaw, but rather a deep dive into how the system is built:
- How does the Gateway manage WebSocket connections and sessions?
- How does the channel abstraction layer unify message formats across platforms?
- How does the Agent runtime handle tool calls and streaming output?
- How does the plugin system achieve hot-loading and lifecycle management?
- How does the CLI organize commands and dependency injection?
Summary
- OpenClaw is a personal AI assistant gateway that unifies multi-channel messaging
- Built with TypeScript + Node.js in a monorepo architecture
- Core components: Gateway, Channels, Agent, Plugins, CLI
- This tutorial covers source-level implementation details, not usage instructions
Next: Architecture