pywinauto

pywinauto is a skill for Claude Code, Codex from malue-ai/dazee-small. It costs 39 tokens per session (1,547 once invoked), scanned A, original, MIT.

A Windows desktop-automation tool that lets an agent inspect application windows and controls, click buttons, enter text, and read screen content programmatically.

In plain words
What is it for?
Use it to fill forms, automate repetitive work in internal or legacy applications, and extract text from their interfaces.
Why use it?
It can operate desktop software that has no usable API or integration.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to fill forms, automate repetitive work in internal or legacy applications, and extract text from their interfaces.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/malue-ai/dazee-small/pywinauto
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add malue-ai/dazee-small --skill pywinauto
Clone the repo
git clone --depth 1 https://github.com/malue-ai/dazee-small

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pywinauto

README.md
[![agentmods](https://agentmods.dev/badge/skills/malue-ai/dazee-small/pywinauto/github.svg)](https://agentmods.dev/skills/malue-ai/dazee-small/pywinauto)
Your own site
<a href="https://agentmods.dev/skills/malue-ai/dazee-small/pywinauto"><img src="https://agentmods.dev/badge/skills/malue-ai/dazee-small/pywinauto/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pywinauto

Your own site · 80×15
<a href="https://agentmods.dev/skills/malue-ai/dazee-small/pywinauto"><img src="https://agentmods.dev/badge/skills/malue-ai/dazee-small/pywinauto.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,547 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 24 Feb 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.01547
Opus 5 $0.00019 $0.00773
Sonnet 5 $0.00008 $0.00309
Haiku 4.5 $0.00004 $0.00155

Measured 9d ago against content hash a69cbe75300f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

pywinauto scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

instances/xiaodazi/skills/pywinauto/SKILL.md · 222 lines

How it starts

The opening of the file, as written. The whole thing — 222 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Windows UI 自动化(pywinauto)

通过 pywinauto 操作任意 Windows 桌面应用:发现窗口、检查控件、点击按钮、输入文字、读取内容。 支持两种后端:Win32 API(传统应用)和 MS UI Automation(现代应用)。

使用场景

  • 用户说「帮我在 XX 应用里点一下那个按钮」「自动填一下这个表单」
  • 需要操作没有 API 的桌面应用(如 ERP 系统、内部管理系统)
  • 需要批量操作 GUI 应用(如自动录入数据)
  • 需要读取其他应用界面上的文字内容

后端选择

后端 参数 适用应用
Win32 API backend="win32" MFC、VB6、VCL、简单 WinForms
MS UI Automation backend="uia" WinForms、WPF、UWP Store 应用、Qt5、浏览器

不确定用哪个时,优先尝试 uia;如果找不到控件,切换为 win32

命令参考

连接到已有应用

from pywinauto import Application

# 方式 1:通过窗口标题连接
app = Application(backend="uia").connect(title="记事本", timeout=10)

# 方式 2:通过进程名连接
app = Application(backend="uia").connect(path="notepad.exe")

# 方式 3:通过进程 ID 连接
app = Application(backend="uia").connect(process=12345)

启动新应用

from pywinauto import Application

app = Application(backend="uia").start("notepad.exe")
# 等待窗口出现
app.window(title_re=".*记事本.*").wait("ready", timeout=10)

发现窗口和控件

# 列出所有顶层窗口
from pywinauto import Desktop
windows = Desktop(backend="uia").windows()
for w in windows:
    print(f"{w.window_text()} — {w.class_name()}")

# 打印窗口控件树(调试用)
dlg = app.window(title_re=".*记事本.*")
dlg.print_control_identifiers()

点击按钮和菜单

dlg = app.window(title="记事本")

# 点击菜单
dlg.menu_select("文件->打开")

# 点击按钮(通过文本匹配)
dlg.child_window(title="确定", control_type="Button").click()

# 点击按钮(通过 auto_id)
dlg.child_window(auto_id="btnSubmit").click()

输入文字

dlg = app.window(title="记事本")

# 输入到编辑框
edit = dlg.child_window(control_type="Edit")
edit.set_text("要输入的内容")

# 模拟键盘输入(支持特殊键)
edit.type_keys("Hello{ENTER}World", with_spaces=True)

# 特殊键:{ENTER} {TAB} {ESC} {DELETE} {BACKSPACE}
# 修饰键:^ = Ctrl, % = Alt, + = Shift
# 例:Ctrl+A = ^a, Ctrl+Shift+S = ^+s

读取界面内容

dlg = app.window(title="记事本")

# 读取文本框内容
content = dlg.child_window(control_type="Edit").window_text()

# 读取列表项
listbox = dlg.child_window(control_type="List")
items = [item.window_text() for item in listbox.children()]

# 读取表格
table = dlg.child_window(control_type="Table")
for row in table.children():
    cells = [c.window_text() for c in row.children()]
    print(" | ".join(cells))

Read the full file on GitHub · 222 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 222 lines · 39 tokens per session scan A a69cbe75300f

Subscribe to this mod's changes

pywinauto is a skill published in the GitHub repository malue-ai/dazee-small (36 stars, last pushed 5mo ago), licensed MIT. It adds 39 tokens to every session and 1,547 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories