screen-capture

screen-capture

使用系统原生方法进行屏幕捕获和内容分析,支持 macOS screencapture 命令和 Python 截图库

7звезд
2форков
Обновлено 1/23/2026
SKILL.md
readonlyread-only
name
screen-capture
description

使用系统原生方法进行屏幕捕获和内容分析,支持 macOS screencapture 命令和 Python 截图库

version
1.0.0

屏幕捕获与分析专家

触发条件

当用户提到以下内容时自动触发:

  • "截图"
  • "屏幕内容"
  • "获取屏幕"
  • "分析屏幕"
  • "屏幕文本"
  • "OCR识别"

核心能力

屏幕捕获 (macOS)

  • screencapture 命令: 使用 macOS 原生 screencapture 工具
  • 全屏截图: screencapture -S screen.png
  • 区域截图: screencapture -i screen.png (交互式选择)
  • 窗口截图: screencapture -w window.png

屏幕捕获 (Python)

  • pyautogui: 跨平台截图库
  • mss: 高性能截图库
  • pyscreenshot: 简单易用的截图工具

文本提取

  • OCR 识别: 使用 pytesseract 进行文字识别
  • 系统辅助: 读取系统可访问性 API

图像分析

  • OpenCV: 图像处理和分析
  • PIL: 图像分析和处理

常用场景

场景1:截取全屏

请截取整个屏幕并保存到文件。

执行步骤:

  1. 使用 screencapture -S screen.png 捕获全屏
  2. 返回截图文件路径

场景2:截取区域

请让我选择区域进行截图。

执行步骤:

  1. 使用 screencapture -i -s screen.png 交互式选择区域
  2. 返回截图文件路径

场景3:识别屏幕文字

请识别屏幕上的文字内容。

执行步骤:

  1. 截取屏幕
  2. 使用 pytesseract 进行 OCR 识别
  3. 返回识别出的文字

场景4:保存屏幕截图

把当前屏幕保存为 screenshot.png。

执行步骤:

screencapture -S /Users/liubinbin/screenshot.png

MCP 工具映射

功能 工具
屏幕截图 screencapture 命令
OCR 识别 pytesseract
图像处理 PIL / OpenCV
Python 执行 python3 脚本

注意事项

  1. macOS 权限: 首次使用需要在系统偏好设置中授权屏幕录制权限
  2. Tesseract OCR: 需要安装 brew install tesseract
  3. Python 依赖: pip3 install pyautogui pytesseract pillow opencv-python

安装依赖

# macOS 屏幕录制权限工具
brew install tesseract

# Python 依赖
pip3 install pyautogui pytesseract pillow opencv-python

You Might Also Like

Related Skills

coding-agent

coding-agent

179Kdev-codegen

Run Codex CLI, Claude Code, OpenCode, or Pi Coding Agent via background process for programmatic control.

add-uint-support

add-uint-support

97Kdev-codegen

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

at-dispatch-v2

at-dispatch-v2

97Kdev-codegen

Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.

skill-writer

skill-writer

97Kdev-codegen

Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.

Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.

Creates JavaScript classes using Bun's Zig bindings generator (.classes.ts). Use when implementing new JS APIs in Zig with JSC integration.