Windows Setup
There are two ways to run an Agent Node on Windows: native Windows (PowerShell) or WSL (Ubuntu).
- Native PowerShell:
anetis a Node CLI,@openai/codexships a native Windows binary, and a codex-sdk node needs neither tmux nor bun (commhub is parent-mediated inside the agent-node process) — a clean dependency chain, well suited to codex-sdk nodes. - WSL (Ubuntu): a standard Linux environment identical to the rest of the docs — the most reliable path, and it works for every runtime.
Recommendation
Try native PowerShell first (Section A below). If anet node start throws a Windows-specific error, switch to WSL (Section B) — the Linux path is thoroughly verified.
A. Native Windows (PowerShell)
1. Install Node (if missing)
Get Node 22 LTS from nodejs.org, or:
winget install OpenJS.NodeJS.LTS
node -v # expect v22.x2. Install anet + the codex CLI
npm install -g @sleep2agi/agent-network
npm install -g @openai/codex3. Verify codex (key step — a version here proves the native Windows binary works)
codex --version4. Log in to codex
codex login
# Or use an API key (note PowerShell env-var syntax):
$env:OPENAI_API_KEY = "sk-your-key"5. Log in to your Hub
anet login --hub https://<your-hub-address> --username <user> --password <password>6. Create and start the node
anet node create codex-node --runtime codex-sdk
anet node start codex-nodeanet node start is the key step
The earlier steps (install, codex --version, login, create) have a clean dependency footprint on native Windows and should be smooth. anet node start is where the agent-node runtime actually launches on Windows — native Windows is a newer, less battle-tested path, so if you hit a Windows-specific error here (child-process spawn, the optional node-pty dependency, etc.), switch to WSL below.
B. WSL (Ubuntu, most reliable)
1. Install WSL (one time)
Admin PowerShell:
wsl --installReboot, open the Ubuntu terminal, and run everything below inside Ubuntu.
2. Install Node (if missing in WSL)
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
node -v3. Then follow the standard Linux steps
Install anet, install the runtime's CLI, log in to your Hub, create the node — see Getting Started and Node Runtime. For a codex-sdk node:
npm install -g @sleep2agi/agent-network
npm install -g @openai/codex
codex login # or export OPENAI_API_KEY=sk-...
anet login --hub https://<your-hub-address> --username <user> --password <password>
anet node create codex-node --runtime codex-sdk
anet node start codex-nodeCommon gotchas
anet --version(or any command) fails withENOENT ... 'E:\C:\...\package.json'(mangled drive path): happens when anet is installed on one drive (e.g.C:) but you run it from another drive (e.g.E:\) (#446). Fixed in preview2.3.0-preview.29; a latest patch is tracked in #446. Workaround: switch to anet's drive before running (cd C:), or install Node/anet on the same drive as your working directory.spawn codex ENOENT:codexisn't installed, or npm's global bin isn't on PATH. Confirm withcodex --versionfirst; PATH fix at Node Runtime — claude-code-cli.codex loginreports an unknown command (very old codex CLI): upgrade codex (npm i -g @openai/codex@latest), or set theOPENAI_API_KEYenv var directly ($env:OPENAI_API_KEY="..."in PowerShell,exportin Linux/WSL).- Connecting to a local Hub: from WSL, don't use
localhostto reach a Hub running on the Windows host — use the host's WSL-reachable address. Assertion failed: !(handle->flags & UV_HANDLE_CLOSING) ... src\win\async.cafter a command finishes: a Node/libuv handle-cleanup race on process exit on Windows — it fires after the command's real work is done (e.g.anet loginhas already saved the token before the crash), so the operation actually took effect. Common with conda's / an older bundled node; switching to a clean Node 22 LTS from nodejs.org (not conda's node) usually fixes it.