Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器clawhub未标认证来源可访问clear审计提醒

pyautogui-skillpyautogui 技能

Agent Skill

pyautogui-skill 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

14,550

周安装

625

GitHub Stars

公开资料未说明

下载量

5,477
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pyautogui-skill(pyautogui 技能)
来源仓库:https://github.com/yangye230147961/pyautogui-skill
安装命令:
openclaw skills install pyautogui-skill
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install pyautogui-skill

简介

pyautogui-skill 通过 PyAutoGUI 实现桌面自动化,支持单击、键入与序列操作。

  • 适用于 GUI 测试、重复任务执行或人机交互模拟等场景。
  • 可结合图像识别定位按钮与菜单,但识别率受光照与像素变化影响。
  • 长时间运行可能导致 CPU 占用过高,建议加入延时与错误重试机制。
  • 该技能为通用自动化工具,不提供业务逻辑封装,需用户自定义流程。

SKILL.md

name
pyautogui
description
Desktop automation via PyAutoGUI. Use when: user needs to automate mouse/keyboard actions, GUI testing, click/type sequences, screen-based workflows, or repetitive desktop tasks. NOT for: web automation (use Playwright/Selenium), mobile automation, or image recognition at scale.
metadata
{ "openclaw": { "emoji": "🖱️", "requires": { "bins": ["python3"], "pip": ["pyautogui", "pyscreeze"] } } }

PyAutoGUI Skill

Desktop automation using PyAutoGUI for mouse, keyboard, and screen control.

When to Use

USE this skill when:

  • Automating repetitive mouse/keyboard tasks
  • GUI testing and interaction
  • Click/type sequences for desktop apps
  • Taking screenshots for automation
  • Simple image location on screen
  • Moving mouse to specific coordinates
  • Keyboard shortcuts and hotkeys
  • Form filling automation

DON'T use this skill when:

  • Web browser automation → use Playwright or Selenium
  • Mobile app automation → use Appium
  • Complex image recognition → use OpenCV/ML models
  • Accessibility automation → use platform-native APIs
  • High-speed automation → PyAutoGUI has safety delays

Safety First

PyAutoGUI includes fail-safes. NEVER disable them:

# Fail-safe: Move mouse to (0,0) to abort
pyautogui.FAILSAFE = True  # Keep this!

# Add pauses for safety
pyautogui.PAUSE = 0.5  # Seconds between actions

Quick Start

import pyautogui

# Basic movement
pyautogui.moveTo(100, 100, duration=0.5)
pyautogui.click()

# Typing
pyautogui.write('Hello world!', interval=0.1)

# Keyboard shortcuts
pyautogui.hotkey('ctrl', 'c')  # Copy
pyautogui.hotkey('ctrl', 'v')  # Paste

Core Operations

Mouse Control

import pyautogui

# Get screen size
width, height = pyautogui.size()

# Current position
x, y = pyautogui.position()

# Move mouse (duration in seconds)
pyautogui.moveTo(100, 100, duration=0.5)
pyautogui.moveRel(0, 50, duration=0.3)  # Relative move

# Clicks
pyautogui.click()           # Left click at current position
pyautogui.click(x=100, y=100)
pyautogui.rightClick()
pyautogui.doubleClick()
pyautogui.dragTo(200, 200, duration=0.5)

# Button control
pyautogui.mouseDown()
pyautogui.mouseUp()

Keyboard Control

import pyautogui

# Type text
pyautogui.write('Hello!', interval=0.1)  # interval between chars

# Special keys
pyautogui.press('enter')
pyautogui.press(['up', 'up', 'down', 'down'])

# Key hold
pyautogui.keyDown('shift')
pyautogui.write('CAPS')
pyautogui.keyUp('shift')

# Hotkeys (shortcuts)
pyautogui.hotkey('ctrl', 's')      # Save
pyautogui.hotkey('ctrl', 'shift', 'n')  # New folder (Windows)
pyautogui.hotkey('command', 'space')    # Spotlight (Mac)

Special Key Names

# Modifiers
'ctrl', 'shift', 'alt', 'command' (Mac), 'win' (Windows)

# Navigation
'enter', 'tab', 'space', 'escape', 'backspace', 'delete'
'up', 'down', 'left', 'right'
'home', 'end', 'pageup', 'pagedown'

# Function keys
'f1' through 'f12'

