11---
22name : crabbox
3- description : Use Crabbox to run OpenClaw Windows node builds, tests, and targeted proof on remote native Windows or WSL2 hosts, including Azure or brokered AWS leases and static SSH hosts. Use when remote Windows validation is needed, the local host is not Windows, or the user asks for Crabbox validation. Always report the actual provider and lease id.
3+ description : Use Crabbox from macOS, Linux, or native Windows controllers to run OpenClaw Windows node builds, tests, and targeted proof on remote native Windows or WSL2 hosts, including Azure or brokered AWS leases and static SSH hosts. Use when remote Windows validation is needed or the user asks for Crabbox validation. Always report the actual provider and lease id.
44---
55
66# Crabbox
@@ -45,7 +45,7 @@ export CRABBOX_PROVIDER="${CRABBOX_PROVIDER:-azure}"
4545test -n " $CRABBOX "
4646" $CRABBOX " --version
4747" $CRABBOX " run --help 2>&1 | rg ' provider|target|windows-mode|static-host|script-stdin|timing-json'
48- " $CRABBOX " config show
48+ " $CRABBOX " config path
4949" $CRABBOX " whoami
5050git status --short --branch
5151git rev-parse HEAD
@@ -59,11 +59,96 @@ Require the CLI to list the intended provider and the `windows` target before
5959starting a lease. Use explicit provider and target flags; this repository has no
6060` .crabbox.yaml ` , so inherited user defaults are not a validation contract.
6161
62+ ### Native Windows controller
63+
64+ When the Crabbox CLI itself runs on Windows, use PowerShell and prefer a sibling
65+ development binary over a possibly stale PATH install:
66+
67+ ``` powershell
68+ $Crabbox = if (Test-Path ..\crabbox\bin\crabbox.exe) {
69+ (Resolve-Path ..\crabbox\bin\crabbox.exe).Path
70+ } else {
71+ (Get-Command crabbox.exe -ErrorAction Stop).Source
72+ }
73+ $CrabboxProvider = "azure"
74+
75+ Get-Command ssh, tar, git -ErrorAction Stop
76+ & $Crabbox --version
77+ & $Crabbox config path
78+ git status --short --branch
79+ git rev-parse HEAD
80+ ```
81+
82+ Use ` & $Crabbox ` and ` $CrabboxProvider ` in place of ` "$CRABBOX" ` and
83+ ` "$CRABBOX_PROVIDER" ` in later examples. PowerShell 5.1 or newer is sufficient
84+ for the controller commands.
85+
86+ For direct Azure, authenticate interactively and persist the approved location
87+ before warming a lease:
88+
89+ ``` powershell
90+ Get-Command az -ErrorAction Stop
91+ az login
92+ & $Crabbox azure login --location <approved-location>
93+ & $Crabbox doctor --provider azure --target windows
94+ ```
95+
96+ Do not copy ` az login ` output or Crabbox config contents into logs, PRs, or
97+ chat. ` crabbox azure login ` stores Azure identifiers in the user config reported
98+ by ` crabbox config path ` . Set location with ` azure login ` ; ` warmup ` has no
99+ ` --location ` flag.
100+
101+ Native Windows targets use local ` tar ` plus archive transfer, so a Windows
102+ controller does not need WSL or rsync for native-mode validation. POSIX and WSL2
103+ targets use rsync. When ` wsl.exe ` exists, Crabbox prefers its rsync, so verify it
104+ inside the default distribution; without WSL, verify a native rsync is on PATH:
105+
106+ ``` powershell
107+ if (Get-Command wsl.exe -ErrorAction SilentlyContinue) {
108+ wsl.exe --exec sh -lc 'command -v rsync >/dev/null'
109+ if ($LASTEXITCODE -ne 0) { throw "Install rsync in the default WSL distribution." }
110+ } else {
111+ Get-Command rsync.exe -ErrorAction Stop
112+ }
113+ ```
114+
115+ Translate later POSIX here-doc examples into a PowerShell here-string when
116+ calling ` --script-stdin ` from Windows:
117+
118+ ``` powershell
119+ $RemoteScript = @'
120+ # Copy the exact POWERSHELL body from the relevant example here.
121+ '@
122+ $PreviousOutputEncoding = $OutputEncoding
123+ try {
124+ $OutputEncoding = New-Object System.Text.UTF8Encoding -ArgumentList $false
125+ $RemoteScript | & $Crabbox run `
126+ --provider $CrabboxProvider `
127+ --target windows `
128+ --windows-mode normal `
129+ --id <lease-id> `
130+ --preflight `
131+ --timing-json `
132+ --script-stdin --
133+ $CrabboxExitCode = $LASTEXITCODE
134+ } finally {
135+ $OutputEncoding = $PreviousOutputEncoding
136+ }
137+ if ($CrabboxExitCode -ne 0) { exit $CrabboxExitCode }
138+ ```
139+
140+ If public SSH is blocked and the operator confirms an approved VPN route to the
141+ Azure virtual network is already active, opt into private addressing for that
142+ session with ` $env:CRABBOX_AZURE_NETWORK = "private" ` , then rerun
143+ ` crabbox doctor ` . Do not port or automate organization-specific VPN,
144+ certificate, vault, subscription, tenant, resource, address, or account setup
145+ in this skill.
146+
62147Azure requires its subscription auth and usually the Azure CLI. If Azure is
63148unavailable, use AWS only with an existing Crabbox broker session. If normal AWS
64149validation asks for ` AWS_ACCESS_KEY_ID ` , ` AWS_SECRET_ACCESS_KEY ` , an AWS profile,
65150or an EC2 instance role, stop: the command fell through to raw cloud auth. Check
66- ` crabbox config show ` , ` crabbox doctor ` , and ` crabbox whoami ` , then authenticate
151+ ` crabbox config path ` , ` crabbox doctor ` , and ` crabbox whoami ` , then authenticate
67152through the broker if authorized:
68153
69154``` sh
@@ -288,6 +373,11 @@ test command. Retry transport or sync once with `--debug --timing-json`; rerun
288373only the focused failing command until understood, then rerun the full required
289374validation. Do not silently move Windows proof to Linux or WSL2.
290375
376+ On a Windows controller, diagnose sync by target mode: native Windows should use
377+ archive transfer and needs local ` tar ` ; POSIX or WSL2 uses rsync and selects WSL
378+ rsync whenever ` wsl.exe ` is installed. Do not install WSL solely for a native
379+ Windows target.
380+
291381## Cleanup and report
292382
293383Stop every cloud lease created for the task unless the user explicitly asks
0 commit comments