{"id":13398057,"url":"https://github.com/dequelabs/axe-cli","last_synced_at":"2025-03-14T00:32:56.555Z","repository":{"id":54378897,"uuid":"70516701","full_name":"dequelabs/axe-cli","owner":"dequelabs","description":"[Deprecated] A command-line interface for the aXe accessibility testing engine","archived":true,"fork":false,"pushed_at":"2021-02-22T10:51:32.000Z","size":611,"stargazers_count":431,"open_issues_count":11,"forks_count":44,"subscribers_count":18,"default_branch":"develop","last_synced_at":"2024-07-31T18:24:50.229Z","etag":null,"topics":["axe-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dequelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2016-10-10T18:27:20.000Z","updated_at":"2024-07-24T16:29:49.000Z","dependencies_parsed_at":"2022-08-13T13:50:53.455Z","dependency_job_id":null,"html_url":"https://github.com/dequelabs/axe-cli","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Faxe-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Faxe-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Faxe-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Faxe-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dequelabs","download_url":"https://codeload.github.com/dequelabs/axe-cli/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243505203,"owners_count":20301572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axe-cli"],"created_at":"2024-07-30T18:02:04.376Z","updated_at":"2025-03-14T00:32:56.083Z","avatar_url":"https://github.com/dequelabs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Accessibility"],"sub_categories":[],"readme":"# [DEPRECATED] axe-cli\n\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n\u003e This repository has been deprecated. The package has been moved to [axe-core-npm](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli). The package will be available via NPM as [`@axe-core/cli`](https://www.npmjs.com/package/@axe-core/cli).\n\n---\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/dequelabs/axe-cli.svg)](https://greenkeeper.io/)\n\n[![Join the chat at https://gitter.im/dequelabs/axe-core](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dequelabs/axe-core?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Version](https://img.shields.io/npm/v/axe-cli.svg)](https://www.npmjs.com/package/axe-cli)\n[![License](https://img.shields.io/npm/l/axe-cli.svg)](LICENSE)\n\nProvides a command line interface for [aXe](https://github.com/dequelabs/axe-core) to run quick accessibility tests.\n\n## Getting Started\n\nInstall [Node.js](https://docs.npmjs.com/getting-started/installing-node) if you haven't already. This project requires Node 6+. By default, axe-cli runs Chrome in headless mode, which requires Chrome 59 or up.\n\nInstall axe-cli globally: `npm install axe-cli -g`\n\nLastly, install the webdrivers of the browsers you wish to use. A webdriver is a driver for your web browsers. It allows other programs on your machine to open a browser and operate it. Current information about available webdrivers can be found at [selenium-webdriver project](https://www.npmjs.com/package/selenium-webdriver). Alternatively, you could use [Webdriver manager](https://www.npmjs.com/package/webdriver-manager)\n\n## Usage\n\nAfter installing, you can now run the `axe` command in your CLI, followed by the URL of the page you wish to test:\n\n```\naxe https://www.deque.com\n```\n\nYou can run multiple pages at once, simply add more URLs to the command. Keep in mind that axe-cli is not a crawler, so if you find yourself testing dozens of pages at once, you may want to consider switching over to something like [axe-webdriverjs](https://www.npmjs.com/package/axe-webdriverjs). If you do not specify the protocol, http will be used by default:\n\n```\naxe www.deque.com, dequeuniversity.com\n```\n\n**Note:** If you are having difficulty with the color scheme, use `--no-color` to disable text styles.\n\n## Running specific rules\n\nYou can use the `--rules` flag to set which rules you wish to run, or you can use `--tags` to tell axe to run all rules that have that specific tag. For example:\n\n```\naxe www.deque.com --rules color-contrast,html-has-lang\n```\n\nOr, to run all wcag2a rules:\n\n```\naxe www.deque.com --tags wcag2a\n```\n\nIn case you want to disable some rules, you can use `--disable` followed by a list of rules. These will be skipped when analyzing the site:\n\n```\naxe www.deque.com --disable color-contrast\n```\n\nThis option can be combined with either `--tags` or `--rules`.\n\nA list of rules and what tags they have is available at: https://dequeuniversity.com/rules/worldspace/3.0/.\n\n## Saving the results\n\nResults can be saved as JSON data, using the `--save` and `--dir` flags. By passing a filename to `--save` you indicate how the file should be called. If no filename is passed, a default will be used. For example:\n\n```\naxe www.deque.com --save deque-site.json\n```\n\nOr:\n\n```\naxe www.deque.com --dir ./axe-results/\n```\n\n## Sending results to STDOUT\n\nTo output the test results to STDOUT, provide the `--stdout` flag. This flag has the side-effect of silencing all other logs/output (other than errors, which are written to STDERR).\n\nTo print the entire result object to your terminal, do:\n\n```\naxe --stdout www.deque.com\n```\n\nTo pipe the results to a file, do:\n\n```\naxe --stdout www.deque.com \u003e your_file.json\n```\n\nTo pipe the results to a JSON-parsing program for further processing, do:\n\n```\naxe --stdout www.deque.com | jq \".[0].violations\"\n```\n\n## Defining the scope of a test\n\nIf you want to only test a specific area of a page, or wish to exclude some part of a page you can do so using the `--include` and `--exclude` flags and pass it a CSS selector:\n\n```\naxe www.deque.com --include \"#main\" --exclude \"#aside\"\n```\n\nYou may pass multiple selectors with a comma-delimited string. For example:\n\n```\naxe www.deque.com --include \"#div1,#div2,#div3\"\n```\n\n## Custom axe-core versions\n\nAxe-cli will look for locally available versions of axe-core. If the directory from where you start axe-cli has an `axe.js` file, or has a `node_modules` directory with axe-core installed in it. Axe-cli will use this version of axe-core instead of the default version installed globally.\n\nTo specify the exact file axe-core file axe-cli should use, you can use the `--axe-source` flag (`-a` for short), with a relative or absolute path to the file.\n\n```\naxe www.deque.com --axe-source ./axe.nl.js\n```\n\n## Different browsers\n\nAxe-cli can run in a variety of web browsers. By default axe-cli uses Chrome in headless mode. But axe-cli is equally capable of testing pages using other web browsers. **Running in another browser requires that browser's webdriver to be available on your PATH**. You can find a list of available webdrivers and how to install them at: https://seleniumhq.github.io/docs/wd.html\n\nTo run axe-cli using another browser, pass it in as the `--browser` option:\n\n```\naxe www.deque.com --browser chrome\n```\n\nOr for short:\n\n```\naxe www.deque.com -b c\n```\n\n## Custom Chrome Flags\n\nWhen using the Headless Chrome browser, you may provide any number of [flags to configure how the browser functions](https://peter.sh/experiments/chromium-command-line-switches/).\n\nOptions are passed by name, without their leading `--` prefix. For example, to provide the `--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage` flags to the Chrome binary, you'd do:\n\n```\naxe --chrome-options=\"no-sandbox,disable-setuid-sandbox,disable-dev-shm-usage\" www.deque.com\n```\n\n## CI integration\n\nAxe-cli can be ran within the CI tooling for your project. Many tools are automatically configured to halt/fail builds when a process exits with a code of `1`.\n\nUse the `--exit` flag, `-q` for short, to have the axe-cli process exit with a failure code `1` when any rule fails to pass.\n\n```\naxe www.deque.com --exit\n```\n\n## Timing and timeout\n\nFor debugging and managing timeouts, there are two options available. With `--timer` set, axe-cli will log how long it takes to load the page, and how long it takes to run axe-core. If you find the execution of axe-core takes too long, which can happen on very large pages, use `--timeout` to increase the time axe has to test that page:\n\n```\naxe www.cnn.com --timeout=120\n```\n\n## Delay audit to ensure page is loaded\n\nIf you find your page is not ready after axe has determined it has loaded, you can use `--load-delay` followed by a number in milliseconds. This will make axe wait that time before running the audit after the page has loaded.\n\n```\naxe www.deque.com --load-delay=2000\n```\n\n## Verbose output\n\nTo see additional information like test tool name, version and environment details, use the `--verbose` flag, `-v` for short.\n\n```\naxe www.deque.com --verbose\n```\n\n## ChromeDriver Path\n\nIf you need to test your page using an older version of Chrome, you can use `--chromedriver-path` followed by the absolute path to the desired version of the ChromeDriver executable.\n\n```\naxe www.deque.com --chromedriver-path=\"absolute/path/to/chromedriver\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdequelabs%2Faxe-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdequelabs%2Faxe-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdequelabs%2Faxe-cli/lists"}