CLI Quick Start
The automatica11y npm package provides everything needed to run from the command line.
Requirements
- Node 20 or newer
- Chrome or Chromium
Installation
You can install automatica11y and run it as a linked node.js binary, or you can invoke it with your package manager's script runner.
Invocation
The preferred method of running automatica11y is to use your package manager's script runner and directly invoke the script. This prevents drift and allows you to always use the latest version.
vpx automatica11y audit ./distpnpm dlx automatica11y audit ./distbunx automatica11y audit ./distnpx -y automatica11y audit ./distdeno run npm:automatica11y audit ./distyarn dlx automatica11y audit ./distInstallation
A global install doesn't update itself, so run npm i -g automatica11y@latest to upgrade and automatica11y --version to see what you have.
Install it once with npm i -g automatica11y; Make sure that automatica11y is on your $PATH, with the short name a11y too:
npm i -g automatica11y;
a11y audit ./distCommands
automatica11y includes three main commands: audit, compare, and doctor.
audit
The audit command takes an input which can be a static file or folder, a live website, an npm package, or a Storybook. audit knows how to install, build, and test npm packages that have a UI including: html, web components, React, Svelte, Vue, and Angular.
vpx automatica11y audit ./path/to/file.htmlpnpm dlx automatica11y audit ./path/to/file.htmlbunx automatica11y audit ./path/to/file.htmlnpx -y automatica11y audit ./path/to/file.htmldeno run npm:automatica11y audit ./path/to/file.htmlyarn dlx automatica11y audit ./path/to/file.htmlYou can also use check as an alias for audit. The audit will generate a plan.json, mappings.json, and when it's complete it will save results.json (machine readable) and report.md (human readable) in ./a11y-report.
compare
The compare command performs two or more audits and provides a comparative report. You can compare across multiple sources and frameworks.
vpx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttonspnpm dlx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttonsbunx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttonsnpx -y automatica11y compare npm:react-aria-components npm:@instructure/ui-buttonsdeno run automatica11y compare npm:react-aria-components npm:@instructure/ui-buttonsyarn dlx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttonsdoctor
doctor checks your setup to make sure your system meets the requirements. If it can't find a browser, it prints the command to install one.
vpx automatica11y doctorpnpm dlx automatica11y doctorbunx automatica11y doctornpx -y automatica11y doctordeno run automatica11y doctoryarn dlx automatica11y doctorEach run writes report.md, results.json, and plan.json to ./a11y-report by default. Read a report to understand the results.