UICheck CLI
Node 18+npx @uicheck-cli/cliGitHub Actions, GitLab CI, Bitbucket, any CIEvery plan
Quick start
Three steps; the next deploy is checked.
- 1
Create a CI token
In UICheck, open Integrations → CI tokens, name it after your pipeline and copy it. It is shown once, can only start and read checks, and can be revoked any time.
- 2
Save it as UICHECK_TOKEN
In your CI as a secret named UICHECK_TOKEN, and on your computer as an environment variable. How, step by step.
- 3
Run the check after your deploy
Add one step that runs
npx @uicheck-cli/cli run --urlwith your staging address. Ready-made steps: Add it to your CI.
export UICHECK_TOKEN=uck_ci_… # your CI tokennpx @uicheck-cli/cli run --url https://staging.example.com
Install
Most people never install it: npx fetches it when it runs. Pin it in a project, or use the one-file version where npm isn't available.
Nothing to install: npm fetches it when it runs
npx @uicheck-cli/cli run --url https://staging.example.comNeeds Node 18 or newer and UICHECK_TOKEN set (or --token).
Your token
A CI token lets the CLI start checks in your workspace. With one, checks run on UICheck (nothing to install, reports and history); without one, they run on your own machine.
- 1
Create the token
Sign in, open Integrations → CI tokens, type a name that says where it will be used (GitHub Actions, My laptop) and press Create token.
Copy it right away: it is shown only once. It starts withuck_ci_. It can start and read checks in this workspace and nothing else. Owners and admins create tokens; up to 10 per workspace. - 2
Save it on your computer
The CLI reads the token from
UICHECK_TOKEN. Replaceuck_ci_your_tokenwith yours:Terminal
# For this terminal window onlyexport UICHECK_TOKEN=uck_ci_your_token # For every new window: add it to ~/.zshrc, then reloadecho 'export UICHECK_TOKEN=uck_ci_your_token' >> ~/.zshrcsource ~/.zshrc
Open a new terminal window afterwards (or run source ~/.zshrc) so it picks the token up.
- 3
Save it in your CI
Add it as a secret named exactly UICHECK_TOKEN. The steps under each CI below read it from there.
- GitHub Actions: Repository → Settings → Secrets and variables → Actions → New repository secret
- GitLab CI: Project → Settings → CI/CD → Variables → Add variable (Masked)
- Bitbucket Pipelines: Repository settings → Repository variables (Secured)
- 4
Check that it works
Terminalnpx @uicheck-cli/cli run --url https://example.comYou should see report with a link right after the start: the check is running on UICheck. “The token was refused” means it was mistyped or revoked; no report line and a browser download means no token was found (open a new terminal window after saving it).
- 5
Change or replace it
To move to a new token (someone left, it leaked, or you just want a fresh one):
- Create a new token in Integrations → CI tokens (step 1).
- Put it everywhere the old one was: your CI secret (edit UICHECK_TOKEN) and your computer (run the same commands from step 2 again; in
~/.zshrcor~/.bashrcedit the old line instead of adding a second one). - Press Revoke next to the old token. Anything still using it gets “the token was refused” from then on.
Removing someone from the workspace offers to revoke the tokens they made.
Add it to your CI
Put the step after your staging deploy, change the address to your staging site, and save your token as UICHECK_TOKEN.
.github/workflows/uicheck.yml
name: UICheckon: deployment_status: # runs after your staging deploy (Vercel, Netlify…) workflow_dispatch:jobs: uicheck: if: github.event_name == 'workflow_dispatch' || github.event.deployment_status.state == 'success' runs-on: ubuntu-latest steps: - uses: actions/setup-node@v4 with: { node-version: 22 } - run: npx @uicheck-cli/cli run --url https://staging.example.com env: UICHECK_TOKEN: ${{ secrets.UICHECK_TOKEN }}
Token: Settings → Secrets and variables → Actions → New repository secret. The result also appears in the job summary.
--project.What the build shows
While it waits, a progress bar shows the screens checked (plain lines in CI logs). Then the quality gate, the score, every screen and the top findings, with a link to the full report: clickable in most terminals, in colour also in GitHub, GitLab and Bitbucket logs. Set NO_COLOR to turn colour off.
◆ UICheck checking https://staging.client.com on main@4f2c1d9 report https://uicheck.app/app/checks/cm4x… ✔ Quality gate passed improved (+6 points) ✔ New critical issues (must be 0) none ✔ New major issues (must be 0) none ✔ Score change (may drop 2 points at most) +6 points Score 92 A ██████████████████████░░ 0 critical · 1 major · 4 minor Screens Page Size Score Findings / 390x844 90 1 major · 2 minor / 1280x800 94 2 minor Top findings ● MAJOR Some text doesn’t stand out from its background: contrast 2.9:1 (3 elements) 390px .hero p ● MINOR The page has no meta description 1280px PASSED the quality gate passed in 0:41 → Open the full report https://uicheck.app/app/checks/cm4x…
The quality gate compares with the last check of the same pages: it fails on a new critical or major problem, or a score drop of more than 2 points. A first check needs no critical problems and a score of at least 70.
See results on your pull requests
On GitHub, each scan also shows on the commit and its pull request as a UICheck check, next to your tests.
- In UICheck, connect GitHub under Integrations, with an account that can push to the repo. The UICheck GitHub app needs to be installed on that repo.
- Run the CLI in GitHub Actions as above. It sends the repo and the pull request’s commit by itself.
- Open the pull request: the UICheck check says passed or failed, with the score, why the quality gate failed and a link to the report. A scan that couldn’t run shows as neutral, never as a failure of your code.
Options
Every option works the same with npx, an installed package and the one-file version. Run uicheck run --help to see them.
What to check
- --url <url>
- A page to check. Repeat it for more pages.
- --project <domain>
- A project saved in UICheck, e.g. client.com: its pages, screen sizes and settings.
- --env <name>
- production (default) or staging, with --project.
- --crawl
- Check the whole site, starting from the first URL.Lens · Prism
How to check
- --viewports <list>
- Screen sizes, e.g. 390x844,1280x800. Default: your plan’s standard sizes.
- --browser <name>
- chromium, webkit (Safari) or firefox.Safari, Firefox: Lens · Prism
Pass, fail and output
- --fail-on <level>
- gate (default): fail when the quality gate fails. Or critical, major, minor: fail on any finding at that level or worse.
- --timeout <minutes>
- Stop waiting after this long (default 20). The check itself keeps running.
- --json
- Print the full result as JSON instead of the summary.
- --branch, --commit
- Shown on the check. Read from GitHub, GitLab and Bitbucket when left out.
Account
- --token <token>
- Your CI token. Better: set UICHECK_TOKEN, so it never appears in the build log.
- --server <url>
- Another UICheck address. Default: https://uicheck.app
Exit codes
What your CI does next depends on the exit code.
| Code | Meaning |
|---|---|
| 0 | Passed. The quality gate passed (or nothing at your --fail-on level). The build continues. |
| 1 | Failed. The gate failed, or the site couldn’t be checked. The log links to the report. |
| 2 | Couldn’t ask UICheck. UICheck couldn’t be reached, or the token was refused. |
Inside Playwright tests
Check the screens a link can’t reach: after login, a full cart, a step of checkout, an open menu. One line in the tests you already have; the page is checked as it is and left untouched, so the test carries on.
import { test } from '@playwright/test';import { uicheck } from '@uicheck-cli/cli/playwright'; test('checkout', async ({ page }) => { await page.goto('/cart'); await page.click('text=Checkout'); await uicheck(page); // checks this screen, logged in await uicheck(page, { label: 'payment step', failOn: 'major' });});
npm install --save-dev @uicheck-cli/cli- With UICHECK_TOKEN set, every screen of one test run (a CI build, or one
playwright test) lands in one check with the branch and commit: report, quality gate and history, each screen named after its test orlabel. - It fails the test on a finding at
failOn(critical by default;falsenever fails). UICheck being unreachable never fails a test. - What it checks: layout, text, overlaps, tap targets, images and accessibility, at the test’s own screen size. Checks that type, tab or submit are left out so your test isn’t disturbed.
- Plans: Lens uploads 50 screens per test run, Prism 500. On Free it checks locally and prints the findings.
With AI assistants
The same package is an MCP server: Claude Code, Cursor, VS Code or Windsurf can check your pages, read the findings, fix the code and check again.
claude mcp add uicheck --env UICHECK_TOKEN=uck_ci_your_token -- npx -y @uicheck-cli/cli mcpSetup for every assistant, the tools and example prompts: UICheck for AI assistants.
Run without an account
Without a token, the CLI runs the checks on your own machine in a real browser. Useful on a laptop or for local HTML files; there is no quality gate, history or report link.
npx @uicheck-cli/cli run --url https://example.com --viewports 390x844,1280x800Everything comes with the package. The browser (about 150 MB) is downloaded automatically the first time, once per machine.
Screenshots and results.json go to uicheck-output/. It exits 1 on any critical finding (change it with --fail-on). Local-only options: --hide, --mask, --wait-for, --out.
Troubleshooting
- “the token was refused”
- The token was revoked or mistyped. Create a new one in Integrations → CI tokens and update the UICHECK_TOKEN secret.
- The site answers 403 or shows a challenge page
- Bot protection is blocking the check. Add a skip rule with your site access key.
- npm says the version or package isn’t found
- Your npm cache may be out of date: run
npm cache clean --force, or add--prefer-online. - The browser download fails (local mode)
- Run
npx playwright install chromiumyourself (behind a company proxy, set HTTPS_PROXY first). Or add a token to run it on UICheck, nothing to download. - Does it count as a check?
- Yes, every CI run counts towards your plan’s checks per day (Prism has no daily limit). See plans