@onaccessible/cli
v1.1.0
Published
CLI for ON ACCESSIBLE WCAG 2.2 accessibility audits — headless browser, pixel contrast, CI gates
Maintainers
Readme
@onaccessible/cli
Run WCAG accessibility audits from the terminal or CI.
Requires a Premium API token from Portal → API & Webhooks.
Install
Published on npm as @onaccessible/cli.
npm install -g @onaccessible/cli
# or run without install:
npx @onaccessible/cli audit https://example.com --helpFrom this repo without publishing:
node packages/cli/bin/onaccessible.mjs audit https://example.com ...Quick start
export ONACCESSIBLE_API_TOKEN="oa_…"
export ONACCESSIBLE_ANON_KEY="eyJ…" # Supabase publishable key (see docs/api)
onaccessible audit https://example.com
onaccessible audit https://example.com --min-score 90 --max-critical 0
onaccessible audit https://example.com --json --details
onaccessible audit https://example.com --mobile-viewport --min-score 85
onaccessible audit https://app.example.com/dashboard --cookie-header "session=…"Options
| Flag | Description |
|------|-------------|
| --min-score | Exit 1 if score below threshold |
| --max-critical | Exit 1 if critical count exceeds limit |
| --max-serious | Exit 1 if serious count exceeds limit |
| --mobile-viewport | Second headless pass at 390×844 |
| --cookie-header | Scan behind login (Premium API) |
| --ai | Advanced AI audit |
| --no-headless | Static HTML fetch only |
| --json / --details | Full API response |
Summary output (default)
Without --details, the API still returns enrichments the CLI prints when present:
categoryScores— POUR principle breakdownviewportProfiles.mobile— mobile score,categoryScoreDeltas, mobilepixelContrastscreenReaderPreview.regression— desktop vs mobile announcement diff countshistoricalRegression— diff vs your prior snapshot for the same URL (2nd+ scan)pixelContrast— desktop computed-style contrast sampling
CI example
- run: npx @onaccessible/cli audit https://example.com --min-score 90 --max-critical 0
env:
ONACCESSIBLE_API_TOKEN: ${{ secrets.ONACCESSIBLE_API_TOKEN }}
ONACCESSIBLE_ANON_KEY: ${{ secrets.ONACCESSIBLE_ANON_KEY }}Or use the bundled GitHub Action from this repo.
Exit codes
| Code | Meaning | |------|---------| | 0 | Scan passed thresholds | | 1 | Scan failed thresholds or API error | | 2 | Invalid usage |
