Allscreenshots Docs
Tools

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 allscreenshots
cargo install allscreenshots-cli
git clone https://github.com/allscreenshots/allscreenshots-cli
cd allscreenshots-cli
cargo build --release

Quick start

Set up authentication

Get your API key from the dashboard, then store it for future use:

allscreenshots config add-authtoken YOUR_API_KEY

Or set it as an environment variable:

export ALLSCREENSHOTS_API_KEY=YOUR_API_KEY

Capture your first screenshot

allscreenshots https://github.com

This 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.png

Basic usage

Quick capture (displays in terminal)

allscreenshots https://example.com

Save to file

allscreenshots https://example.com -o screenshot.png

Mobile screenshot

allscreenshots https://example.com --device "iPhone 14"

Full page capture

allscreenshots https://example.com --full-page -o fullpage.png

Commands

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 --wait

Options:

  • --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.png

Options:

  • --devices <DEVICES> - Device presets to capture
  • --layout <LAYOUT> - Layout: horizontal, vertical, grid
  • --spacing <PX> - Spacing between images
  • --labels - Add device labels

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 usage

Displays 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.png

config

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-authtoken

devices

Show available device presets:

allscreenshots devices

completions

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.fish

Global options

These options work with any command:

OptionDescription
-k, --api-key <KEY>API key (overrides env and config)
-o, --output <FILE>Output file path
-d, --device <DEVICE>Device preset
--full-pageCapture full page
--displayShow in terminal
--no-displayDon't show in terminal
--jsonOutput as JSON
-v, --verboseVerbose output
--no-colorDisable 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 png

Watch mode for development

Re-capture at intervals:

allscreenshots watch http://localhost:3000 --interval 5

Batch with different devices

for device in "Desktop HD" "iPhone 14" "iPad Pro"; do
  allscreenshots https://example.com \
    --device "$device" \
    -o "screenshot-${device// /-}.png"
done

Combine 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.png

Terminal 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"

On this page