npx skills add https://github.com/openai/skills --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
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp
python3 <path-to-skill>/scripts/take_screenshot.py --path output/screen.png
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex"
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex" --window-name "Settings"
python3 <path-to-skill>/scripts/take_screenshot.py --list-windows --app "Codex"
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
--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
--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
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"
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
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 检查工具可用性。每周安装量
1.4K
仓库
GitHub 星标数
15.3K
首次出现
2026年1月28日
安全审计
安装于
codex1.2K
opencode1.2K
gemini-cli1.2K
github-copilot1.2K
cursor1.2K
kimi-cli1.1K
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
1.4K
Repository
GitHub Stars
15.3K
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
codex1.2K
opencode1.2K
gemini-cli1.2K
github-copilot1.2K
cursor1.2K
kimi-cli1.1K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装