screenshot by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill screenshot每次遵循以下保存位置规则:
在 macOS 上,进行窗口/应用捕获前,请先运行一次预检助手。它会检查屏幕录制权限,解释为何需要此权限,并在一处请求该权限。
助手将 Swift 的模块缓存路由到 $TMPDIR/codex-swift-module-cache,以避免额外的沙盒模块缓存提示。
bash <path-to-skill>/scripts/ensure_macos_permissions.sh
为避免多个沙盒批准提示,请尽可能在一个命令中组合预检和捕获:
bash <path-to-skill>/scripts/ensure_macos_permissions.sh && \
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex"
对于 Codex 检查运行,请将输出保存在临时目录:
bash <path-to-skill>/scripts/ensure_macos_permissions.sh && \
python3 <path-to-skill>/scripts/take_screenshot.py --app "<App>" --mode temp
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用捆绑的脚本,以避免重新推导特定于操作系统的命令。
从仓库根目录运行助手:
python3 <path-to-skill>/scripts/take_screenshot.py
常见模式:
默认位置(用户要求"一张截图"):
python3 <path-to-skill>/scripts/take_screenshot.py
临时位置(Codex 视觉检查):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp
显式位置(用户提供了路径或文件名):
python3 <path-to-skill>/scripts/take_screenshot.py --path output/screen.png
按应用名称捕获应用/窗口(仅限 macOS;支持子字符串匹配;捕获所有匹配的窗口):
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex"
应用内的特定窗口标题(仅限 macOS):
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex" --window-name "Settings"
捕获前列出匹配的窗口 ID(仅限 macOS):
python3 <path-to-skill>/scripts/take_screenshot.py --list-windows --app "Codex"
像素区域 (x,y,w,h):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp --region 100,200,800,600
聚焦/活动窗口(仅捕获最前端的窗口;使用 --app 捕获所有窗口):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp --active-window
特定窗口 ID(在 macOS 上使用 --list-windows 来发现 ID):
python3 <path-to-skill>/scripts/take_screenshot.py --window-id 12345
脚本为每次捕获打印一个路径。当匹配多个窗口或显示器时,它会打印多个路径(每行一个),并添加后缀如 -w<windowId> 或 -d<display>。请使用图像查看器工具按顺序查看每个路径,仅在需要或被请求时才操作图像。
"看一下并告诉我你看到了什么":捕获到临时目录,然后按顺序查看每个打印的路径。
bash <path-to-skill>/scripts/ensure_macos_permissions.sh &&
python3 <path-to-skill>/scripts/take_screenshot.py --app "<App>" --mode temp
"Figma 中的设计与实现不匹配":首先使用 Figma MCP/技能捕获设计,然后使用此技能捕获正在运行的应用(通常到临时目录),并在进行任何操作之前比较原始截图。
--region 来隔离单个显示器。助手自动选择第一个可用的工具:
scrotgnome-screenshotimport如果都不可用,请要求用户安装其中之一并重试。
坐标区域需要 scrot 或 ImageMagick import。
--app、--window-name 和 --list-windows 仅限 macOS。在 Linux 上,请使用 --active-window 或在可用时提供 --window-id。
运行 PowerShell 助手:
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1
常见模式:
默认位置:
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1
临时位置(Codex 视觉检查):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Mode temp
显式路径:
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Path "C:\Temp\screen.png"
像素区域 (x,y,w,h):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Mode temp -Region 100,200,800,600
活动窗口(请用户先将其聚焦):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Mode temp -ActiveWindow
特定窗口句柄(仅在提供时):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -WindowHandle 123456
当无法运行助手时,请使用这些命令。
全屏到特定路径:
screencapture -x output/screen.png
像素区域:
screencapture -x -R100,200,800,600 output/region.png
特定窗口 ID:
screencapture -x -l12345 output/window.png
交互式选择或窗口拾取:
screencapture -x -i output/interactive.png
全屏:
scrot output/screen.png
gnome-screenshot -f output/screen.png
import -window root output/screen.png
像素区域:
scrot -a 100,200,800,600 output/region.png
import -window root -crop 800x600+100+200 output/region.png
活动窗口:
scrot -u output/window.png
gnome-screenshot -w -f output/window.png
bash <path-to-skill>/scripts/ensure_macos_permissions.sh 以在一处请求屏幕录制权限。ModuleCache 权限错误,请使用提升的权限重新运行命令。--list-windows --app "AppName" 并使用 --window-id 重试,并确保应用在屏幕上可见。command -v scrot、command -v gnome-screenshot 和 command -v import 检查工具可用性。每周安装数
56
仓库
GitHub 星标数
22.6K
首次出现
2026年2月8日
安全审计
安装于
gemini-cli56
github-copilot56
codex56
opencode56
amp55
kimi-cli55
Follow these save-location rules every time:
On macOS, run the preflight helper once before window/app capture. It checks Screen Recording permission, explains why it is needed, and requests it in one place.
The helpers route Swift's module cache to $TMPDIR/codex-swift-module-cache to avoid extra sandbox module-cache prompts.
bash <path-to-skill>/scripts/ensure_macos_permissions.sh
To avoid multiple sandbox approval prompts, combine preflight + capture in one command when possible:
bash <path-to-skill>/scripts/ensure_macos_permissions.sh && \
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex"
For Codex inspection runs, keep the output in temp:
bash <path-to-skill>/scripts/ensure_macos_permissions.sh && \
python3 <path-to-skill>/scripts/take_screenshot.py --app "<App>" --mode temp
Use the bundled scripts to avoid re-deriving OS-specific commands.
Run the helper from the repo root:
python3 <path-to-skill>/scripts/take_screenshot.py
Common patterns:
Default location (user asked for "a screenshot"):
python3 <path-to-skill>/scripts/take_screenshot.py
Temp location (Codex visual check):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp
Explicit location (user provided a path or filename):
python3 <path-to-skill>/scripts/take_screenshot.py --path output/screen.png
App/window capture by app name (macOS only; substring match is OK; captures all matching windows):
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex"
Specific window title within an app (macOS only):
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex" --window-name "Settings"
List matching window ids before capturing (macOS only):
python3 <path-to-skill>/scripts/take_screenshot.py --list-windows --app "Codex"
Pixel region (x,y,w,h):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp --region 100,200,800,600
Focused/active window (captures only the frontmost window; use --app to capture all windows):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp --active-window
Specific window id (use --list-windows on macOS to discover ids):
python3 <path-to-skill>/scripts/take_screenshot.py --window-id 12345
The script prints one path per capture. When multiple windows or displays match, it prints multiple paths (one per line) and adds suffixes like -w<windowId> or -d<display>. View each path sequentially with the image viewer tool, and only manipulate images if needed or requested.
"Take a look at and tell me what you see": capture to temp, then view each printed path in order.
bash <path-to-skill>/scripts/ensure_macos_permissions.sh &&
python3 <path-to-skill>/scripts/take_screenshot.py --app "<App>" --mode temp
"The design from Figma is not matching what is implemented": use a Figma MCP/skill to capture the design first, then capture the running app with this skill (typically to temp) and compare the raw screenshots before any manipulation.
--region to isolate a single display when needed.The helper automatically selects the first available tool:
scrotgnome-screenshotimportIf none are available, ask the user to install one of them and retry.
Coordinate regions require scrot or ImageMagick import.
--app, --window-name, and --list-windows are macOS-only. On Linux, use --active-window or provide --window-id when available.
Run the PowerShell helper:
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1
Common patterns:
Default location:
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1
Temp location (Codex visual check):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Mode temp
Explicit path:
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Path "C:\Temp\screen.png"
Pixel region (x,y,w,h):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Mode temp -Region 100,200,800,600
Active window (ask the user to focus it first):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -Mode temp -ActiveWindow
Specific window handle (only when provided):
powershell -ExecutionPolicy Bypass -File <path-to-skill>/scripts/take_screenshot.ps1 -WindowHandle 123456
Use these when you cannot run the helpers.
Full screen to a specific path:
screencapture -x output/screen.png
Pixel region:
screencapture -x -R100,200,800,600 output/region.png
Specific window id:
screencapture -x -l12345 output/window.png
Interactive selection or window pick:
screencapture -x -i output/interactive.png
Full screen:
scrot output/screen.png
gnome-screenshot -f output/screen.png
import -window root output/screen.png
Pixel region:
scrot -a 100,200,800,600 output/region.png
import -window root -crop 800x600+100+200 output/region.png
Active window:
scrot -u output/window.png
gnome-screenshot -w -f output/window.png
bash <path-to-skill>/scripts/ensure_macos_permissions.sh first to request Screen Recording in one place.ModuleCache permission errors in a sandboxed run, rerun the command with escalated permissions.--list-windows --app "AppName" and retry with --window-id, and make sure the app is visible on screen.command -v scrot, command -v gnome-screenshot, and command -v import.Weekly Installs
56
Repository
GitHub Stars
22.6K
First Seen
Feb 8, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
gemini-cli56
github-copilot56
codex56
opencode56
amp55
kimi-cli55
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
166,500 周安装
系统生物学与通路分析工具:基因集富集、蛋白质通路映射与多数据库整合
157 周安装
电子邮件服务集成指南:SMTP、SendGrid、Mailgun、AWS SES 与 Python/Node.js 实现
159 周安装
Azure OpenAI 2025 模型全解析:GPT-5、GPT-4.1、推理模型部署与集成指南
68 周安装
TextKit 2 完整参考指南:架构、迁移与 SwiftUI 集成 | iOS 文本处理
157 周安装
iOS能耗优化API参考:WWDC代码示例与功耗分析器完整指南
156 周安装
API版本控制策略指南:REST/GraphQL/gRPC向后兼容、弃用与迁移最佳实践
159 周安装