CLI Usage — Optimize Images for Vision LLMs
The CLI is the fastest way to squeeze images. The core command takes an input path and a target model.
Single image
vision-squeezer screenshot.png --model claude
Squeezer runs the full pipeline — semantic crop → tile-aware resize → encode — and writes an optimized file next to the input. It also records the savings in the local stats database.
Choosing a target
# Claude 4.7+: fit 28px patches and strip padding
vision-squeezer image.png --model claude
# GPT-6 / GPT-5.6: fit the current 32px patch budget
vision-squeezer image.png --model gpt6
# Gemini: snap down to 768px tile boundaries
vision-squeezer image.png --model gemini
# Agnostic: no --model, optimize generally across providers
vision-squeezer image.png
See Providers for the math behind each target.
Custom output
vision-squeezer image.png --model gpt6 --output optimized.avif --format avif
Batch a directory
vision-squeezer ./screenshots --recursive --output-dir ./optimized
--recursive walks subdirectories; --output-dir mirrors the source tree structure into the destination.
Core commands
| Command | Description |
|---|---|
vision-squeezer <image> [options] | Optimize a single image |
vision-squeezer <dir> --recursive [--output-dir DIR] | Batch optimize a tree |
vision-squeezer stats | View cumulative savings analytics |
vision-squeezer setup-hook | Print shell integration (eval) script for Zsh/Bash |
Shell integration
Add a squeeze shortcut to your shell:
eval "$(npx -y vision-squeezer setup-hook)"
MCP Setup
One-command MCP install for Claude Code, Cursor, VS Code, Windsurf, Claude Desktop, Codex, Gemini CLI, Qwen, and Kimi, plus a Zed config snippet.
CLI Options Reference
Every VisionSqueezer CLI flag, including --max-tokens token budgets, --model provider profiles, --format, --quality, --smart-crop, --json and --dry-run.
