@a11yflowdev/cli
v0.1.2
Published
CLI tool for A11yFlow — WCAG 2.2 accessibility scanner
Downloads
328
Maintainers
Readme
@a11yflowdev/cli
CLI tool for A11yFlow — WCAG 2.2 accessibility scanner. Run scans from the terminal, get results as tables, JSON, or plain-language explanations. Built for developers, CI/CD pipelines, and AI coding agents.
Quick Start
# No install needed
npx @a11yflowdev/cli scan https://example.com
# Or install globally
npm install -g @a11yflowdev/cliAuthentication
# Option 1: Environment variable (recommended for CI)
export A11YFLOW_API_KEY=sk_live_your_key
# Option 2: Store in config file
a11yflow auth login
# Option 3: Pass inline
a11yflow scan https://example.com --key sk_live_your_keyGet an API key free at a11yflow.dev.
Commands
Scan a page
a11yflow scan https://example.com
a11yflow scan https://example.com --format plain # plain language explanations
a11yflow scan https://example.com --format json # machine-readable output
a11yflow scan https://example.com --standard wcag2aaaOutput (table):
Score: 74/100 | 4 violations | 17 passes | 2 incomplete
VIOLATIONS
critical button-name 2 elements Buttons must have discernible text
serious color-contrast 5 elements Elements must have sufficient colour contrast
serious label 1 element Form elements must have labels
moderate html-has-lang 1 element <html> element must have a lang attributeOutput (plain):
Score: 74/100
--- CRITICAL ---
button-name (2 elements)
What's wrong: One or more buttons don't have a name that describes what they do.
Who's affected: Screen reader users hear "button" with no context.
How to fix: Add visible text inside the button, or add an aria-label.Crawl multiple pages
a11yflow crawl https://example.com
a11yflow crawl https://example.com --mode sitemap --max-pages 25Browse rules
a11yflow rules # list all rules
a11yflow rules color-contrast # detail for one rule
a11yflow rules --impact critical # filter by impactManage schedules and webhooks
a11yflow schedules list
a11yflow schedules create https://example.com --frequency daily
a11yflow webhooks list
a11yflow webhooks create https://hooks.example.com/a11yScan Flags
| Flag | Default | Description |
|------|---------|-------------|
| --standard | wcag22aa | wcag2a, wcag2aa, wcag2aaa, wcag22aa |
| --format | table | table, json, plain |
| --fail-on | — | Exit 1 if violations at this impact+: minor, moderate, serious, critical |
| --wait | 3000 | Wait for JS rendering (0-30000ms) |
| --quiet | false | Suppress progress, print only results |
| --include-html | false | Include HTML of violating elements |
| --include-best-practices | false | Include non-WCAG best-practice rules |
| --poll-interval | 2000 | Poll interval (ms) while waiting |
| --timeout | 120000 | Max wait time (ms) |
CI/CD Integration
Exit codes: 0 = pass, 1 = violations found, 2 = error.
GitHub Actions:
- name: Accessibility scan
env:
A11YFLOW_API_KEY: ${{ secrets.A11YFLOW_API_KEY }}
run: npx @a11yflowdev/cli scan $DEPLOY_URL --fail-on seriousGitLab CI:
accessibility:
script:
- npx @a11yflowdev/cli scan $DEPLOY_URL --fail-on serious --quiet --format json > report.json
artifacts:
paths:
- report.jsonLinks
License
MIT
