CLI
Capture screenshots from the command line
Command line interface
Capture website screenshots directly from your terminal. Perfect for automation, shell scripts, and quick captures.
Source code: GitHub | Homebrew: brew install allscreenshots/allscreenshots/allscreenshots
Installation
brew tap allscreenshots/allscreenshots
brew install allscreenshotscargo install allscreenshots-cligit clone https://github.com/allscreenshots/allscreenshots-cli
cd allscreenshots-cli
cargo build --releaseQuick start
Set up authentication
Get your API key from the dashboard, then store it for future use:
allscreenshots config add-authtoken YOUR_API_KEYOr set it as an environment variable:
export ALLSCREENSHOTS_API_KEY=YOUR_API_KEYCapture your first screenshot
allscreenshots https://github.comThis captures the URL and displays the screenshot directly in your terminal (if your terminal supports images).
Save to a file
allscreenshots https://github.com -o github.pngBasic usage
Quick capture (displays in terminal)
allscreenshots https://example.comSave to file
allscreenshots https://example.com -o screenshot.pngMobile screenshot
allscreenshots https://example.com --device "iPhone 14"Full page capture
allscreenshots https://example.com --full-page -o fullpage.pngCommands
capture
Take a synchronous screenshot (default command):
allscreenshots capture https://example.com [OPTIONS]Options:
-o, --output <FILE>- Save to file-d, --device <DEVICE>- Device preset (e.g., "Desktop HD", "iPhone 14")--full-page- Capture full scrollable page--format <FORMAT>- Output format: png, jpeg, webp, pdf--display- Show in terminal--no-display- Don't show in terminal
async
Async capture with job tracking:
allscreenshots async https://example.com --waitOptions:
--wait- Wait for completion and download result--poll-interval <SECS>- Polling interval (default: 2)
batch
Capture multiple URLs:
# From arguments
allscreenshots batch https://site1.com https://site2.com -o ./screenshots/
# From file
allscreenshots batch -f urls.txt -o ./screenshots/Options:
-f, --file <FILE>- Read URLs from file (one per line)-o, --output-dir <DIR>- Output directory (default: ./screenshots)--device <DEVICE>- Device preset for all captures--format <FORMAT>- Output format
compose
Combine multiple screenshots into one image:
allscreenshots compose https://example.com \
--devices "Desktop HD" "iPhone 14" "iPad Pro" \
--layout horizontal \
-o comparison.pngOptions:
--devices <DEVICES>- Device presets to capture--layout <LAYOUT>- Layout: horizontal, vertical, grid--spacing <PX>- Spacing between images--labels- Add device labels
gallery
Browse screenshots with thumbnails:
# Show recent API jobs
allscreenshots gallery
# Show local directory
allscreenshots gallery --dir ./screenshots/Options:
--dir <PATH>- Local directory to browse--limit <N>- Max images to show (default: 10)--size <SIZE>- Thumbnail size: small, medium
usage
Show API usage and quota:
allscreenshots usageDisplays a visual graph of your current usage against your plan limits.
schedule
Manage scheduled screenshots:
# List schedules
allscreenshots schedule list
# Create a schedule
allscreenshots schedule create \
--name "Daily homepage" \
--url https://example.com \
--cron "0 9 * * *" \
--timezone "America/New_York"
# View history
allscreenshots schedule history <SCHEDULE_ID>Subcommands: list, create, get, update, delete, pause, resume, trigger, history
jobs
Manage screenshot jobs:
# List recent jobs
allscreenshots jobs list
# Get job status
allscreenshots jobs get <JOB_ID>
# Download result
allscreenshots jobs result <JOB_ID> -o screenshot.pngconfig
Manage authentication and settings:
# Store API key
allscreenshots config add-authtoken YOUR_API_KEY
# Show config
allscreenshots config show
# Show config file path
allscreenshots config path
# Remove stored key
allscreenshots config remove-authtokendevices
Show available device presets:
allscreenshots devicescompletions
Generate shell completions:
# Bash
allscreenshots completions bash > ~/.local/share/bash-completion/completions/allscreenshots
# Zsh
allscreenshots completions zsh > ~/.zfunc/_allscreenshots
# Fish
allscreenshots completions fish > ~/.config/fish/completions/allscreenshots.fishGlobal options
These options work with any command:
| Option | Description |
|---|---|
-k, --api-key <KEY> | API key (overrides env and config) |
-o, --output <FILE> | Output file path |
-d, --device <DEVICE> | Device preset |
--full-page | Capture full page |
--display | Show in terminal |
--no-display | Don't show in terminal |
--json | Output as JSON |
-v, --verbose | Verbose output |
--no-color | Disable colors |
Device presets
Common device presets:
Desktop:
Desktop HD(1920x1080)Desktop 4K(3840x2160)Laptop(1366x768)
Mobile:
iPhone 14(390x844)iPhone 14 Pro Max(430x932)iPhone SE(375x667)Android(360x800)
Tablet:
iPad Pro 12.9(1024x1366)iPad Pro 11(834x1194)iPad Air(820x1180)
Run allscreenshots devices for the complete list.
Examples
CI/CD integration
Capture screenshots as part of your build:
#!/bin/bash
allscreenshots batch \
-f ./test-urls.txt \
-o ./screenshots/ \
--device "Desktop HD" \
--format pngWatch mode for development
Re-capture at intervals:
allscreenshots watch http://localhost:3000 --interval 5Batch with different devices
for device in "Desktop HD" "iPhone 14" "iPad Pro"; do
allscreenshots https://example.com \
--device "$device" \
-o "screenshot-${device// /-}.png"
doneCombine with other tools
# Capture and upload to S3
allscreenshots https://example.com -o - | aws s3 cp - s3://bucket/screenshot.png
# Capture and optimize
allscreenshots https://example.com -o screenshot.png && optipng screenshot.pngTerminal image support
The CLI can display screenshots directly in your terminal if it supports:
- Kitty graphics protocol - Kitty, WezTerm
- iTerm2 inline images - iTerm2, Hyper
- Sixel graphics - xterm, mlterm, foot
For unsupported terminals, the image is rendered using Unicode block characters.
Configuration file
The CLI stores settings in:
- macOS:
~/Library/Application Support/com.allscreenshots.cli/config.toml - Linux:
~/.config/allscreenshots/config.toml
Example config:
[auth]
api_key = "as_live_xxxx"
[defaults]
device = "Desktop HD"
format = "png"
output_dir = "./screenshots"