Eight commands: five standalone, plus the service and its client. The standalone commands each open a display, do their work, and exit.
Command
Purpose
capture
Capture a desktop, region, or window and return it.eensh capture [TARGET] [IMAGE] [OUTPUT]
diff
Compare two saved images and report what changed.eensh diff BEFORE AFTER [OPTIONS]
wait-change
Block until the visible state departs from a baseline.eensh wait-change [TARGET] [OPTIONS]
wait-stable
Block until the visible state stops moving.eensh wait-stable [TARGET] [OPTIONS]
observe
Wait for a transition, then for it to settle, and return the result.eensh observe [TARGET] [OPTIONS]
serve
Run the persistent capture service in the foreground.eensh serve [--socket PATH]
ping
Ask a running service whether it is alive.eensh ping [--socket PATH] [--json]
session
Talk to a running service: create, capture, diff, observe, realtime.eensh session <SUBCOMMAND>
Target options
Shared by every command that captures. All three are optional.
Option
Meaning
--display DISPLAY
X11 display, for example `:1`. Overrides `$DISPLAY`.
--region X,Y,W,H
A rectangle in source-desktop pixels. Never clipped silently.
--window ID
An X11 window by ID, decimal or `0x`-prefixed. Reads the visible desktop under it.
Image options
Option
Meaning
--format png|jpeg
Output format. Defaults to `png`, or is inferred from the output file extension.
--quality N
JPEG quality, 1–100. Default `80`. JPEG only.
--compression fast|default|best
PNG effort. Default `default`, which maps to the encoder's *Balanced* level — see the performance page before using it on a large screen.
--width N
Resize to a width, preserving aspect ratio. Applied before encoding.
--height N
Resize to a height, preserving aspect ratio.
--scale F
Resize by a uniform factor.
Output options
Option
Meaning
OUTPUT
Positional output path. `-` or omitted means stdout.
--base64
Embed the encoded image in the JSON response. Requires `--json`.
--json
Emit the structured JSON response.
--time
Print per-stage timings to stderr.
bash
$ eenshcaptureshot.png# PNG to a fileeenshcapture--formatjpegshot.jpg# JPEG to a fileeenshcapture--formatpng-|consumer# PNG on stdouteenshcapture--base64--json# agent-facing JSON on stdout
Observation options
For wait-change, wait-stable, and observe.
Option
Meaning
--mode exact|rgb
Comparison mode for change detection. Default `rgb`.
--pixel-threshold N
Largest per-channel difference treated as unchanged. Default `12`.
--area-threshold F
Smallest changed fraction treated as meaningful. Default `0.005`.
--interval D
Target cadence between samples. Default `100ms`.
--timeout D
Total deadline. Default `5s`. A timeout exits `100`, which is not an error.
--stable-for D
How long the scene must hold still. Default `300ms`.
Real-time options
Option
Default
Meaning
--frames
3
How many frames, 1–8. A maximum, not a promise.
--interval
50ms
Nominal spacing between sample opportunities.
--timeout
500ms
Deadline for starting a capture. Deliberately shorter than the observation default, because a real-time request is bounded by intent.
Presentation flags
Available on capture, latest, frame, diff, and realtime. With none of them supplied, the output is exactly what it was before presentation existed.