技能标识:pc-control
Remote Windows desktop control from WSL/Linux via screenshot + mouse/keyboard simulation. Use when: user asks to control their PC, click something, open an app, interact with a GUI program, take a screenshot, or perform any desktop automation that has no CLI alternative. NOT for: tasks with command-line alternatives (prefer CLI/PowerShell), reading files, or running scripts.
通过截图(mss)和鼠标/键盘模拟(pyautogui),从WSL/Linux控制Windows桌面。在Windows上运行FastAPI服务器,Python客户端从WSL调用该服务器。
编辑技能目录中的 config.json。将 python_path 设置为带有pip的Windows Python路径:
json
{
server: {
host: 127.0.0.1,
port: 18888,
python_path: C:\\Python312\\python.exe
},
powershell: /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe,
autoshutdownminutes: 10,
screenshot: {
default_scale: 0.5,
default_quality: 50
}
}
bash
python3 scripts/install.py
将 fastapi uvicorn mss pyautogui pillow 安装到Windows Python环境中。
bash
python3 scripts/launcher.py start
python
import sys; sys.path.insert(0, skills/pc-control/scripts)
from client import PCControl
pc = PCControl()
img_path = pc.screenshot(scale=0.5, quality=50)
重要提示: 截图已缩放。点击时,将目标坐标除以缩放比例即可获得实际屏幕坐标。例如,如果scale=0.5且图像中目标位于(400, 300),则实际点击位置为(800, 600)。
python
pc.click(x, y) # 左键单击
pc.double_click(x, y) # 双击
pc.right_click(x, y) # 右键单击
pc.move(x, y) # 移动光标
pc.scroll(x, y, clicks) # 滚动(负数=向下)
pc.drag(x1, y1, x2, y2) # 拖拽
pc.type_text(hello) # 输入文本
pc.press(enter) # 按键
pc.hotkey(ctrl, c) # 组合键
每次操作后务必截图确认操作成功,再继续下一步。
bash
python3 scripts/launcher.py stop
截图 → 分析 → 决定操作 → 执行 → 截图验证 → 继续或完成
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 pc-control-1776296559 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 pc-control-1776296559 技能
skillhub install pc-control-1776296559
文件大小: 7.18 KB | 发布时间: 2026-4-16 17:29