WSL↔ Windows 跨系统桥接,为 OpenClaw 代理提供 win-python / win-ps / win-cmd / win-copy / win-run-py / win-path,用于调用 Windows Python(An...)
Seamless access to Windows Python, PowerShell, CMD, and filesystem from WSL2.
CommandPurposewin-pythonInvoke Windows Python (Anaconda or any)win-psExecute PowerShell commandswin-cmdExecute CMD commandswin-copyCopy files between WSL and Windowswin-run-pyRun .py scripts with loggingwin-pathConvert paths WSL /mnt/* ↔ Windows D:\*
bash
cd ~/.openclaw/workspace/skillpublish/wsl-windows-bridge/scripts/
bash setup.sh
The setup script will:
/mnt/d, /mnt/c, /mnt/e)~/.openclaw/bin/~/.openclaw/env.windows.sh with correct pathsManual setup (without setup.sh):
bash
cp -r scripts/* ~/.openclaw/bin/
chmod +x ~/.openclaw/bin/win-*
# Then manually edit env.windows.sh to set correct paths
⚠️ exec non-interactive shell note:
bash
# Recommended for exec environment
source ~/.bashrc && source ~/.openclaw/env.windows.sh && win-python ...
# Or directly (wrappers handle .bashrc internally)
~/.openclaw/bin/win-python ...
Invoke Windows Python to run a script:
bash
source ~/.bashrc && source ~/.openclaw/env.windows.sh
# Single-line command
win-python -c "import xtquant; print(xtquant.__version__)"
# Run a script file
win-python "$WIN_SCRIPTS/my_task.py" --arg value
Execute PowerShell:
bash
win-ps "Get-Process python | Select-Object Name,Id | Format-Table"
win-ps "Get-Service | Where-Object {\$_.DisplayName -like '*QMT*'}"
File copy:
bash
win-copy /tmp/result.csv /mnt/d/app/output/result.csv
Path conversion:
bash
win-path /mnt/d/app
# → D:\app
win-path --to-wsl D:\app
# → /mnt/d/app
bash
source ~/.bashrc && source ~/.openclaw/env.windows.sh
# Get HS300 constituent stocks
win-python -c "
from xtquant import xtdata
stocks = xtdata.get_stock_list_in_sector('沪深300')
print(f'HS300: {len(stocks)} stocks')
print(stocks[:5])
"
# Download historical data
win-python -c "
from xtquant import xtdata
xtdata.download_history_data('600000.SH', start_time='20260101', end_time='20260405')
print('Download complete')
"
VariableDefaultDescriptionWIN_ROOT``/mnt/dWindows root directoryWIN_ANACONDA``/mnt/d/app/anacondaAnaconda installation pathWIN_PYTHON``$WIN_ANACONDA/python.exePython executableWIN_PS``.../powershell.exePowerShell pathWIN_SCRIPTS``/mnt/d/app/scriptsCommon scripts directory
ErrorCauseFixcommand not found: win-pythonenv.windows.sh not sourcedsource ~/.bashrc && source ~/.openclaw/env.windows.sh``Permission deniedUAC permissionUse D:\app\ or user directory as targetChinese garbled logsQMT log encodingIgnore; actual data is correct
text
~/.openclaw/workspace/skillpublish/wsl-windows-bridge/
├── SKILL.md
├── _meta.json
├── README.md
└── scripts/
├── setup.sh ← Auto-install (auto-detects Python path)
├── env.windows.sh ← Template (setup.sh generates actual config)
├── win-python
├── win-ps
├── win-cmd
├── win-copy
├── win-run-py
└── win-path