Your accessibility co-pilot for the terminal. AI-powered CLI that scans frontend codebases for accessibility issues and auto-fixes them using GitHub Copilot CLI.
a11y-pilot is a CLI tool that works like ESLint for accessibility. Run it in any frontend project directory to:
- Scan your HTML, JSX, and TSX files for accessibility violations
- Report issues with file, line number, severity, and WCAG references
- Auto-fix issues by invoking GitHub Copilot CLI as the refactoring engine
It catches real problems that affect real users β missing alt text, non-semantic buttons, unlabeled form inputs, broken heading hierarchies, and more.
95%+ of websites fail basic accessibility checks (WebAIM Million Report). Most developers don't skip accessibility on purpose β they just don't have the tools that make it easy. a11y-pilot brings a11y linting right into your terminal workflow, and uses Copilot CLI to fix issues intelligently.
# Install globally
npm install -g a11y-pilot
# Or use directly with npx (no install needed)
npx a11y-pilot scan ./src# Scan your frontend project
a11y-pilot scan ./src
# Scan a specific file
a11y-pilot scan ./src/App.tsx
# Show Copilot CLI fix commands for each issue
a11y-pilot scan ./src --fix
# Auto-fix all issues using GitHub Copilot CLI
a11y-pilot fix ./src
# Or use the scan command with --auto-fix flag
a11y-pilot scan ./src --auto-fixNote: Auto-fix requires GitHub Copilot CLI to be installed and authenticated.
Scan files for accessibility issues.
a11y-pilot scan # Scan current directory
a11y-pilot scan ./src/components # Scan specific directory
a11y-pilot scan ./src/App.tsx # Scan a single fileFlags:
| Flag | Description |
|---|---|
-r, --rules <rules> |
Comma-separated rule IDs to check (e.g., img-alt,no-div-button) |
-f, --format <format> |
Output format: text (default) or json |
--fix |
Show Copilot CLI commands for each issue |
--auto-fix |
Invoke Copilot CLI to auto-fix issues |
--dry-run |
Preview what auto-fix would do (no changes) |
--one-by-one |
Fix issues individually instead of batching |
Convenience command β scans and auto-fixes in one step.
a11y-pilot fix ./src
a11y-pilot fix ./src --dry-runList all available accessibility rules.
a11y-pilot rulesa11y-pilot ships with 8 high-impact accessibility rules:
| Rule | Severity | WCAG | What it catches |
|---|---|---|---|
img-alt |
error | 1.1.1 | <img> without alt attribute |
button-content |
error | 4.1.2 | Empty <button> with no text/aria-label |
no-div-button |
error | 4.1.2, 2.1.1 | <div>/<span> with onClick but no role/tabIndex |
form-label |
error | 1.3.1, 4.1.2 | <input> without associated label or aria-label |
heading-order |
warning | 1.3.1 | Skipped heading levels (h1 β h3) |
anchor-content |
error | 2.4.4, 4.1.2 | <a> with no text content or aria-label |
no-autofocus |
warning | 3.2.1 | Usage of autoFocus attribute |
semantic-nav |
warning | 1.3.1, 2.4.1 | Navigation links not wrapped in <nav> |
a11y-pilot uses GitHub Copilot CLI as its AI-powered fix engine. When you run --auto-fix or a11y-pilot fix:
- Detection β a11y-pilot scans your code and identifies issues
- Prompt Engineering β For each issue, it builds a precise, context-rich prompt
- Copilot Invocation β It spawns
copilotCLI with the fix prompt - Intelligent Fixing β Copilot CLI reads your file, understands the context, and makes the fix
- Progress Reporting β You see real-time status of each fix
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β a11y-pilot ββββββΆβ Issue detected ββββββΆβ Build prompt β
β scanner β β (rule engine) β β (context-rich) β
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β File fixed! βββββββ Copilot applies βββββββ copilot CLI β
β β Report β β the fix β β invoked β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- Node.js 18+
- GitHub Copilot CLI installed and authenticated (required only for auto-fix)
# Install a11y-pilot
npm install -g a11y-pilot
# Install & authenticate Copilot CLI (for auto-fix)
# See: https://github.com/github/copilot-cli
copilot auth logina11y-pilot scan ./src --format jsonOutputs structured JSON:
{
"version": "1.0.0",
"timestamp": "2026-02-14T10:00:00.000Z",
"summary": {
"filesScanned": 23,
"filesWithIssues": 5,
"totalErrors": 12,
"totalWarnings": 3,
"totalIssues": 15
},
"files": {
"src/Hero.tsx": [
{
"ruleId": "img-alt",
"severity": "error",
"message": "<img> is missing the `alt` attribute",
"line": 12,
"fix": "Add alt=\"descriptive text\" or alt=\"\" if decorative",
"copilotCommand": "copilot \"In file src/Hero.tsx at line 12...\""
}
]
}
}| Extension | Parser |
|---|---|
.jsx |
Babel (JSX) |
.tsx |
Babel (TSX + TypeScript) |
.html, .htm |
htmlparser2 |
.vue |
htmlparser2 (template) |
.svelte |
htmlparser2 (template) |
.astro |
htmlparser2 (template) |
a11y-pilot/
βββ bin/
β βββ a11y-pilot.js # CLI entry point
βββ src/
β βββ cli.js # Commander setup & orchestration
β βββ scanner.js # File discovery & walking
β βββ parsers/
β β βββ jsx-parser.js # JSX/TSX AST parsing
β β βββ html-parser.js # HTML parsing
β βββ rules/
β β βββ index.js # Rule registry
β β βββ img-alt.js # Missing alt attributes
β β βββ button-content.js # Empty buttons
β β βββ no-div-button.js # Non-semantic click handlers
β β βββ form-label.js # Unlabeled form inputs
β β βββ heading-order.js # Heading hierarchy
β β βββ anchor-content.js # Empty links
β β βββ no-autofocus.js # autoFocus anti-pattern
β β βββ semantic-nav.js # Missing <nav> landmarks
β βββ reporter.js # Terminal output (colors/formatting)
β βββ copilot-bridge.js # Copilot CLI invocation engine
βββ test/
β βββ fixtures/ # Sample files with a11y issues
βββ docs/
β βββ PLAN.md # Project plan
βββ package.json
βββ LICENSE
βββ README.md
This entire project was built using GitHub Copilot CLI as a core development tool. Copilot CLI was used for:
- Scaffolding the project structure
- Writing parser logic for JSX/TSX AST traversal
- Implementing accessibility rules with WCAG references
- Debugging edge cases in HTML parsing
- Generating test fixtures
- Writing documentation
See the submission article for terminal screenshots and a full walkthrough.
MIT β see LICENSE for details.
Contributions welcome! Ideas for new rules, parser improvements, or better Copilot CLI integration are all appreciated.
# Clone the repo
git https://github.com/Safvan-tsy/a11y-pilot.git
cd a11y-pilot
npm install
# Run tests
npm test
# Scan the test fixtures during development
a11y-pilot scan test/fixtures/a11y-pilot β Making the web accessible, one terminal command at a time. π«
