{"_id":"@a11y-guard/cli","name":"@a11y-guard/cli","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@a11y-guard/cli","version":"1.0.0","description":"CLI for a11y-guard accessibility compliance linter","type":"module","bin":{"a11y-guard":"dist/index.js"},"main":"./dist/index.js","exports":{".":"./dist/index.js"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Zunaib/a11y-guard.git","directory":"packages/cli"},"homepage":"https://github.com/Zunaib/a11y-guard#readme","publishConfig":{"access":"public"},"dependencies":{"commander":"^12.0.0","glob":"^11.0.0","chalk":"^5.3.0","ora":"^8.0.1","@a11y-guard/core":"1.0.0"},"devDependencies":{"@types/node":"^22","tsup":"^8.0.0","vitest":"^2.0.0","typescript":"^5.5.0"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","clean":"rm -rf dist"},"_id":"@a11y-guard/cli@1.0.0","bugs":{"url":"https://github.com/Zunaib/a11y-guard/issues"},"_integrity":"sha512-gY35TgbFM2nnvN0pa5mHsGignk0kLmdq3lCoo/5ShukPEi5KuFnTTGONPBaafrmwBSPeOO7gcXuWpRj4Zm0ODg==","_resolved":"/private/var/folders/fx/6_j04p_n1x7gnglswxk7cskc0000gp/T/86775420cf201e56e597d992e948a5cd/a11y-guard-cli-1.0.0.tgz","_from":"file:a11y-guard-cli-1.0.0.tgz","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-gY35TgbFM2nnvN0pa5mHsGignk0kLmdq3lCoo/5ShukPEi5KuFnTTGONPBaafrmwBSPeOO7gcXuWpRj4Zm0ODg==","shasum":"cc733cf72e8de26610413dd42c3f380eb7bca300","tarball":"https://registry.npmjs.org/@a11y-guard/cli/-/cli-1.0.0.tgz","fileCount":5,"unpackedSize":40137,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDM7LIjVjsLm5rjDnXh3BqznxA6L/V5SpefRiuADqdKEwIhAMxs3fjTl0nLWqgpxFdBzgF/m6sCnLQ+rMuGryzsQkvI"}]},"_npmUser":{"name":"zunaib.imtiaz","email":"zunaib60@gmail.com"},"directories":{},"maintainers":[{"name":"zunaib.imtiaz","email":"zunaib60@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_1.0.0_1778453052411_0.07191424442243699"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-10T22:44:12.332Z","1.0.0":"2026-05-10T22:44:12.540Z","modified":"2026-05-10T22:44:12.749Z"},"maintainers":[{"name":"zunaib.imtiaz","email":"zunaib60@gmail.com"}],"description":"CLI for a11y-guard accessibility compliance linter","homepage":"https://github.com/Zunaib/a11y-guard#readme","repository":{"type":"git","url":"git+https://github.com/Zunaib/a11y-guard.git","directory":"packages/cli"},"bugs":{"url":"https://github.com/Zunaib/a11y-guard/issues"},"license":"MIT","readme":"# @a11y-guard/cli\n\nCommand-line tool for scanning HTML, JSX, and TSX files for accessibility violations. Maps every finding to the exact law and jurisdiction that requires it.\n\n## Install\n\n```bash\n# Global\nnpm install -g @a11y-guard/cli\n\n# Or run without installing\nnpx a11y-guard scan 'src/**/*.tsx' --region US EU\n```\n\n## Commands\n\n### `scan`\n\nScan files for accessibility violations.\n\n```bash\na11y-guard scan [patterns...] [options]\n```\n\n**Default patterns** (when none are provided): `src/**/*.html`, `src/**/*.tsx`, `src/**/*.jsx`, `public/**/*.html`\n\n| Option | Description | Default |\n|---|---|---|\n| `-r, --region <regions...>` | Target jurisdictions | all |\n| `-l, --law <laws...>` | Target specific laws | all |\n| `-d, --disability-type <types...>` | Filter by disability type | all |\n| `--level <level>` | WCAG conformance level: `A`, `AA`, `AAA` | `AA` |\n| `--reporter <format>` | Output format: `pretty`, `json`, `sarif`, `github-actions`, `html` | `pretty` |\n| `-o, --output <file>` | Write output to a file | — |\n| `--fail-on <severity>` | Exit 1 when `error`, `warning`, or `any` found | `error` |\n| `-c, --config <path>` | Path to `a11y-guard.config.ts` | — |\n\n**Examples:**\n\n```bash\n# Scan all components against US + EU law\na11y-guard scan 'src/**/*.tsx' --region US EU\n\n# Generate a shareable HTML report\na11y-guard scan 'src/**/*.tsx' --reporter html --output a11y-report.html\n\n# CI gate — exits 1 if any error is found, annotates GitHub Actions\na11y-guard scan 'src/**/*.tsx' --reporter github-actions --fail-on error\n\n# SARIF output for GitHub Code Scanning\na11y-guard scan --reporter sarif --output results.sarif\n\n# Filter to visual disability rules only\na11y-guard scan --disability-type visual motor --region US\n```\n\n**Scanning behavior:**\n\n- `.tsx` / `.jsx` files are scanned as standalone components. Document-level rules (`html-has-lang`, `page-title`, `landmark-regions`, etc.) are skipped per-file.\n- After all component files are scanned, an additional **app-structure** pass combines all component output into a virtual document and checks for missing `<main>`, missing `lang`, and missing `<title>` across the entire project.\n- `.html` files are scanned as full documents — all rules apply.\n\n---\n\n### `init`\n\nScaffold a config file and add audit scripts to `package.json`.\n\n```bash\na11y-guard init [options]\n```\n\n| Option | Description |\n|---|---|\n| `--no-scripts` | Skip injecting scripts into `package.json` |\n\nCreates `a11y-guard.config.ts` in the current directory and adds:\n\n```json\n{\n  \"scripts\": {\n    \"a11y\":      \"a11y-guard scan --region US EU --level AA\",\n    \"a11y:html\": \"a11y-guard scan --region US EU --reporter html --output a11y-report.html\",\n    \"a11y:ci\":   \"a11y-guard scan --region US EU --reporter github-actions --fail-on error\"\n  }\n}\n```\n\n---\n\n### `matrix`\n\nPrint the full compliance matrix: which laws apply to which regions.\n\n```bash\na11y-guard matrix [--region US EU] [--law ADA EAA]\n```\n\n## Config file\n\n```ts\n// a11y-guard.config.ts\nimport { defineConfig } from '@a11y-guard/core';\n\nexport default defineConfig({\n  regions: ['US', 'EU'],\n  level: 'AA',\n  failOn: 'error',\n  reporter: 'pretty',\n  rules: {\n    'missing-alt-text': 'error',\n    'color-contrast': 'error',\n    'focus-visible': 'warning',\n  },\n});\n```\n\n## GitHub Actions\n\n```yaml\n- name: Accessibility audit\n  run: |\n    npx a11y-guard scan 'src/**/*.tsx' \\\n      --region US EU \\\n      --reporter github-actions \\\n      --fail-on error\n```\n\n## License\n\nMIT — see [LICENSE](../../LICENSE) in the root of the repository.\n","readmeFilename":"README.md","_rev":"1-56b78cdf5b6c47739c9cb5a93527aab0"}