# Other
'capslock', 'numlock', 'scrolllock'
'printscreen', 'pause'

Screenshots

import pyautogui

# Full screenshot
screenshot = pyautogui.screenshot()
screenshot.save('screen.png')

# Region screenshot
screenshot = pyautogui.screenshot(region=(0, 0, 300, 400))

# To file directly
pyautogui.screenshot('saved.png')

Image Location

import pyautogui

# Find image on screen
location = pyautogui.locateOnScreen('button.png', confidence=0.8)

if location:
    x, y = pyautogui.center(location)
    pyautogui.click(x, y)

# Find all occurrences
locations = pyautogui.locateAllOnScreen('icon.png', confidence=0.8)

# Get center point
center = pyautogui.center(location)  # Returns (x, y)

Note: confidence requires Pillow. Range 0-1, higher = more strict matching.

Common Workflows

Form Filling

import pyautogui
import time

pyautogui.PAUSE = 0.5

# Click first field
pyautogui.click(x=100, y=200)
pyautogui.write('John Doe')

# Tab to next field
pyautogui.press('tab')
pyautogui.write('john@example.com')

# Submit
pyautogui.press('enter')

Window Management (OS-dependent)

import pyautogui

# Minimize (Windows)
pyautogui.hotkey('win', 'down')

# Maximize
pyautogui.hotkey('win', 'up')

# Switch apps (Alt+Tab)
pyautogui.hotkey('alt', 'tab')

# Close window
pyautogui.hotkey('alt', 'f4')  # Windows
pyautogui.hotkey('command', 'w')  # Mac

Screenshot + Click Pattern

import pyautogui

# Locate and click a button
button = pyautogui.locateOnScreen('submit_btn.png', confidence=0.9)
if button:
    x, y = pyautogui.center(button)
    pyautogui.click(x, y)
else:
    print("Button not found!")

Configuration

Timing & Safety

import pyautogui

# Pause between ALL actions (seconds)
pyautogui.PAUSE = 0.5

# Fail-safe (move to corner to stop)
pyautogui.FAILSAFE = True

# Timeout for locateOnScreen (seconds)
pyautogui.locateOnScreen('img.png', timeout=10)

Platform Detection

import platform

system = platform.system()

if system == "Darwin":
    # macOS shortcuts
    cmd = 'command'
elif system == "Windows":
    cmd = 'win'
else:
    cmd = 'ctrl'

Scripts

See scripts/ for reusable automation scripts:

  • scripts/click_image.py - Locate and click an image
  • scripts/type_sequence.py - Type a text sequence
  • scripts/take_screenshot.py - Capture screen region

Troubleshooting

"PyAutoGUI not working"

  1. Permissions (macOS):

- System Settings → Privacy & Security → Accessibility - Add Terminal/Python to allowed apps

  1. Permissions (Windows):

- Run as Administrator if needed

  1. Linux:
   sudo apt-get install python3-dev python3-pip
   sudo apt-get install scrot python3-tk python3-dev
   pip3 install pyautogui

Image Not Found

  • Check image path (use absolute paths)
  • Adjust confidence (try 0.7-0.9)
  • Ensure screenshot matches current screen resolution
  • Image scale may differ (retina displays)

Too Slow

# Reduce pause (but keep safe!)
pyautogui.PAUSE = 0.1

# Remove duration for instant moves
pyautogui.moveTo(100, 100)  # No duration = instant

Too Fast / Unreliable

# Increase pause
pyautogui.PAUSE = 1.0

# Add explicit waits
import time
time.sleep(2)  # Wait for UI to load

Best Practices

  1. Always test visually first - Watch the automation run
  2. Use delays - Give UI time to respond
  3. Add error handling - Check if elements exist
  4. Log actions - Debug when things go wrong
  5. Use images carefully - Resolution changes break image matching
  6. Respect the fail-safe - Never disable it

Installation

pip install pyautogui pyscreeze pillow

macOS additional:

brew install python-tk

Linux additional:

sudo apt-get install python3-dev python3-pip scrot python3-tk

Notes

  • PyAutoGUI coordinates start at top-left (0, 0)
  • Movement is relative to primary monitor
  • Multi-monitor setups use combined coordinate space
  • Some apps may require elevated permissions
  • Image matching is pixel-perfect by default (use confidence for fuzzy matching)

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

88.61%
按下载量换算4,853

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills