---
title: Usage
description: Optimize a single image or a whole directory tree from the command line.
navigation:
icon: i-lucide-terminal
---
The CLI is the fastest way to squeeze images. The core command takes an input path and a target model.
## Single image
```bash [Terminal]
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
```bash [Terminal]
# 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](/providers/claude) for the math behind each target.
## Custom output
```bash [Terminal]
vision-squeezer image.png --model gpt6 --output optimized.avif --format avif
```
## Batch a directory
```bash [Terminal]
vision-squeezer ./screenshots --recursive --output-dir ./optimized
```
`--recursive` walks subdirectories; `--output-dir` mirrors the source tree structure into the destination.
## Core commands
| `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:
```bash [Terminal]
eval "$(npx -y vision-squeezer setup-hook)"
```