hubcap images

List all images on the current page with src, alt text, and dimensions.

When to use

Use images to enumerate every image on the page. Useful for auditing image assets, checking for missing alt text, or verifying image dimensions.

Usage

hubcap images

Arguments

None.

Flags

None.

Output

FieldTypeDescription
imagesarrayArray of image objects
images[].srcstringThe image source URL
images[].altstringThe alt text attribute
images[].widthnumberThe rendered width in pixels
images[].heightnumberThe rendered height in pixels
countnumberTotal number of images found
{
  "images": [
    {
      "src": "https://example.com/logo.png",
      "alt": "Company Logo",
      "width": 200,
      "height": 50
    },
    {
      "src": "https://example.com/hero.jpg",
      "alt": "",
      "width": 1200,
      "height": 600
    }
  ],
  "count": 2
}

Errors

ConditionExit codeStderr
Chrome not connected2error: connecting to Chrome: ...
Timeout3error: timeout

Examples

List all images:

hubcap images

Find images with missing alt text:

hubcap images | jq '[.images[] | select(.alt == "")]'

Generate a report of image sizes for a page by chaining with other tools:

hubcap goto "https://example.com" && hubcap images | jq -r '.images[] | "\(.width)x\(.height) \(.src)"'

See also

  • links - extract all links from the page
  • scripts - list all script elements