Skip to content

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.

bash
vpx automatica11y audit ./dist
bash
pnpm dlx automatica11y audit ./dist
bash
bunx automatica11y audit ./dist
bash
npx -y automatica11y audit ./dist
bash
deno run npm:automatica11y audit ./dist
bash
yarn dlx automatica11y audit ./dist

Installation ​

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:

bash
npm i -g automatica11y;
a11y audit ./dist

Commands ​

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.

bash
vpx automatica11y audit ./path/to/file.html
bash
pnpm dlx automatica11y audit ./path/to/file.html
bash
bunx automatica11y audit ./path/to/file.html
bash
npx -y automatica11y audit ./path/to/file.html
bash
deno run npm:automatica11y audit ./path/to/file.html
bash
yarn dlx automatica11y audit ./path/to/file.html

You 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.

bash
vpx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttons
bash
pnpm dlx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttons
bash
bunx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttons
bash
npx -y automatica11y compare npm:react-aria-components npm:@instructure/ui-buttons
bash
deno run automatica11y compare npm:react-aria-components npm:@instructure/ui-buttons
bash
yarn dlx automatica11y compare npm:react-aria-components npm:@instructure/ui-buttons

doctor ​

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.

bash
vpx automatica11y doctor
bash
pnpm dlx automatica11y doctor
bash
bunx automatica11y doctor
bash
npx -y automatica11y doctor
bash
deno run automatica11y doctor
bash
yarn dlx automatica11y doctor

Each run writes report.md, results.json, and plan.json to ./a11y-report by default. Read a report to understand the results.

Released under the MIT License