{"id":15647307,"url":"https://github.com/sinedied/a11y-ai","last_synced_at":"2025-04-09T07:10:06.226Z","repository":{"id":78615930,"uuid":"605736388","full_name":"sinedied/a11y-ai","owner":"sinedied","description":"Experimental tool to automatically detect accessibility issues in web pages and provide suggestions for fixing them","archived":false,"fork":false,"pushed_at":"2024-10-16T07:08:02.000Z","size":385,"stargazers_count":51,"open_issues_count":4,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T12:04:45.409Z","etag":null,"topics":["accessibility","ai","cli","fix","openai"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinedied.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-23T19:45:06.000Z","updated_at":"2025-04-01T14:51:08.000Z","dependencies_parsed_at":"2024-10-03T12:18:41.359Z","dependency_job_id":"e0d23d2a-8853-4c87-acdd-0f3aaea722ed","html_url":"https://github.com/sinedied/a11y-ai","commit_stats":{"total_commits":111,"total_committers":3,"mean_commits":37.0,"dds":"0.19819819819819817","last_synced_commit":"2c6453e1abedeaa47a37c89e7b623b4a5f672232"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fa11y-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fa11y-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fa11y-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fa11y-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinedied","download_url":"https://codeload.github.com/sinedied/a11y-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994122,"owners_count":21030050,"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":["accessibility","ai","cli","fix","openai"],"created_at":"2024-10-03T12:18:22.150Z","updated_at":"2025-04-09T07:10:06.202Z","avatar_url":"https://github.com/sinedied.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :robot: a11y-ai\n\n[![NPM version](https://img.shields.io/npm/v/a11y-ai.svg)](https://www.npmjs.com/package/a11y-ai)\n[![Build Status](https://github.com/sinedied/a11y-ai/workflows/build/badge.svg)](https://github.com/sinedied/a11y-ai/actions)\n![Node version](https://img.shields.io/node/v/a11y-ai.svg)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n\u003e Experimental tool to automatically detect accessibility issues in web pages using OpenAI and provide suggestions for fixing them.\n\n![a11y-ai portrait by another AI](https://user-images.githubusercontent.com/593151/221144683-af658535-500b-4024-afe9-032526b3eec9.png)\n\n*Can I help fixing your a11y issues?*\n\n## Installation\n\nTo use this tool you need [Node.js 16.4+](https://nodejs.org/). We recommended to install Node.js using [NVM](https://github.com/nvm-sh/nvm) (Mac OS, Linux or WSL) or [nvm-windows](https://github.com/coreybutler/nvm-windows) (Windows) to avoid issues.\n\n```bash\nnpm install -g a11y-ai\n```\n\n## Usage\n\n```\nUsage: a11y \u003ccommand\u003e \u003cfiles\u003e [options]\n\nIf no files are specified, it will scan the current directory and\nsubdirectories for HTML files.\n\nCommands:\n  s, scan                     Scan files or URLs for accessibility issues\n    -o, --format \u003cformat\u003e     Report format [text, json] (default: text)\n    \n  f, fix                      Fix accessibility issues interactively\n    -i, --issues \u003cissues\u003e     Comma-separated list of issues to fix (disable scan)\n    -s, --chunk-size \u003ctokens\u003e Set input chunk size (default: 1000)\n    -c, --char-diff           Use character diff instead of patch-like diff\n    -y, --yes                 Apply fixes without prompting\n    --context \u003ccontext\u003e       Provide additional context\n    --gpt-diff                Make AI generate diff of fixes (experimental)\n\n  r, report                   Generate a report of issues with fix suggestions\n    -i, --issues \u003cissues\u003e     Comma-separated list of issues to fix (disable scan)\n    -s, --chunk-size \u003ctokens\u003e Set input chunk size (default: 1000)\n    -o, --format \u003cformat\u003e     Report format [html, md] (default: html)\n    --context \u003ccontext\u003e       Provide additional context\n    --gpt-diff                Make AI generate diff of fixes (experimental)\n\nGeneral options:\n  --api                   Use specified API URL\n  --verbose               Show detailed logs\n  --help                  Show this help\n```\n\nYou can also set the API URL using the `A11Y_AI_API` environment variable.\n\n### Examples\n\n- Interactively scan \u0026 fix a local file:\n\n  ```bash\n  a11y fix site.html\n  ```\n\n- Generate a report of issues with fix suggestions for multiple URLs:\n\n  ```bash\n  a11y report https://microsoft.com https://docs.microsoft.com\n  ```\n\n- Interactively fix specific issues with additional context in a React component:\n  ```bash\n  a11y fix component.jsx \\\n    --issues \"Add missing images alt attributes\" \\\n    --context \"This is a documentation where screenshots shows the different step to setup GitHub Copilot on your account\" \n  ```\n\n- Automagicically scan for all HTML files in the current directory and subdirectories, interactively fix the issues:\n\n  ```bash\n  a11y\n  ```\n\n### Notes\n\nThe interactive `fix` command works best when used on small local files, HTML or components.\nFor larger files or URLs, it is recommended to use the `report` command to generate a report of issues with fix suggestions.\n\nAs the tool is still experimental and its UI feedback limited at the moment, it is recommended to use the `--verbose` option to get more detailed logs of what's happening.\n\n### Accessibility issues scanning \n\nAccessibility issues scan is done using [Playwright](https://playwright.dev/) with the [axe-playwright](https://www.npmjs.com/package/axe-playwright) plugin.\n\n\u003c!-- ## Automated reports\n\nYou can generate a report of all the issues found in your project automatically on your CI/CD using this GitHub Action: [sinedied/a11y-ai-action](https://github.com/sinedied/a11y-ai-action)\n\nYou can see a complete [example workflow](https://github.com/sinedied/a11y-ai/blob/main/.github/workflows/action.yml) in action on this repository. --\u003e\n\n## Troubleshooting\n\nIf you get an error like this:\n\n```\nCould not scan issues for 'index.html': Error while running axe scan: Command failed: npx playwright test --config \"/usr/local/lib/node_modules/a11y-ai/scan/playwright.config.cjs\"\n```\n\nIt may mean that the Playwright browsers were not installed correctly during the package installation. You can fix that by running this command (you can ignore the warning message it will print)):\n\n```bash\nnpx -y playwright install chromium\n```\n\n## Known limitations\n\n- Issue scanning is only supported for HTML files, not for JS/TS components (but fixing is supported)\n- `--gpt-diff` options is experimental and may not work well in some cases, as the patch may fail to be applied at the right places\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinedied%2Fa11y-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinedied%2Fa11y-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinedied%2Fa11y-ai/lists"}