Examples

unused-assets

Scan static files and co-located content assets, then report files not referenced by any content or template.

# Find unused assets
hwaro tool unused-assets

# Specify directories
hwaro tool unused-assets -c posts -s assets

# Delete unused files (with confirmation prompt)
hwaro tool unused-assets --delete

# Output as JSON
hwaro tool unused-assets --json

Options

Flag Description
-c, --content DIR Content directory (default: content)
-s, --static-dir DIR Static files directory (default: static)
--delete Delete unused files (prompts for confirmation)
-j, --json Output result as JSON
-h, --help Show help

What It Scans

Asset sources:

Reference sources:

Supported asset extensions: Images (png, jpg, jpeg, gif, svg, webp, avif, ico, bmp, tiff), stylesheets (css), scripts (js), fonts (woff, woff2, ttf, eot, otf), media (mp4, webm, ogg, mp3, wav), documents (pdf, zip).

Example Output

Scanning for unused assets...

  Total assets:      24
  Referenced:         20
  Unused:             4

  Unused files:
    static/old-logo.png
    static/unused-banner.jpg
    content/blog/my-post/draft-image.png
    static/deprecated.css

Note: Dynamic references (e.g., template variables) may cause false positives.

JSON Output

{
  "unused_files": [
    "static/old-logo.png",
    "static/unused-banner.jpg"
  ],
  "total_assets": 24,
  "referenced_count": 22,
  "unused_count": 2
}

Limitations