CLI and output contract
All command-line options and what the JSON and report outputs promise.
CLI
auditmysite [OPTIONS] [URL] [COMMAND]
Primary commands:
auditmysite <url>: run a full single-page audit and print a table; nothing is written (-o report.jsonor-f pdf -o report.pdfkeeps a report)auditmysite --sitemap <url>: audit sitemap URLsauditmysite --url-file <file>: audit URLs from fileauditmysite <url> --crawl: discover same-domain pages from a seed URL and audit them as a batchauditmysite browser detect: show available browsersauditmysite browser install [--headless-shell]: download and install Chrome for Testing or the headless shell into~/.auditmysite/browsers/(opt-in, never automatic; used only when no system browser is found)auditmysite doctor: run local diagnostics
Useful flags:
--prefer-sitemap: if a sitemap is detected for a base URL, switch directly into batch mode--crawl-depth <n>: limit same-domain crawl discovery depth when using--crawl--per-page-reports: scan a URL list or sitemap but write one individual report per URL instead of an aggregated batch report;-ois treated as a target directory. With-f json,index.jsonandfindings.jsonlare written next to the page files (see Technician mode)--modules <list>: choose the modules that run next to the accessibility checks, comma-separated:performance(aliasperf),seo,security,mobile,html-conform,stack, ora11yfor the WCAG rules only. Without--modules(or with the no-op--full) every module runs.--modulesand--fullexclude each other.--experimental <list>: switch on experimental indicators, comma-separated:ux,journey,ai-visibility,content-visibility,source-quality,commerce. Unvalidated heuristics that feed no score; off by default and in no--fullrun. They appear in the JSON underexperimentaland in the table, never in the PDF. See Experimental indicators--reuse-cache: answer a single-URL run from the stored snapshot of an earlier run with the same configuration; without it every run measures afresh--include-path <glob>/--exclude-path <glob>: select batch URLs by path before--max-pages(repeatable)--screen-reader-report: also write the<output>-screen-reader-audit.jsonsidecar (off by default)--lang <en|de>: set the language of the PDF report and the terminal table (default:en)- Tech stack detection (
--modules stack, part of the default set) reads in-page signals only; it sends no requests of its own to the audited host --interactive <off|basic|full>: control the Accessibility Journey Layer for interactive checks — tab walk, skip-link, modal focus trap, SPA navigation, form-error announcement, link-text inventory (default:full; useofffor fastest runs). Clicking submit buttons, add-to-cart triggers and quantity steppers is an opt-in:--allow-state-changes(withfull)--annex <en301549|bik>: add an opt-in appendix to the PDF report.en301549maps findings to EN 301 549 (chapter 9, “Web”) clauses — a technical building block for a human-authored accessibility statement, not a statement itself.bikregroups the same findings by the chapters of the “BIK für Alle” editorial guide (images/alt text, link text, structure, easy language, PDFs, videos), without adding new checks. The underlying JSON data (en301549_annex,bik_guide) is always present regardless of this flag; it only gates the PDF section.--privacy-check: opt-in (not part of--full), pre-consent privacy findings of one first visit in a clean browser context (requests, cookies, storage keys classified by provider; technical findings with a confidence class, no legal verdict, no score); one extra page load per audited page, see privacy findings--isolate-third-party-impact: reload the page once per top-5 third-party origin with that origin blocked and report each origin’s Total Blocking Time impact; costly, requires theperformancemodule (the default set or--modules performance), single-URL mode only--check-ssr-content: reload the page with JavaScript disabled and flag an SSR/hydration content gap when essential content only appears client-side; one extra reload, requires theseomodule (the default set or--modules seo), single-URL mode only--display <calm|text|visual|all>: audit one display mode of thedata-displayconvention — see Display modes--exclude-selector <CSS>(repeatable): drop findings inside the subtree a CSS selector matches — for markup that is broken on purpose, such as teaching specimens (see Excluding intentional specimens)--annotations <file.json>: show external assessments of findings next to them in the report, without changing any result, see Annotations--write-baseline <file>/--baseline <file>: record the finding ids of a run, then gate later runs so that only new findings affect the exit code (known findings are markedknownand counted; scores and the finding list stay unchanged; per URL in a batch). A malformed baseline, or one written under another finding id scheme, exits 3. Format, scoping and the id stability it relies on: Findings baseline--color <auto|always|never>/--progress <auto|always|never>: terminal color and batch progress policy;--progressis independent of--quiet
For the full current interface, use:
auditmysite --help
auditmysite browser --help
Runtime per page
A default run (auditmysite <url>) is the full analysis set: accessibility on desktop and mobile, performance with throttled passes, SEO, security, mobile checks and the interactive journeys. Wall-clock time per page depends mostly on how many of these passes run and on the page itself.
Measured on 2026-11-08 with auditmysite 2.0.2 (release build), full Google Chrome 157 on macOS, Apple M4 Pro (14 cores), one run per cell, live sites over a home connection, the eight sites of the reference set (gov.uk, gov.ie, casoon.de, mit.edu, bundesregierung.de, dm.de, berlin.de, basf.com). Single-page figures include the process and browser start.
| Mode (single page) | Flags | Range over 8 sites | Median |
|---|---|---|---|
| Default | none (same as --full) |
14.8 – 54.1 s | 28.0 s |
| Without journeys | --interactive off |
11.5 – 32.9 s | 17.8 s |
| WCAG rules only | --interactive off --modules a11y |
2.5 – 8.9 s | 7.0 s |
--modules a11y switches off every other module (performance, mobile, SEO, security, HTML conformance, tech stack), so the last row is the accessibility tree and the WCAG rules without the rest. Heavy, script-driven pages cost more: bundesregierung.de (54.1 s) and dm.de (53.6 s) were the slowest in the default mode; gov.uk (14.8 s) the fastest.
Batch runs share one browser, so the start-up cost is paid once. Same six URLs (gov.uk, gov.ie, casoon.de, mit.edu, bundesregierung.de, berlin.de) as a --url-file, -f json, default modules:
| Run | Flags | Total | Per page |
|---|---|---|---|
| Sequential | -c 1 |
99.4 s | 16.6 s |
| Default concurrency | none | 90.1 s | 15.0 s |
| Three tabs | -c 3 |
47.0 s | 7.8 s |
| Six tabs | -c 6 |
33.9 s | 5.7 s |
| Three tabs, no journeys | -c 3 --interactive off |
26.6 s | 4.4 s |
| First three URLs | -c 3 -m 3 |
24.4 s | 8.1 s |
All six pages were audited in every run. Concurrency does not scale linearly: three tabs were 2.1 times and six tabs 2.9 times faster than one. Divide the sequential per-page time by that factor, not by the tab count, to size a sitemap run. Timings vary from run to run and with load on the machine and the sites; treat them as an order of magnitude, not a promise.
How the batch flags interact
-c, --concurrency <1-10>: browser tabs audited at the same time. Default 3, except on macOS with a full Chrome while journeys are on: there the default is 1 (theDefault concurrencyrow above), because parallel keyboard journeys can stall that browser (see Browser setup). An explicit-calways wins.0and values above 10 are rejected.-t, --timeout <secs>: page load timeout, default 30. It bounds one page, not the run. A page waiting for a free tab waits up to four times--timeout(two minutes at least); a page that still gets none is retried one at a time after the parallel phase.--stability-budget-ms <ms>: wait for late hydration after navigation, default 1500; the same budget again bounds the wait for finite CSS animations. Paid on every page, so it scales with the page count, not with concurrency.-m, --max-pages <n>: caps the number of audited URLs (0 = unlimited).--include-pathand--exclude-pathare applied first;--sample-strategy first-n|stratifieddecides which N are kept. This is the main lever on total time, since total time is roughly the page count times the per-page time divided by the concurrency speed-up.--interactive off,--modules: reduce the work per page and apply to every page of the batch.- Single-URL only, not run in batch mode:
--perf-runs,--isolate-third-party-impact,--check-ssr-content.--privacy-checkadds one page load per audited page in either mode.--crawladds link-check requests on top of the page audits.
SARIF output
-f sarif writes a SARIF 2.1.0 log for SARIF consumers such as GitHub Code Scanning. It works for single pages and for batch inputs (sitemap, URL file, crawl); a batch produces one run with the findings of all audited pages.
auditmysite https://example.com -f sarif -o auditmysite.sarif --quiet
auditmysite --sitemap https://example.com/sitemap.xml -f sarif -o auditmysite.sarif --quiet
What the file contains:
tool.drivercarries the name,informationUriand the tool version;ruleshas one entry per distinct rule ID, merged across pages, withshortDescription,fullDescription,help,defaultConfiguration.levelandproperties.precision(from the finding’s confidence).helpUriis the rule’s page on the project site (https://casoon.github.io/auditmysite/rules/<page_id>/) for every WCAG rule and for the security header, vulnerable library and structured-data (missing required properties) rules; other rules have none.properties.wcagCriterionis present for WCAG rules;properties.tagsholds the category and dimension.- Every finding of the report becomes a result, not only WCAG findings: SEO, security, UX, journey and the other modules are included, each under its own rule ID (for example
contrast/text-insufficient,seo.meta.description). One result is written per occurrence. levelfollows the severity: critical and high areerror, medium iswarning, low isnote. A finding that only asks for a manual review (properties.outcome: "review") is capped atnote: it is never presented as a confirmed defect.- Checks that did not run are not results and never count as passed. Disabled rules, rules without the data they need, rules that errored, and modules that failed, ran partially or were skipped are listed in
invocations[0].toolExecutionNotifications(levelnote,warningorerror, withassociatedRuleand the page URL). A rule that has nothing to check on a page (“not applicable”) is not listed.executionSuccessfulisfalsewhen a notification has levelerror.
Locations
An audited page is a URL, not a file in a repository, and auditmysite findings carry no source line or column (the browser reports elements by selector). So the writer does not write a region: a made-up line number would point nowhere.
physicalLocation.artifactLocation.uriis a relative pseudo-path built from the page URL:audited-pages/<host>/<path>. An empty path or a path ending in/becomesindex, a port is appended to the host with-, and a query string becomes the suffix__q-<8 hex digits>of its SHA-256 (https://example.com/shop/?q=1isaudited-pages/example.com/shop/index__q-<hash>). A relative path is used on purpose: GitHub resolves absolute URIs against the checkout’sfile://root and rejects roots with a different scheme, so anhttps://URI would put the whole upload at risk.- The real URL stays available in
run.artifacts[].description(“Audited page …”), inproperties.pageUrlof each result and notification, and in the fingerprint. - The element is a
logicalLocationsentry (kind: element,namethe CSS selector,fullyQualifiedName"<page URL> <selector>") and is appended to the message text (... (selector: input#es-search-form-input)). run.properties.locationStrategyispage-pseudo-path.
The pseudo-path matches no committed file, so GitHub lists an alert without a code view. To tie alerts to the repository file that produces a page (a static site, for instance), no mapping option exists yet.
Fingerprints
Every result carries partialFingerprints, stable across runs, so the same defect on the same page is the same alert on the next upload:
hash = SHA-256(rule_id NUL page_url NUL kind NUL value), first 32 hex digits
value = the CSS selector if the occurrence has one (kind "selector"),
else the message with whitespace collapsed (kind "message")
auditmysite/v1 = "<hash>:<n>"
primaryLocationLineHash = "<hash>:<n>" (the only key GitHub reads)
page_url is the audited URL without fragment. The selector wins over the message because messages carry measured values (a contrast ratio) that change when the page is only edited. n counts results with an identical hash within one run, in report order. A changed selector (the element moved in the DOM) is a new alert; that is the price of having no source line to anchor on.
{
"ruleId": "contrast/text-insufficient",
"ruleIndex": 0,
"level": "error",
"message": {
"text": "The text reaches a contrast ratio of 3.04:1; 4.5:1 is required for normal text. (selector: span.site-nav__arrow)"
},
"locations": [
{
"physicalLocation": { "artifactLocation": { "uri": "audited-pages/www.mit.edu/index", "index": 0 } },
"logicalLocations": [
{ "name": "span.site-nav__arrow", "fullyQualifiedName": "https://www.mit.edu/ span.site-nav__arrow", "kind": "element" }
]
}
],
"partialFingerprints": {
"auditmysite/v1": "0f5c...:1",
"primaryLocationLineHash": "0f5c...:1"
},
"properties": { "pageUrl": "https://www.mit.edu/", "outcome": "fail", "severity": "high", "selector": "span.site-nav__arrow" }
}
(One result, shortened.) The process exit code still encodes the verdict (0 pass, 1 warn, 2 fail). In CI, add --report-mode so the step succeeds whenever the file was written and a following upload step runs; gate the build separately if needed. The default *-screen-reader-audit.json sidecar is written next to -o for SARIF as well; --no-screen-reader-report skips it.
GitHub accepts at most 25,000 results per run (the 5,000 highest by severity are kept) and 10 MB gzipped per file; a large sitemap audit can exceed that, so scope it with --max-pages.
GitHub Code Scanning
name: Accessibility
on:
workflow_dispatch:
jobs:
audit:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Install auditmysite
run: curl -fsSL https://raw.githubusercontent.com/casoon/auditmysite/main/install.sh | bash
- name: Audit
run: auditmysite https://staging.example.com -f sarif -o auditmysite.sarif --quiet --report-mode
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
with:
sarif_file: auditmysite.sarif
category: auditmysite
Status: the SARIF structure, the fingerprints and the not-run handling are covered by tests (tests/sarif_contract.rs, including a golden file), and the output has been validated against the official SARIF 2.1.0 JSON schema (opt-in test, command below). The workflow is a template and was not run on GitHub: whether GitHub shows results with a pseudo-path that matches no file, and as which alerts, has not been verified. Check the first upload in the repository’s Security tab before relying on it. The SARIF file can also be kept as a workflow artifact.
Schema check: download sarif-2.1/schema/sarif-schema-2.1.0.json from oasis-tcs/sarif-spec (OASIS licence terms, so it is not vendored here) and run AUDITMYSITE_SARIF_SCHEMA=<file> cargo test --test sarif_contract -- --ignored.
Annotations
--annotations <file.json> reads assessments that a person or an agent made after the rules ran (whether an alt text really says nothing, what a reading-flow pass noticed) and shows them next to the findings they belong to. The file format is defined once, in barrierlab: annotation file with its JSON Schema (schema 1; unknown fields are ignored). auditmysite reads it and stores nothing between runs.
auditmysite https://example.com --annotations annotations.json -f pdf
auditmysite --sitemap https://example.com/sitemap.xml --annotations annotations.json -f json -o batch.json
What an annotation does not do: it never changes an outcome, severity, score, legal_flags, risk level, verdict, exit code or --fail-on result. assessment is likely_issue, likely_fine or undetermined; none of them turns a review finding into a failure or a pass. Without the option every output is byte-identical to a run that never heard of annotations.
Matching:
finding_id(F-…) matchespages[].findings[].id;pattern_id(RC-…) narrows it to onefindings[].patterns[].id. The ids depend on the rule and the normalised element pattern, so when an element changes, an old annotation becomes unmatched instead of attaching to something else.- In a batch run an annotation with
urlapplies to that page only, one withouturlto every page that has the finding. URLs compare equal up to a trailing slash. - Scope
reading_flowattaches to the page’s screen-reader audit section. In a run of several pages it needsurl. - An annotation that matches nothing is listed as unmatched with a reason (
finding_not_found,pattern_not_found,url_not_audited,url_required,no_reading_flow), never dropped.
Where it shows:
- JSON (
-f json, also the JSON written next to a PDF): a top-levelannotationsblock withcounts,matched(each with theurlandfinding_idit attached to) andunmatched;warningslists evidence screenshots that were not found next to the file. The block is part of both JSON schemas; the findings themselves are untouched. - PDF: below each annotated finding as a callout titled “Assessment (agent)” or “Assessment (reviewer)” (German: “Einschätzung (Agent)” / “Einschätzung (Reviewer)”) followed by the value, the reasoning, the author and the evidence. The screen-reader section shows the
reading_flowones. A short “Assessments” section gives the counts per author kind and lists the unmatched. The batch PDF aggregates findings across pages, so there the section lists every matched assessment per page instead of marking individual findings; the executive level, which has no finding cards, does the same. -f ai: tasks of an annotated finding carryfinding_idandannotations; withpattern_idonly the tasks of that element pattern do. Annotations that sit on no task (reading flow, findings that are not WCAG tasks, unmatched) are in a top-levelannotationsobject.- table, SARIF, summary: unchanged; the option prints a warning there instead of being ignored silently. With
--per-page-reportseach page file gets the matches of its page and the annotations that matched no page of the run.
The file is validated when the arguments are parsed, before any page is loaded: an unreadable file, invalid JSON or a violation of the schema (a missing finding_id for scope finding, an assessment of fail, an empty reasoning, an unknown author.kind) stops the run with a message naming the annotation and exit code 2, like any other invalid argument. A missing evidence file is only a warning.
Output Contract
JSON output is treated as an automation contract.
- Contract documentation: docs/OUTPUT_CONTRACT.md
- Single report schema: docs/json-report.schema.json
- Batch report schema: docs/json-batch-report.schema.json
Key fields in a single-page report:
pages[].baseline,pages[].findings[].known,decision.profile.baseline_digest(batch: also top-levelbaseline) — present only with--baseline: known, new and fixed findings against a baseline file. Finding ids are stable per rule and page: what changes an id and what must not is in Finding id stabilitymetric_context— machine-readable definitions for the 0–100 score scale and the report’s scoped count fieldsfindings— static WCAG violations and SEO findingsinteractive_findings— journey-phase results (link texts, landmarks, heading outline, focus order, modal traps …); present when--interactive basic|fullwas usedaccessibility_journey— structured trace of each journey (steps, snapshots, durations); present when--interactive basic|fullwas usedaudit_scopeandexecution_environment— requested modules, viewports, throttle profiles, interaction mode, browser context, and live/cache provenanceaudit_qualitypluspages[].detail.module_runsandpages[].detail.rule_outcomes— distinguish complete, partial, failed, skipped, and non-applicable checks so a measurement failure cannot look like a clean resultpages[].detail.accessibility_assessments— structured warnings, manual-review items, and positive signals kept separate from confirmed violations and scoringannotations— external assessments read from--annotations; present only with that option, see Annotationsartifacts— descriptors for separately written evidence or screen-reader sidecars without embedding binary data in the main JSONbuild_id— git short-SHA of the binary that produced the report (suffixed-dirtyfor builds from uncommitted changes,unknownfor builds without a.gitdirectory), so two reports with the sametool_versioncan be told apartpages[].detail.en301549_annexandpages[].detail.bik_guide— findings mapped to EN 301 549 clauses and to the “BIK für Alle” editorial guide chapters; always present, independent of--annexpages[].detail.accessibility_subcategory_scoresandpages[].detail.security_category_scores— the Accessibility and Security scores broken down by subcategory ({ name, score }), the same breakdown the PDF shows; single reports only
Rule IDs are stable across releases. Version 1.3.0 renamed two IDs that collided with unrelated checks: the 4.1.2 control-label check is now control-missing-label (was label, which stays with the 3.3.2 label/instructions checks), and the 2.4.9 link-purpose (link only) check is now link-name-only (was link-name, which stays with the 2.4.4 check).
For dual-viewport audits, the Accessibility score is the rounded blend of 70% mobile and 30% desktop in both JSON and PDF. WCAG occurrences, distinct grouped WCAG findings, and findings from all categories are exposed separately so counts remain comparable across formats.
Batch JSON additionally exposes site_analysis: module averages, consistency signals, page types, topic overlap, duplicate content, structured-data distribution, performance rollups, interactive coverage, and aggregated accessibility assessments. Per-page entries remain compact instead of duplicating full single-page reports.
The repository validates these contracts in automated tests.