| name | kild-peek |
| description | Capture screenshots and inspect native application windows for visual verification.
TRIGGERS - Use this skill when user says:
- "peek at X", "peek on X", "use kild-peek"
- "take a screenshot of", "capture the window"
- "look at the UI", "take a look at the window", "see what X looks like"
- "visual check", "verify the UI shows", "check the window"
- "compare screenshots", "diff the images"
- "assert the window", "validate the UI"
- "click on X", "interact with the UI", "press the button"
- "list elements", "find element", "inspect the UI elements"
kild-peek captures screenshots of native macOS applications, compares images,
runs assertions on UI state, and interacts with UI elements. Use it to visually
verify what applications look like, validate UI state, and automate UI interactions
during development.
IMPORTANT: Always list windows first to identify the correct target.
Save screenshots to the scratchpad directory for easy cleanup.
|
| allowed-tools | Bash, Read, Glob, Grep |
kild-peek CLI - Native Application Inspector
kild-peek captures screenshots, lists windows, compares images, and validates UI state for native macOS applications.
Running kild-peek
If installed globally:
kild-peek list windows
During development (via cargo):
cargo run -p kild-peek -- list windows
The examples below use kild-peek directly. Prefix with cargo run -p kild-peek -- if not installed.
Important: Identify the Correct Window First
Always list windows before capturing to identify the correct target:
kild-peek list windows
This shows all visible windows with:
- ID - Unique window identifier (use with
--window-id)
- Title - Window title (use with
--window)
- App - Application name (use with
--app for filtering)
- Size - Window dimensions
- Status - Visible or Minimized
Window Matching Strategies
Using --window <title> (title-based matching):
- Exact case-insensitive match on window title
- Exact case-insensitive match on app name
- Partial case-insensitive match on window title
- Partial case-insensitive match on app name
Using --app <name> (app-based matching):
Finds windows by application name. More reliable than title matching when multiple windows share similar titles.
Using --app + --window (precise matching):
Combines both filters for exact targeting when multiple windows exist for the same app.
Matching User Intent to Windows
When the user asks to "peek at X", find the right window:
| User Says | Search Strategy |
|---|
| "the terminal" | Search for Ghostty, iTerm, Terminal |
| "my editor" | Search for Zed, VS Code, Cursor |
| "the kild UI" | Search for "KILD" or "kild-ui" |
| "the browser" | Search for Safari, Chrome, Firefox, Arc |
| "app X" | Search for X in title or app name |
If multiple matches exist, use --window-id with the specific ID, or ask the user to clarify.
Screenshot Storage
Always save screenshots to the scratchpad directory:
kild-peek screenshot --window "KILD" -o "$SCRATCHPAD/kild-ui.png"
This keeps screenshots organized and easy to clean up.
Core Commands
List Windows
kild-peek list windows [--app <name>] [--json]
Shows all visible windows. Always run this first to identify targets.
Flags:
--app <name> - Filter windows by application name
--json - Output as JSON
Examples:
kild-peek list windows
kild-peek list windows --app Ghostty
kild-peek list windows --app "Visual Studio Code"
kild-peek list windows --json
kild-peek list windows --json | grep -i "terminal"
List Monitors
kild-peek list monitors [--json]
Shows all connected displays.
Capture Screenshot
kild-peek screenshot [--window <title>] [--app <name>] [--window-id <id>] [--monitor <index>] [--crop <region>] [--wait] [--timeout <ms>] -o <path>
Captures a screenshot of a window or monitor.
Flags:
--window <title> - Capture window by title (exact match preferred, falls back to partial)
--app <name> - Capture window by app name (can combine with --window for precision)
--window-id <id> - Capture window by exact ID
--monitor <index> - Capture specific monitor (0 = primary)
--crop <region> - Crop to region: x,y,width,height (e.g., "0,0,400,50")
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
-o <path> - Output file path (required for file output)
--format <png|jpg> - Image format (default: png)
--quality <1-100> - JPEG quality (default: 85)
--base64 - Output base64 to stdout instead of file
Note: --app, --window-id, and --monitor are mutually exclusive. You can combine --app with --window for precise matching.
Examples:
kild-peek screenshot --window "KILD" -o "$SCRATCHPAD/kild.png"
kild-peek screenshot --app Ghostty -o "$SCRATCHPAD/ghostty.png"
kild-peek screenshot --app Ghostty --window "Terminal" -o "$SCRATCHPAD/precise.png"
kild-peek screenshot --window-id 8002 -o "$SCRATCHPAD/window.png"
kild-peek screenshot --window "Terminal" --wait -o "$SCRATCHPAD/term.png"
kild-peek screenshot --window "Terminal" --wait --timeout 5000 -o "$SCRATCHPAD/term.png"
kild-peek screenshot -o "$SCRATCHPAD/screen.png"
kild-peek screenshot --window "Terminal" -o "$SCRATCHPAD/term.jpg" --format jpg --quality 90
kild-peek screenshot --app Ghostty --crop 0,0,400,300 -o "$SCRATCHPAD/cropped.png"
Compare Images (Diff)
kild-peek diff <image1> <image2> [--threshold <0-100>] [--json]
Compares two images using SSIM (Structural Similarity Index).
Flags:
--threshold <0-100> - Similarity threshold percentage (default: 95)
--diff-output <path> - Save visual diff image highlighting differences
--json - Output result as JSON
Exit codes:
0 - Images are similar (meet threshold)
1 - Images are different (below threshold)
Examples:
kild-peek diff "$SCRATCHPAD/before.png" "$SCRATCHPAD/after.png"
kild-peek diff "$SCRATCHPAD/a.png" "$SCRATCHPAD/b.png" --threshold 80
kild-peek diff "$SCRATCHPAD/a.png" "$SCRATCHPAD/b.png" --diff-output "$SCRATCHPAD/diff.png"
kild-peek diff "$SCRATCHPAD/a.png" "$SCRATCHPAD/b.png" --json
Assert UI State
kild-peek assert [--window <title>] [--app <name>] [--exists|--visible|--similar <baseline>] [--wait] [--timeout <ms>] [--json]
Runs assertions on UI state. Returns exit code 0 for pass, 1 for fail.
Assertion types:
--exists - Assert window exists
--visible - Assert window is visible (not minimized)
--similar <path> - Assert current screenshot matches baseline image
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name (can combine with --window)
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--threshold <0-100> - Similarity threshold for --similar (default: 95)
--json - Output result as JSON
Examples:
kild-peek assert --window "KILD" --exists
kild-peek assert --app "KILD" --exists
kild-peek assert --window "KILD" --exists --wait
kild-peek assert --window "KILD" --exists --wait --timeout 5000
kild-peek assert --window "Terminal" --visible
kild-peek assert --app Ghostty --window "Terminal" --visible
kild-peek assert --window "KILD" --similar "$SCRATCHPAD/baseline.png" --threshold 90
kild-peek assert --window "KILD" --exists --json
UI Interaction Commands
List UI Elements
kild-peek elements [--window <title>] [--app <name>] [--tree] [--wait] [--timeout <ms>] [--json]
Lists all UI elements in a window using the macOS Accessibility API. Shows buttons, text fields, labels, and other interactive elements.
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name (can combine with --window)
--tree - Display elements as indented tree hierarchy with box-drawing characters
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Examples:
kild-peek elements --app Finder
kild-peek elements --window "Terminal"
kild-peek elements --app Finder --tree
kild-peek elements --app Ghostty --window "Terminal"
kild-peek elements --app Finder --wait
kild-peek elements --app Finder --wait --timeout 5000
kild-peek elements --app KILD --json
Output includes:
- Element role (button, text field, menu item, etc.)
- Title, value, and description (when available)
- Position (x, y) and size (width, height)
- Enabled state
- Depth in hierarchy (visible in JSON output, or as indentation with
--tree)
Find UI Element by Text
kild-peek find --text <search> [--regex] [--window <title>] [--app <name>] [--wait] [--timeout <ms>] [--json]
Finds a UI element by searching for text in its title, value, or description.
Flags:
--text <search> - Text to search for (required)
--regex - Treat --text value as a regex pattern (case-sensitive by default)
--window <title> - Target window by title
--app <name> - Target window by app name (can combine with --window)
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Examples:
kild-peek find --app Finder --text "File"
kild-peek find --app KILD --text "Create"
kild-peek find --app Finder --text "^File$" --regex
kild-peek find --app KILD --text "Create|Destroy" --regex
kild-peek find --app KILD --text "(?i)submit" --regex
kild-peek find --app KILD --text "Create" --wait
kild-peek find --app Finder --text "Submit" --json
Search behavior:
- Default: Case-insensitive partial matching (substring)
- With
--regex: Case-sensitive regex pattern matching (use (?i) prefix for case-insensitive)
- Searches title, value, and description fields
- Returns first matching element
Click UI Element
kild-peek click [--window <title>] [--app <name>] --at <x,y> [--wait] [--timeout <ms>] [--json]
kild-peek click [--window <title>] [--app <name>] --text <search> [--wait] [--timeout <ms>] [--json]
Clicks at specific coordinates or on an element identified by text.
Coordinate-based click:
--at <x,y> - Click at coordinates relative to window top-left
Text-based click:
--text <search> - Find and click element by text (uses Accessibility API)
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name (can combine with --window)
--right - Right-click (context menu). Conflicts with --double
--double - Double-click. Conflicts with --right
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Note: --at and --text are mutually exclusive. --right and --double are mutually exclusive.
Examples:
kild-peek click --window "Terminal" --at 100,50
kild-peek click --app Ghostty --at 200,100
kild-peek click --app Ghostty --window "Terminal" --at 150,75
kild-peek click --app KILD --text "Create"
kild-peek click --app Finder --at 100,50 --right
kild-peek click --app Finder --text "File" --right
kild-peek click --app Finder --at 100,50 --double
kild-peek click --app KILD --text "Create" --wait
kild-peek click --app KILD --text "Open" --json
Type Text
kild-peek type [--window <title>] [--app <name>] <text> [--wait] [--timeout <ms>] [--json]
Types text into the focused element in the target window.
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Examples:
kild-peek type --window "Terminal" "hello world"
kild-peek type --app TextEdit "some text"
kild-peek type --app TextEdit "text" --wait
kild-peek type --window "Terminal" "test" --json
Send Key Combination
kild-peek key [--window <title>] [--app <name>] <key-combo> [--wait] [--timeout <ms>] [--json]
Sends a key or key combination to the target window.
Supported modifiers: cmd, shift, opt (or alt), ctrl
Common keys: enter, return, tab, space, escape, delete, backspace, arrow keys, function keys
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Examples:
kild-peek key --window "Terminal" "enter"
kild-peek key --app Ghostty "cmd+s"
kild-peek key --window "Terminal" "cmd+shift+p"
kild-peek key --app Ghostty "enter" --wait
kild-peek key --app TextEdit "tab" --json
Drag
kild-peek drag [--window <title>] [--app <name>] --from <x,y> --to <x,y> [--wait] [--timeout <ms>] [--json]
Drags from one point to another within a window.
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name
--from <x,y> - Start coordinates relative to window top-left (required)
--to <x,y> - End coordinates relative to window top-left (required)
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Examples:
kild-peek drag --app Finder --from 100,100 --to 300,200
kild-peek drag --app Finder --from 10,20 --to 30,40 --json
Scroll
kild-peek scroll [--window <title>] [--app <name>] [--up <lines>] [--down <lines>] [--left <lines>] [--right <lines>] [--at <x,y>] [--wait] [--timeout <ms>] [--json]
Scrolls within a window. Specify direction and number of lines.
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name
--up <lines> - Scroll up N lines. Conflicts with --down
--down <lines> - Scroll down N lines. Conflicts with --up
--left <lines> - Scroll left N lines. Conflicts with --right
--right <lines> - Scroll right N lines. Conflicts with --left
--at <x,y> - Position to scroll at (relative to window top-left)
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Examples:
kild-peek scroll --app Finder --down 5
kild-peek scroll --app Finder --up 3
kild-peek scroll --app Finder --left 2
kild-peek scroll --app Finder --right 4
kild-peek scroll --app Finder --at 100,200 --down 5
Hover
kild-peek hover [--window <title>] [--app <name>] [--at <x,y>] [--text <search>] [--wait] [--timeout <ms>] [--json]
Moves the mouse to a position or element without clicking.
Flags:
--window <title> - Target window by title
--app <name> - Target window by app name
--at <x,y> - Coordinates to hover (relative to window top-left). Conflicts with --text
--text <search> - Hover over element by text content (uses Accessibility API). Conflicts with --at
--wait - Wait for window to appear (polls until found or timeout)
--timeout <ms> - Timeout in milliseconds when using --wait (default: 30000)
--json - Output as JSON
Examples:
kild-peek hover --app Finder --at 100,50
kild-peek hover --app Finder --text "File"
kild-peek hover --app Finder --at 50,50 --json
Workflow Examples
Visual Verification of UI Changes
kild-peek list windows --app KILD
kild-peek screenshot --app KILD -o "$SCRATCHPAD/before.png"
kild-peek screenshot --app KILD -o "$SCRATCHPAD/after.png"
kild-peek diff "$SCRATCHPAD/before.png" "$SCRATCHPAD/after.png" --threshold 80
Validate UI State in Tests
kild-peek assert --app KILD --visible
kild-peek assert --app KILD --similar "./baselines/kild-empty-state.png" --threshold 90
Capture Multiple Windows
kild-peek list windows --json > "$SCRATCHPAD/windows.json"
kild-peek screenshot --window-id 8002 -o "$SCRATCHPAD/kild.png"
kild-peek screenshot --window-id 8429 -o "$SCRATCHPAD/ghostty.png"
Automated UI Interaction
kild-peek list windows --app KILD
kild-peek elements --app KILD
kild-peek find --app KILD --text "Create"
kild-peek click --app KILD --text "Create"
kild-peek type --app KILD "my-new-branch"
kild-peek key --app KILD "enter"
Element-Based Testing
kild-peek find --app KILD --text "Submit" && echo "Button found"
kild-peek click --app KILD --text "Submit"
sleep 1
kild-peek assert --app KILD --visible
kild-peek click --app KILD --text "Branch Name"
kild-peek type --app KILD "feature-auth"
kild-peek click --app KILD --text "Create"
Tips
- Output is clean by default - JSON logs are suppressed unless you use
-v/--verbose
- List windows first to identify the correct target before capturing
- Use
--app for reliability when multiple windows have similar titles
- Combine
--app and --window for precise targeting when needed
- Use
--window-id for the most precise targeting (unique window ID)
- Save to scratchpad for easy cleanup of temporary screenshots
- Use
--json for scripting and parsing results programmatically
- Exit codes are meaningful - use them in shell scripts for automation
Global Flags
-v, --verbose - Enable verbose logging output (shows JSON logs)
-h, --help - Show help for any command
-V, --version - Show version