← 返回
未分类 中文

WSL Windows Bridge

WSL ↔ Windows cross-system bridge for OpenClaw agents. Provides win-python / win-ps / win-cmd / win-copy / win-run-py / win-path to invoke Windows Python (An...
WSL↔ Windows 跨系统桥接,为 OpenClaw 代理提供 win-python / win-ps / win-cmd / win-copy / win-run-py / win-path,用于调用 Windows Python(An...)
deaconhan deaconhan 来源
未分类 clawhub v0.2.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 497
下载
💾 1
安装
1
版本
#latest

概述

WSL ↔ Windows Cross-System Bridge

> Seamless access to Windows Python, PowerShell, CMD, and filesystem from WSL2.

Features

CommandPurpose
------------------
win-pythonInvoke Windows Python (Anaconda or any)
win-psExecute PowerShell commands
win-cmdExecute CMD commands
win-copyCopy files between WSL and Windows
win-run-pyRun .py scripts with logging
win-pathConvert paths WSL /mnt/ ↔ Windows D:\

Requirements

  • WSL2 (Ubuntu 20.04+)
  • Windows 10 or Windows 11
  • Windows Python (Anaconda recommended)
  • PowerShell

First-Time Setup

cd ~/.openclaw/workspace/skillpublish/wsl-windows-bridge/scripts/
bash setup.sh

The setup script will:

  1. Auto-detect your Windows Python location (supports /mnt/d, /mnt/c, /mnt/e)
  2. Copy all wrappers to ~/.openclaw/bin/
  3. Generate ~/.openclaw/env.windows.sh with correct paths
  4. Set permissions and run verification

Manual setup (without setup.sh):

cp -r scripts/* ~/.openclaw/bin/
chmod +x ~/.openclaw/bin/win-*
# Then manually edit env.windows.sh to set correct paths

Quick Start

Basic Usage

⚠️ exec non-interactive shell note:

# Recommended for exec environment
source ~/.bashrc && source ~/.openclaw/env.windows.sh && win-python ...

# Or directly (wrappers handle .bashrc internally)
~/.openclaw/bin/win-python ...

Common Scenarios

Invoke Windows Python to run a script:

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:

win-ps "Get-Process python | Select-Object Name,Id | Format-Table"
win-ps "Get-Service | Where-Object {\$_.DisplayName -like '*QMT*'}"

File copy:

win-copy /tmp/result.csv /mnt/d/app/output/result.csv

Path conversion:

win-path /mnt/d/app
# → D:\app

win-path --to-wsl D:\app
# → /mnt/d/app

Quantitative Trading Example (QMT/xtquant)

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')
"

Environment Variables

VariableDefaultDescription
--------------------------------
WIN_ROOT/mnt/dWindows root directory
WIN_ANACONDA/mnt/d/app/anacondaAnaconda installation path
WIN_PYTHON$WIN_ANACONDA/python.exePython executable
WIN_PS.../powershell.exePowerShell path
WIN_SCRIPTS/mnt/d/app/scriptsCommon scripts directory

Troubleshooting

ErrorCauseFix
-------------------
command not found: win-pythonenv.windows.sh not sourcedsource ~/.bashrc && source ~/.openclaw/env.windows.sh
Permission deniedUAC permissionUse D:\app\ or user directory as target
Chinese garbled logsQMT log encodingIgnore; actual data is correct

File Structure

~/.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

Maintenance

  • Author: @DEACONHAN
  • Version: 0.1.0 (draft)
  • Issues: https://github.com/jarvis-agent/wsl-windows-bridge/issues

版本历史

共 1 个版本

  • v0.2.0 当前
    2026-05-03 10:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 80 📥 182,909
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 198 📥 68,165
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,062