You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(contributing): add Development Environment section with WSL2 setup guide
Add a new 'Development Environment' section to CONTRIBUTING.md covering:
- Prerequisites: Node.js >= 22.12.0 and pnpm requirements
- Windows (WSL2): step-by-step notes for WSL2 contributors including
systemd enablement, .wslconfig resource limits, terminal behavior,
and file system performance guidance
- Getting started from source: clone/install/build quick-start commands
This information was previously undocumented, leaving Windows contributors
to discover WSL2 requirements through trial and error. The WSL2 notes are
based on hands-on experience setting up an OpenClaw development environment
on a Windows 11 ThinkPad with WSL2 Ubuntu 24.04.
AI Disclosure: This PR was developed with AI assistance (Claude). The
author has reviewed all content and confirms accuracy from direct experience.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,48 @@ Welcome to the lobster tank! 🦞
85
85
4.**Test/CI-only PRs for known `main` failures** → Don't open a PR. The Maintainer team is already tracking those failures, and PRs that only tweak tests or CI to chase them will be closed unless they are required to validate a new fix.
OpenClaw is built with **TypeScript** on **Node.js 24 LTS** and uses **pnpm** as its package manager for source development.
91
+
92
+
### Prerequisites
93
+
94
+
-**Node.js ≥ 22.12.0** (24.x LTS recommended). Install via [NodeSource](https://github.com/nodesource/distributions) or your preferred version manager.
95
+
-**pnpm** — install globally with `sudo npm install -g pnpm`. The project workspace configuration requires pnpm; npm alone is not sufficient for source builds.
96
+
97
+
### Windows (WSL2)
98
+
99
+
Windows contributors should develop inside **WSL2 with Ubuntu** rather than native Windows. The gateway daemon, systemd integration, and Unix socket paths all assume a Linux environment.
100
+
101
+
Key WSL2 setup notes:
102
+
103
+
1.**Enable systemd** — add `[boot] systemd=true` to `/etc/wsl.conf` inside your Ubuntu instance and restart WSL (`wsl --shutdown` from PowerShell). The gateway daemon service requires systemd.
104
+
2.**Resource limits** — create or edit `%UserProfile%\.wslconfig` on the Windows side to set memory and CPU limits. Without this, WSL2 claims up to 50% of host RAM, which can cause instability on machines with limited memory:
105
+
106
+
```ini
107
+
[wsl2]
108
+
memory=8GB
109
+
processors=4
110
+
swap=4GB
111
+
```
112
+
113
+
3.**Keep the terminal open** — the WSL2 instance (and any running gateway) stops when you close all terminal windows. Minimize rather than close.
114
+
4.**File system** — work inside the Linux file system (`~/openclaw`) for best performance. Accessing `/mnt/c/...` (Windows drives) from WSL2 is significantly slower.
pnpm ui:build # build the Control UI (Vite + React)
124
+
pnpm build # full TypeScript build
125
+
pnpm openclaw --version # verify: should print version and commit hash
126
+
```
127
+
128
+
For day-to-day development, use `pnpm gateway:watch` (auto-reload on changes) or `pnpm openclaw <command>` to run TypeScript source directly without a full build.
0 commit comments