Skip to content

Commit 25ae201

Browse files
committed
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.
1 parent 78e74d4 commit 25ae201

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,48 @@ Welcome to the lobster tank! 🦞
8585
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.
8686
5. **Questions** → Discord [#help](https://discord.com/channels/1456350064065904867/1459642797895319552) / [#users-helping-users](https://discord.com/channels/1456350064065904867/1459007081603403828)
8787

88+
## Development Environment
89+
90+
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.
115+
116+
### Getting started from source
117+
118+
```bash
119+
git clone https://github.com/<your-username>/openclaw.git
120+
cd openclaw
121+
git remote add upstream https://github.com/openclaw/openclaw.git
122+
pnpm install # install all workspace dependencies
123+
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.
129+
88130
## Before You PR
89131

90132
- Test locally with your OpenClaw instance

0 commit comments

Comments
 (0)