📸 appsnap
Fast Windows screenshot tool for AI coding agents
appsnap is a simple, fast CLI tool for capturing screenshots of Windows application windows. Perfect for AI agents that need to verify UI changes during development iterations.
✨ Features
- 🎯 Window-specific capture - Target apps by name with fuzzy matching
- � Bulk capture - Screenshot all windows at once for testing
- 🚀 Fast - Screenshots in ~0.1-0.3 seconds
- 🤖 Agent-friendly - JSON output and stdout paths for easy parsing
- 📁 Smart defaults - Temp directory with auto-cleanup
- 🔍 List windows - See all capturable windows
- 🎨 DPI-aware - Handles high-DPI displays correctly
- 🔢 Duplicate handling - Auto-numbers windows with identical titles
🚀 Quick Start
Installation
# Install from PyPI with uvx (recommended)
uvx appsnap
# Or install as a tool with uv
uv tool install appsnap
# Or with pipx
pipx install appsnap
# Install from GitHub (development version)
uv tool install git+https://github.com/detroittommy879/appsnap.git
# Development mode (local testing)
git clone https://github.com/detroittommy879/appsnap.git
cd appsnap
uv venv
uv pip install -e .
Usage
Option 1: After activating venv
# Activate the virtual environment first
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
# Then use appsnap directly
appsnap --list
appsnap "Visual Studio Code"
Option 2: Using uv run (no activation needed)
# Run from within the appsnap directory
cd appsnap
uv run appsnap --list
uv run appsnap "Chrome" --output screenshot.png
Common Commands:
# List all capturable windows
appsnap --list
# Capture a window (saves to temp directory)
appsnap "Visual Studio Code"
# Capture with custom output path
appsnap "Chrome" --output screenshot.png
# JSON output for agents
appsnap "Notepad" --json
# {"path": "C:\\Temp\\appsnap\\appsnap_20260202_153045.png", "window": "Notepad", "bbox": [100, 200, 800, 600]}
# Adjust fuzzy matching threshold (0-100, default 70)
appsnap "VS" --threshold 60
# Capture ALL windows to a folder (great for testing!)
appsnap --all ./screenshots
# Capture all with JSON summary
appsnap --all ./test-screens --json
🤖 AI Agent Integration
Claude Desktop Skill
Add to your agent prompt or skill:
When you need to verify UI changes, use: appsnap "App Name" --json
Parse the JSON output to get the screenshot path and window metadata.
Python Integration
import subprocess
import json
result = subprocess.run(
["appsnap", "Chrome", "--json"],
capture_output=True,
text=True
)
data = json.loads(result.stdout)
screenshot_path = data["path"]
PowerShell Integration
$result = appsnap "VSCode" --json | ConvertFrom-Json
Write-Host "Screenshot: $($result.path)"
📖 CLI Options
positional arguments:
window_name Window title to search for (fuzzy matching)
options:
-h, --help Show this help message and exit
-l, --list List all capturable windows
-a DIR, --all DIR Capture all windows to specified directory
-o PATH, --output PATH
Output file path (default: temp directory)
-t N, --threshold N Fuzzy match threshold 0-100 (default: 70)
-j, --json Output JSON with path and metadata
Bulk Capture Example
The --all flag is perfect for quickly testing that all windows capture correctly:
# Capture all windows to a test folder
uv run appsnap --all ./test-captures
# Output:
# Capturing 42 window(s) to C:\path\to\test-captures...
#
# [OK] Visual Studio Code
# [OK] Chrome - Google Search
# [OK] Task Manager
# [OK] Settings
# [OK] PowerShell_1 # Auto-numbered duplicate
# [OK] PowerShell_2 # Auto-numbered duplicate
# ...
#
# Complete: 40 successful, 2 failed
# Screenshots saved to: C:\path\to\test-captures
Windows with the same title automatically get numbered (e.g., PowerShell_1.png, PowerShell_2.png).
🛠️ How It Works
- DPI Awareness - Sets process DPI awareness for correct scaling on high-DPI displays
- Window Enumeration - Uses Win32 API to enumerate all visible, non-minimized windows
- Fuzzy Matching - Finds windows using
fuzzywuzzyfor flexible name matching - Direct Window Capture - Uses Win32
PrintWindowAPI to capture window content directly (works even when partially occluded) - Output - Saves to temp or custom location, prints path to stdout for easy agent parsing
🔧 Development
# Clone and install dev dependencies
git clone <repo>
cd appsnap
uv pip install -e ".[dev]"
# Run tests
uv run pytest
# Run with local changes
uv run appsnap --list
🐛 Troubleshooting
"No window found matching..."
- Use
appsnap --listto see exact window titles - Try lowering the threshold:
--threshold 60 - Make sure the window is visible (not minimized)
Screenshots are blank, wrong window, or multiple windows
v0.1.1 Fix: Switched to Win32 PrintWindow API for direct window content capture.
This method captures the actual window content, not screen regions, so it:
- Works correctly on multi-monitor setups
- Captures partially occluded windows
- Handles DPI scaling properly
If you still have issues:
- Ensure the window is not minimized (minimized windows cannot be captured)
- Some apps (especially GPU-accelerated ones) may not respond to PrintWindow correctly
- Try bringing the window to foreground if capture fails
DPI/Scaling issues
The tool automatically handles DPI awareness. If you see incorrect sizing:
- Ensure Windows display scaling is consistent
- Check that the app respects DPI settings
📝 License
MIT License - see LICENSE for details
🙏 Acknowledgments
Built on the excellent Windows-MCP project patterns and libraries:
- Pillow - Screenshot capture and image processing
- fuzzywuzzy - Fuzzy string matching
- pywin32 - Windows API access
🤝 Contributing
Contributions welcome! Please feel free to submit issues or pull requests.
For maintainers publishing to PyPI, see PUBLISHING.md for detailed instructions on:
- Setting up GitHub Actions for automated PyPI releases
- Manual publishing workflow
- AI agent skill integration
- Troubleshooting
Made for AI agents, by developers 🤖❤️
Metadata
Release files for appsnap 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| appsnap-0.2.0.tar.gz | 66.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| appsnap-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.6 kB
Release files / appsnap-0.2.0.tar.gz
| Download URL | appsnap-0.2.0.tar.gz |
|---|---|
| Size | 66.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
487be017654fc19dc5d78aa60f003c3452f486d018c72c8c3d87d1ab95c22e8c
|
|
BLAKE2b-256 checksum How to use checksums |
11af1e678c49b1c82e5a34e4f284598dd9bcaa837bf7dd65c8a7272ac7d3c404
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|
Release files / appsnap-0.2.0-py3-none-any.whl
| Download URL | appsnap-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e477cee75b9dfa603e135156367d67655b14e92c62e1d06942ac14d6548dd3fc
|
|
BLAKE2b-256 checksum How to use checksums |
af2ef655e5877e9cb5b3365c935f59de6efdb0ce2b826ed69aed78f471ba42d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|