squirrelscan
GitHub

analyze

Run audit rules on stored crawl data

The analyze command runs audit rules on a previously crawled website without re-crawling.

Usage

squirrel analyze [options]

Options

OptionDescriptionDefault
--idCrawl ID to analyzeLatest crawl

What it fetches

analyze does not crawl again, but some rules read more than the stored pages. Like squirrel audit, it fetches the stylesheets, images, fonts, scripts, PDFs and web app manifest the pages reference. It status-checks the sitemap URLs the crawl did not fetch, on any host, and the internal link targets the crawl did not fetch. While reliability/broken-resources is on, it also status-checks the third-party scripts, stylesheets and fonts the pages load. Every asset and link check, and every redirect those follow, is held to the same rules as the audit’s, so no redirect or other host leads them to a link-local or cloud metadata address. It does not check external links.

The crawl you analyze may belong to a different project from the squirrel.toml in your directory. analyze uses the crawl’s own scope and page limit (include, exclude, robots.txt, domains, max_pages) and your per-host politeness settings, and it sends none of your [crawler] headers.

To turn the internal link checks off, set [internal_links] enabled = false. To turn the third-party checks off:

[rules]
disable = ["reliability/broken-resources"]

Examples

Analyze latest crawl

squirrel analyze

Analyze specific crawl

squirrel analyze --id a7b3c2d1

Output

Analyzing latest crawl...

✓ Ran 87 rules in 2.3s

Analysis complete: a7b3c2d1
  Site: https://example.com
  Passed: 52 | Warnings: 18 | Failed: 17

Run 'squirrel report' to view results.

Use cases

Iterate on rule configuration

# Crawl once
squirrel crawl https://example.com

# Test different rule configs
squirrel analyze
# Edit squirrel.toml
squirrel analyze

Re-analyze after code changes

# While developing custom rules
squirrel analyze

Separate crawl and analysis

# Crawl during off-hours
squirrel crawl https://example.com

# Analyze later
squirrel analyze

Configuration

The analyze command respects rule settings from squirrel.toml:

[rules]
enable = ["*"]
disable = ["ai/*"]

[rule_options]
# Rule-specific options

See Configuration for all options.

Retention

When the analysis succeeds, analyze applies [storage] keep_audits like squirrel audit does: audits older than the newest keep_audits are retired, and so are crawls abandoned by earlier killed runs. It prints a one-line notice on stderr when it retires something. An analysis of a blocked or failed crawl retires nothing.

Exit codes

CodeMeaning
0Success
1Error (no crawl found, analysis failed, etc.)
  • crawl - Crawl website without analysis
  • audit - Crawl + analyze in one command
  • report - View analysis results
  • Configuration - Config file options

Type to search…

↑↓ navigate↵ openesc close