Skip to content

adlerqa/smartregress-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartRegress

AI-Powered Regression Test Selection for GitHub Pull Requests SmartRegress analyzes GitHub PRs, detects impacted areas of the codebase, and selects the most relevant tests — reducing execution time, increasing accuracy, and improving QA productivity. Designed for real-world engineering teams, SmartRegress is fast, secure, developer-friendly, and fully CI compatible.

Features : -

PR diff analysis — Extracts modified files & computes impact. AI-powered test prioritization using LLMs. Multi-repo support (code repo + test repo). Zero setup — works locally via CLI. Secure config — keys stored locally, always masked. CI-ready — deterministic output & exit codes. Lightweight — no server, no cloud, no tracking.

  1. Installation

Install globally via NPM: npm install -g smartregress

Check installation: smartregress help

Configuration Commands

SmartRegress stores configuration locally in: ~/.smartregress.config.json

Set OpenAI API Key smartregress config set-key

Example: smartregress config set-key sk-abc123

Set GitHub Personal Access Token (PAT)

Required for ALL GitHub repos (public + private). smartregress config set-pat

Example smartregress config set-pat ghp_1234abcd

Set Preferred AI Model smartregress config set-model

Example: smartregress config set-model gpt-4o-mini

Show Current Config smartregress config show

Output is always masked: Example : apiKey: sk-****A90 githubPAT: ghp_****21d model: gpt-4o-mini

  1. Core Command Analyze a Pull Request This is the primary SmartRegress command. This is the command that performs:

GitHub PR fetch Diff parsing Impacted files detection Test ranking AI summarization

  1. BASE FORMAT smartregress analyze <owner/repo> [options]

Analyze PR Example smartregress analyze microsoft/playwright 39041

Expected output: PR metadata Summary of changes Impacted files Prioritized test list JSON saved if --out is used

This works even WITHOUT config PAT IF you pass the PAT inline:

smartregress analyze microsoft/playwright 39041 --pat

So BOTH of these work:

PAT saved in config PAT passed inline using --pat (Inline PAT overrides config PAT)

  1. ANALYZE OPTIONS — FULL LIST (EVERY OPTION)

Below is the complete, authoritative option set. 4.1 — Add Test Repo(s) Use this when your test suite lives in another repo.

Syntax --test-repo owner/repo@branch

Example --test-repo abc/xyz-qa@main

Multiple repos supported --test-repo org1/tests@main
--test-repo org2/e2e-suite@develop

Meaning:

PR comes from main repo Tests come from multiple external sources

4.2 — Add Test Roots (test directories)

These are folders inside your repo(s) where SmartRegress should search for test files. Syntax --test-roots

Example --test-roots tests --test-roots e2e_tests/tests

Multiple test roots supported --test-roots tests --test-roots integration --test-roots e2e

4.3 — Override PAT for this command only

If you DID NOT set PAT globally:

smartregress analyze owner/repo pr --pat

If you DID set PAT but want to override: smartregress analyze owner/repo pr --pat newPAT

Inline PAT always wins Does NOT overwrite saved config

========================================== 🟦 5) COMPLETE COMMAND EXAMPLES (REAL-WORLD)

5.1 Basic PR analysis smartregress analyze microsoft/playwright 39041

5.2 PR analysis with test repo smartregress analyze percona/pmm 4870
--test-repo percona/pmm-qa@main
--test-roots e2e_tests/tests

5.3 PR analysis with multiple test repos smartregress analyze bigorg/app 222
--test-repo qa-team/tests@stable
--test-repo automation/e2e@main
--test-roots tests --test-roots e2e

5.4 Export structured JSON smartregress analyze vercel/next.js 4567
--out .smartregress

Creates:

.smartregress/analysis.json

5.5 Inline PAT usage (no config file) smartregress analyze google/material-ui 189 --pat ghp_12345

5.6 Use a different model temporarily smartregress analyze netflix/dispatch 99 --model gpt-4o

5.7 Full debug trace smartregress analyze shopify/hydrogen 101 --debug

This is the FULL, FINAL, OFFICIAL command reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages