diff --git a/web/content/docs/1-getting-started.md b/web/content/docs/1-getting-started.md index 5975e7a9..083e4da6 100644 --- a/web/content/docs/1-getting-started.md +++ b/web/content/docs/1-getting-started.md @@ -24,6 +24,10 @@ Before you begin, make sure you have: - **`lsof` on Linux** for reliable agent session detection (strongly recommended; see [Agent Management](/docs/8-agent-management#linux-session-detection)) - At least one [supported AI coding agent or environment](/docs/2-supported-agents) +### Windows + +Managed agents (`agent start`), `devkitd`, and the experimental `agent console` target macOS and Linux, not native Windows. A global install from PowerShell with Node for Windows does not ship `devkitd` and does not support tmux-managed sessions. For the full control plane on a PC, use [Windows via WSL2](/docs/21-windows-wsl). + ### Node.js and native modules The CLI bundles native SQLite support (`better-sqlite3`) compiled for the **Node version used when you installed** `ai-devkit`. If agents run under a different Node (common when tmux inherits another `PATH`), memory and related commands can fail with a `NODE_MODULE_VERSION` error. @@ -179,14 +183,15 @@ The installed workflow skills guide requirements, design, planning, implementati ## Next Steps -1. [Check environment-specific project support](/docs/2-supported-agents) -2. [Learn how project init and install work](/docs/9-agent-setup) -3. [Operate running agents](/docs/13-agent-console) -4. [Multi-agent orchestration](/docs/17-multi-agent-orchestration) (lead plus workers) -5. [Give agents long-term memory](/docs/6-memory) -6. [Manage skills](/docs/7-skills) -7. [Install plugins](/docs/14-plugins) -8. [Troubleshooting agents](/docs/18-troubleshooting-agents) +1. On Windows, read [Windows via WSL2](/docs/21-windows-wsl) before installing agents only in PowerShell +2. [Check environment-specific project support](/docs/2-supported-agents) +3. [Learn how project init and install work](/docs/9-agent-setup) +4. [Operate running agents](/docs/13-agent-console) +5. [Multi-agent orchestration](/docs/17-multi-agent-orchestration) (lead plus workers) +6. [Give agents long-term memory](/docs/6-memory) +7. [Manage skills](/docs/7-skills) +8. [Install plugins](/docs/14-plugins) +9. [Troubleshooting agents](/docs/18-troubleshooting-agents) ## Need Help? diff --git a/web/content/docs/21-windows-wsl.md b/web/content/docs/21-windows-wsl.md new file mode 100644 index 00000000..c50334b5 --- /dev/null +++ b/web/content/docs/21-windows-wsl.md @@ -0,0 +1,217 @@ +--- +title: Windows via WSL2 +description: Run AI DevKit on Windows using WSL2. Node, tmux, agent CLIs, devkitd, and Linux-native paths. +slug: windows-wsl +section: start +order: 5 +--- + +If you want the full control plane on a Windows PC, use WSL2. AI DevKit expects macOS or Linux for managed `agent start`, tmux, session detection, `devkitd`, and the experimental `agent console`. On native Windows (Node reporting `win32`), tmux-managed sessions are unsupported, and published installs ship no `devkitd` binary for Windows: only the `@ai-devkit/devkitd-linux-*` and `@ai-devkit/devkitd-darwin-*` optional packages. + +Install a Linux distro in WSL2, run Node and AI DevKit there, and keep repos on the Linux filesystem (`~/…`), not under `/mnt/c`. + +## How the pieces fit + +| Layer | Where it runs | What lives there | +|-------|----------------|------------------| +| Windows | Host | Windows Terminal, your editor (optional), GPU drivers | +| WSL2 Linux | Ubuntu (or another distro) | Node, `ai-devkit`, tmux, `devkitd`, coding-agent CLIs | +| Project files | `~/src/…` inside WSL | Git repos, `.ai-devkit.json`, `docs/ai/` | + +Don't install `npm install -g ai-devkit` only in PowerShell if you want tmux-managed agents or daemon-backed agent commands. Install the CLI and your coding agents inside WSL and run `ai-devkit` from a WSL shell. + +## 1. Install WSL2 and a distro + +On Windows 11 (or Windows 10 with current updates), open PowerShell as Administrator and run: + +```powershell +wsl --install +``` + +Reboot if prompted. That usually installs WSL2 and Ubuntu as the default distribution. + +To list or install another distro: + +```powershell +wsl --list --online +wsl --install -d Ubuntu +``` + +Open the distro from the Start menu or: + +```powershell +wsl +``` + +The bash examples below assume you're inside WSL unless noted. + +## 2. Install Node.js 22+ (nvm) + +AI DevKit requires Node.js 22.0.0 or newer (see the published `engines` field). nvm helps you keep one Node version for global npm installs and the shells tmux starts. + +```bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash +# Restart the shell or: source ~/.bashrc (or ~/.zshrc) + +nvm install 22 +nvm use 22 +node -v # should be v22.x or newer +``` + +If `npm install -g ai-devkit` fails on native modules, install build tools: + +```bash +sudo apt-get update +sudo apt-get install -y build-essential python3 +``` + +## 3. Install AI DevKit globally + +```bash +npm install -g ai-devkit +ai-devkit setup +``` + +`npm install -g ai-devkit` installs the CLI only. It does not run `setup`. To limit which agents are configured: + +```bash +ai-devkit setup --agent claude,codex,cursor +``` + +Supported `--agent` values (from `ai-devkit setup --help`): `codex`, `pi`, `claude`, `gemini`, `cursor`, `opencode`, `grok`, `antigravity-cli`, `kiro`, `copilot`, `devin`, `muse`. + +For project bootstrap: + +```bash +cd ~/src/your-project +ai-devkit init +``` + +An npx-only workflow works the same as on macOS/Linux; prefix every command with `npx ai-devkit@latest` (see [Getting Started](/docs/1-getting-started)). + +## 4. Install tmux (required for managed agents) + +Managed `agent start` uses tmux on Linux. Install it inside WSL: + +```bash +sudo apt-get update +sudo apt-get install -y tmux +tmux -V +``` + +On WSL, `ai-devkit setup` and runtime errors tell you to install tmux inside your WSL distribution (the CLI detects WSL from the kernel release string). + +Setup reports tmux versions below 2.6+ but does not block on them. + +## 5. Install coding-agent CLIs inside WSL + +`ai-devkit setup` detects agents from Linux home directories under WSL (for example `~/.claude`, `~/.codex`, `~/.cursor`). A CLI you install only on Windows (for example `npm i -g` in PowerShell) is not on WSL's `PATH` and will not be detected. + +For each agent you use: + +1. Install the vendor CLI inside WSL (npm, vendor installer, or package manager; follow that tool's docs). +2. Launch and sign in once in WSL so the config directory exists. +3. Re-run `ai-devkit setup` (or `ai-devkit setup --agent `). + +Install the [supported agents](/docs/2-supported-agents) you actually run in WSL. You don't need every agent on one machine. + +## 6. Where skills and config live + +These paths are inside the WSL Linux home (`echo $HOME`, typically `/home/`), not `C:\Users\…`. + +| Item | Location | +|------|-----------| +| Global AI DevKit config | `~/.ai-devkit/.ai-devkit.json` | +| Daemon socket, DB, log | `~/.ai-devkit/daemon.sock`, `daemon.db`, `daemon.log` | +| Global built-in skills (per agent) | Agent-specific global skill dirs (for example `~/.claude/skills`, `~/.cursor/skills`). See [Supported Agents](/docs/2-supported-agents). | +| Project config | `/.ai-devkit.json` | +| Project workflow docs | `/docs/ai/` by default | + +Windows and WSL have separate home directories. `setup` in PowerShell writes Windows paths; `setup` in WSL writes Linux paths. Pick one environment for day-to-day work (WSL). + +## 7. Clone and work on repos in the Linux filesystem + +```bash +mkdir -p ~/src +cd ~/src +git clone git@github.com:you/your-repo.git +``` + +Avoid primary development under `/mnt/c/Users/...` when you can: + +- File watching is slower or unreliable on DrvFs mounts. +- Git and Node are usually slower on cross-mounted Windows paths. +- Line endings and permissions surprises are more common on `/mnt/c`. + +If you need a Windows app on the repo, clone in WSL and open `\\wsl$\Ubuntu\home\\src\...` rather than keeping the canonical tree on `C:`. + +### Linux session detection in WSL + +On Linux (including WSL), install `lsof` for reliable `agent list`, `agent send --wait`, and session correlation: + +```bash +sudo apt-get install -y lsof +``` + +See [Agent Management (Linux session detection)](/docs/8-agent-management#linux-session-detection). + +## 8. Verify the setup + +```bash +ai-devkit status +ai-devkit agent list +``` + +Optional: start a managed worker and open the console (experimental on Linux): + +```bash +ai-devkit agent start --type codex +ai-devkit agent console +``` + +`agent console` requires a TTY (`ai-devkit agent console --help`). + +### devkitd in WSL + +In WSL, `devkitd` behaves like on native Linux. Agent commands auto-spawn it when needed, using the bundled `@ai-devkit/devkitd-linux-*` binary when present. + +```bash +ai-devkit daemon status +ai-devkit daemon logs -n 50 +``` + +`ai-devkit daemon install` writes a systemd `--user` unit (Linux only) so the daemon can survive reboot. Whether that works in WSL2 depends on your distro's systemd setup. If user systemd is off, rely on auto-spawn or run `ai-devkit daemon start` when you need it. See [Runtime (devkitd)](/docs/16-runtime). + +Set `DEVKITD_BIN` to override the binary path, or `AI_DEVKIT_NO_DAEMON=1` to skip auto-spawn. Durable agents still need a running daemon. + +## Native Windows (without WSL): known limits + +This table reflects the current CLI and published artifacts in this repository. + +| Capability | Native Windows (`win32`) | WSL2 (Linux) | +|------------|---------------------------|--------------| +| `init`, `install`, `setup`, `skill`, `memory`, `lint`, `status` | Generally usable with Node for Windows | Supported | +| Managed `agent start` (tmux) | Unsupported. CLI points you to WSL + tmux | Supported with tmux | +| `agent console` | Not supported (documented; use macOS/Linux/WSL) | Experimental, like other Linux | +| `devkitd` auto-spawn | No published Windows binary. Falls back when the binary is missing; some daemon-first paths degrade | Supported via `devkitd-linux-*` | +| `daemon install` (systemd) | N/A (Linux only) | Available when user systemd is configured | +| tmux install hint from CLI | "Native Windows managed interactive sessions are unsupported. Use a supported WSL distribution and install tmux inside it." | Normal Linux / WSL messaging | + +You can install `ai-devkit` on Windows for project `init` or CI-style `init`/`install`. The agent control plane (tmux workers, console, durable agents via `devkitd`) is meant for macOS, Linux, or WSL2. + +## Node version and tmux + +The CLI bundles native SQLite (`better-sqlite3`) for the Node version used at `npm install -g`. If tmux sessions pick up a different Node on `PATH`, memory commands can fail with `NODE_MODULE_VERSION` errors. + +- Reinstall `ai-devkit` with the same Node your agents use, or +- Align tmux: `tmux set-environment -g PATH '/path/to/node/bin:…'` + +See [Getting Started (Node.js and native modules)](/docs/1-getting-started#nodejs-and-native-modules). + +## Next steps + +1. [Getting Started](/docs/1-getting-started): full machine and project flow +2. [Agent Setup](/docs/9-agent-setup): `init`, `install`, templates +3. [Agent Management](/docs/8-agent-management): `agent list`, `send`, `start` +4. [Runtime (devkitd)](/docs/16-runtime): daemon commands and troubleshooting +5. [Troubleshooting agents](/docs/18-troubleshooting-agents) \ No newline at end of file