Skip to content

Console commands

Imager X provides three console command groups for generating transforms, clearing caches, and cleaning up expired transforms. All commands are run from your project root using ./craft, ddev craft or php craft.

imager-x/generate PRO

Batch generates image transforms based on volumes, folders, or fields. See the Generate documentation for the full list of parameters and examples.

bash
./craft imager-x/generate --volume=images
./craft imager-x/generate -v=images --recursive --queue
./craft imager-x/generate --field=myImage --transforms=small,medium,large

imager-x/clear-caches

Clears Imager X caches. Three sub-commands are available:

all

Clears both the transforms cache and the remote images runtime cache.

bash
./craft imager-x/clear-caches/all

transforms-cache

Clears only the local image transforms cache.

bash
./craft imager-x/clear-caches/transforms-cache

runtime-cache

Clears only the remote images runtime cache.

bash
./craft imager-x/clear-caches/runtime-cache

imager-x/clean

Scans the local transform cache, identifies files that have exceeded the configured cache duration, and deletes them. When run interactively, you will be prompted to confirm before any files are deleted.

bash
./craft imager-x/clean

Options

--volume (shorthand: -v)

Handle of the volume to clean transforms for. When omitted, all volumes are scanned.

bash
./craft imager-x/clean --volume=images

--duration (shorthand: -d)

Overrides the configured cache duration for this run. Accepts any value supported by PHP's DateInterval, e.g. P30D for 30 days or PT1H for one hour.

bash
./craft imager-x/clean --duration=P7D

Copyright © 2024 André Elvan