@qlens/cli
v0.2.0
Published
Command-line interface for QualityPilot (qlens.dev) — scan repos, trigger AI auto-fixes, and check API key status from any terminal.
Downloads
21
Maintainers
Readme
@qlens/cli
The qlens CLI brings QualityPilot to your terminal. Check the test-health grade of any GitHub repo, run a failing test through the AI Bug Detective, and verify your API key — without leaving the shell.
Install in 30 seconds
npm install -g @qlens/cli # requires Node.js 20+
qlens demo # see an AI fix on a real repo, no setupOr, even faster, with no install:
npx qlens demoThat picks a curated public repo, runs the same AI fix pipeline our paying customers use, and prints the proposed change in your terminal. No sign-in required.
Commands
qlens demo
Runs an AI fix proposal on a randomly selected curated repo (e.g. facebook/react, vercel/next.js). Useful for showing the product to a teammate without making them sign up first.
$ qlens demo
Demoing AI fix on facebook/react...
===========================================================
AI fix proposal — facebook/react
===========================================================
File: packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
Confidence: 78%
Reasoning:
The arbitrary 100ms timeout makes this test flake under CI load. Replacing
it with an explicit waitFor(...) for the rendered marker is deterministic.
Proposed diff:
- await new Promise(r => setTimeout(r, 100));
+ await waitFor(() => screen.getByText('hydrated'));
Remaining free attempts today: 2
===========================================================
→ Want this on YOUR repo? `qlens login` then `qlens auto-fix <test-file>`Add --json to dump the raw API response (useful for piping into jq).
The free tier is 3 attempts per IP per day (shared with the website's /scan/{owner}/{repo}/try-fix page).
qlens scan
Reads the current directory's .git/config, extracts the GitHub owner/repo, and prints the latest QualityPilot grade.
$ qlens scan
i-kosheliev/qualitypilot
B Test health grade (71/100)
Full report: https://www.qlens.dev/scan/i-kosheliev/qualitypilotqlens auto-fix <test-file>
Sends a failing test file to the public AI Bug Detective playground and prints a proposed fix.
qlens auto-fix tests/cart.test.ts
qlens auto-fix tests/cart.test.ts -p src/cart.ts # provide production source for better fixes
qlens auto-fix tests/checkout.spec.ts -f playwright # explicit framework hint
qlens auto-fix tests/test_users.py -f pytestThe free tier allows 5 attempts per day per IP. Set QLENS_API_KEY to scale beyond that as the API gains key-aware access.
qlens status
Confirms your API key works and shows your recent auto-fix activity.
$ qlens status
QualityPilot CLI status
API key: qlens_ab…1234
Status: key is valid
Auto-fixes opened (30d): 12
Auto-fixes merged (30d): 7qlens login
Walks you through obtaining an API key — visit qlens.dev/dashboard/keys, then qlens config set api-key <your-key>.
qlens config set api-key <key> / qlens config get api-key
Stores the key at ~/.qlens/config.json (mode 0600 — owner read/write only). The CLI also honours QLENS_API_KEY from the environment, which takes priority over the file.
Environment variables
| Var | Purpose |
|-----|---------|
| QLENS_API_KEY | Optional. Overrides the key stored in ~/.qlens/config.json. Same convention as the reporter packages. |
| QLENS_API_URL | Optional. Override the base URL (handy for staging or a local next dev). Defaults to https://www.qlens.dev. |
| NO_COLOR | Standard. Disables ANSI colour output. |
Exit codes
0— happy path (scan rendered, fix returned, key valid, …).1— user-facing error (no git remote, key invalid, network failure, no fix returned).2— argument error (missing required argument; commander default).
set -e-friendly out of the box.
Need a key?
Sign in at qlens.dev with GitHub and create one at /dashboard/keys. Free tier includes 10 auto-fixes/month; the playground is anonymous with 5 attempts per day.
Docs
Full command reference and integration guide: qlens.dev/docs/cli.
License
MIT — built by IK Lab.
