QualityPilot

Reference

CLI

qlens brings QualityPilot to your terminal. Check the test-health grade of any GitHub repo, send a failing test to the AI Bug Detective, and verify your API key without leaving the shell.

Install

npm install -g @qlens/cli

Requires Node.js 20+. The package is @qlens/cli on npm.

Commands

qlens scan

Print the latest QualityPilot grade for the current repo's GitHub origin.

$ qlens scan
i-kosheliev/qualitypilot
  B  Test health grade  (71/100)
  Full report: https://www.qlens.dev/scan/i-kosheliev/qualitypilot
  • Reads .git/config from the current directory (or any parent), extracts the GitHub owner/repo, and queries the public scan badge.
  • No sign-in or API key required. Public data only — same source as the README badge.

qlens auto-fix <test-file>

Send a failing test file to the AI Bug Detective playground and print a proposed fix.

$ qlens auto-fix tests/cart.test.ts
Sending to playground (framework=jest)... this can take 5-15s.
Proposed fix · confidence 87%
Target: test_file

Root cause:
  Off-by-one in the assertion.

Fixed content:
```
expect(items.length).toBe(2);
```

Options

  • -f, --framework <name> jest | playwright | pytest. Auto-detected from filename when omitted (.py → pytest, .spec.ts → playwright, otherwise jest).
  • -p, --production-file <path> Optional. Path to the production source file the test exercises. Improves fix quality.
  • The free tier allows 5 attempts per day per IP. Set QLENS_API_KEY to scale beyond that as the API gains key-aware access.
  • Files larger than 3000 characters are truncated client-side to fit the playground's prompt budget.

qlens status

Verify the configured API key works and show recent auto-fix metrics.

$ qlens status
QualityPilot CLI status
  API key: qlens_ab…1234
  Status:  key is valid
  Auto-fixes opened (30d): 12
  Auto-fixes merged (30d): 7
  • Hits /api/v1/auto-fix-metrics — a 200 confirms the key is valid, a 401 means it has been revoked.
  • Returns a non-zero exit code when the key is missing or invalid, so it's safe to chain in CI scripts.

qlens login

Print step-by-step instructions for obtaining an API key.

$ qlens login
Sign in to QualityPilot

  1. Visit https://www.qlens.dev/dashboard/keys
  2. Sign in with GitHub and create an API key (Pro+ plan).
  3. Save it locally:

     qlens config set api-key <your-key>

qlens config set api-key <key>

Save an API key to ~/.qlens/config.json (mode 0600 — owner read/write only).

$ qlens config set api-key qlens_abcdefghij1234
Saved API key.
  Key:  qlens_ab…1234
  File: /Users/you/.qlens/config.json

qlens config get api-key

Print the saved key, masked (first 8 + last 4 characters).

$ qlens config get api-key
API key: qlens_ab…1234

Environment variables

VariablePurpose
QLENS_API_KEYOptional. Overrides the key stored in ~/.qlens/config.json. Same convention as the reporter packages.
QLENS_API_URLOptional. Override the base URL (handy for staging or a local dev server). Defaults to https://www.qlens.dev.
NO_COLORStandard. 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).

set -e-friendly out of the box.

Source & issues

The CLI lives in the qualitypilot monorepo. File issues at i-kosheliev/qualitypilot or via the contact form.