Command line tool (CLI)
Check a website for accessibility issues from your terminal or CI with npx accessibilitybrief: WCAG 2.2 scans, build gates on severity or score, JSON output and a GitHub Action. Pro and Agency plans.
The accessibilitybrief command line tool starts an accessibility scan of a site in your workspace, waits for the result and prints it. In a CI pipeline it can fail the build when serious issues appear or the score drops, so accessibility regressions are caught before they reach production.
Scans run on AccessibilityBrief's servers, the same as scans started in the app: WCAG 2.2 A and AA, at desktop and phone size. Nothing is installed on your site. The full report, with the exact fix for each issue, is in your account.
Requirements
- Node.js 18.17 or newer.
- A Pro or Agency plan.
- An API key with the
readandscanscopes from Settings → API and integrations. - The site must already be added to your workspace. Each scan uses one manual scan of your plan.
Run a scan
No installation is needed: npx downloads the accessibilitybrief package from npm and runs it.
export ACCESSIBILITYBRIEF_API_KEY=ab_live_…
npx accessibilitybrief scan https://example.com --fail-on seriousScanning example.com …
Score 97 out of 100 (automated). 1 page scanned.
Critical 0, serious 0, moderate 1, minor 0
Issues, worst first:
moderate Links with vague text (1 element, 1 page)To install it once instead: npm install -g accessibilitybrief, then run accessibilitybrief scan ….
Commands
| Command | What it does |
|---|---|
| accessibilitybrief scan <url or site id> | Start a scan, wait for it and print the result. |
| accessibilitybrief sites | List the sites in your workspace. |
| accessibilitybrief mcp | Run the MCP server for AI coding agents. |
| accessibilitybrief --version | Print the version. |
Options
| Option | What it does |
|---|---|
| --fail-on critical|serious|moderate|minor | Exit with code 1 if an issue is at least this severe. Best practices and issues marked won't fix or false positive do not count. |
| --min-score 0-100 | Exit with code 1 if the automated score is lower. |
| --no-wait | Start the scan and print its id. |
| --json | Machine-readable output. |
| --locale en|de | Language of issue titles. |
| --timeout <minutes> | How long to wait for the result (default 20). |
Exit codes: 0 passed, 1 a check failed, 2 an error such as a wrong key or an unknown site.
In GitHub Actions
Use the AccessibilityBrief GitHub Action. Store the key as a repository secret named ACCESSIBILITYBRIEF_API_KEY.
- name: Accessibility scan
uses: accessibilitybrief/scan-action@v1
with:
url: https://staging.example.com
api-key: ${{ secrets.ACCESSIBILITYBRIEF_API_KEY }}
fail-on: seriousInputs: url, api-key, fail-on, min-score, locale and timeout, the same as the command's options. The result is written to the job summary and the step fails when a check fails.
In other CI systems
- name: Accessibility scan
run: npx accessibilitybrief@1 scan https://staging.example.com --fail-on serious
env:
ACCESSIBILITYBRIEF_API_KEY: ${{ secrets.ACCESSIBILITYBRIEF_API_KEY }}Set the environment variable and run the command. This works in GitLab CI, Bitbucket Pipelines, CircleCI and any runner with Node.js 18.17 or newer.
For AI coding agents
The same package runs the MCP server, so AI coding agents such as Claude Code and Cursor can read your scans, fetch fix prompts and start a rescan.
Still stuck? Write to us and we will help. Contact support