koverai
v1.0.0
Published
Zero-config, AI-powered test generation & coverage scoring. Auto-detects your framework, generates unit & integration tests, and reports coverage — no test code required.
Maintainers
Readme
🧪 Koverai
Zero-config, AI-powered test generation & coverage scoring.
Koverai auto-detects your framework, generates unit & integration tests using AI, and reports test coverage — all without writing a single line of test code.
✨ Features
- Zero-config — auto-detects language, framework, and folder structure
- Multi-framework — React, Vue, Angular, Svelte, Express, NestJS, Spring Boot, Rails, Django, Flask, Go & more
- Multi-AI — works with Claude (Anthropic), OpenAI, or Gemini — bring your own API key
- Smart scanning — hybrid folder detection that adapts to any project structure (MVC, clean arch, feature-based, etc.)
- Dual coverage — separate scores for unit tests and integration tests
- Customizable thresholds — configure coverage goals in
koverai.config.json - Beautiful CLI output — progress bars, color-coded scores, and letter grades
🚀 Quick Start
1. Install
npm install -g koverai
# or use with npx (no install needed)
npx koverai run2. Set your AI API key
Create a .env file in your project root:
# Pick one (or multiple — Koverai auto-detects):
ANTHROPIC_API_KEY=sk-ant-your-key-here
OPENAI_API_KEY=sk-your-key-here
GEMINI_API_KEY=your-key-here3. Run
npx koverai runThat's it! Koverai will:
- Scan your project and detect the framework & language
- Analyze your source code
- Generate unit tests and integration tests using AI
- Output a coverage score report in your terminal
📋 CLI Commands
| Command | Description |
|----------------------|--------------------------------------------------|
| npx koverai run | Scan, generate tests, and report coverage |
| npx koverai init | Create a koverai.config.json with defaults |
| npx koverai detect | Show detected framework, language, and structure |
Run Options
npx koverai run [options]
Options:
-f, --framework <name> Override auto-detected framework
-l, --language <name> Override auto-detected language
-u, --unit-only Generate only unit tests
-i, --integration-only Generate only integration tests
-o, --output <dir> Output directory (default: .koverai)
-v, --verbose Enable verbose logging
--dry-run Scan only, don't generate tests⚙️ Configuration
Run npx koverai init to generate a config file, or create koverai.config.json manually:
{
"ai": {
"provider": "auto",
"model": null
},
"coverage": {
"unit": {
"statements": 80,
"branches": 70,
"functions": 80,
"lines": 80
},
"integration": {
"endpoints": 70,
"flows": 60,
"scenarios": 70
}
},
"scan": {
"include": ["src/custom-dir"],
"exclude": ["node_modules", "dist", "build"]
},
"output": {
"dir": ".koverai",
"keepTests": true,
"format": "table"
},
"testGen": {
"unitTests": true,
"integrationTests": true,
"maxTestsPerFile": 10,
"includeEdgeCases": true
}
}AI Provider Options
| Provider | Config Value | Env Variable | Default Model |
|-----------|-------------|----------------------|-----------------------------|
| Claude | "claude" | ANTHROPIC_API_KEY | claude-sonnet-4-20250514 |
| OpenAI | "openai" | OPENAI_API_KEY | gpt-4o |
| Gemini | "gemini" | GEMINI_API_KEY | gemini-2.0-flash |
| Auto | "auto" | Any of the above | First key found |
🎯 Supported Frameworks & Languages
Frontend
| Framework | Language | Test Runner | |-----------|-----------|-------------| | React | JS/TS | Jest | | Vue | JS/TS | Vitest | | Angular | TypeScript| Jest | | Svelte | JS/TS | Vitest |
Backend
| Framework | Language | Test Runner | |---------------|-----------|-------------| | Express | JS/TS | Jest | | NestJS | TypeScript| Jest | | Fastify | JS/TS | Jest | | Spring Boot | Java | JUnit | | Ruby on Rails | Ruby | RSpec | | Django | Python | pytest | | Flask | Python | pytest | | Go | Go | go test |
📊 Sample Output
╔═══════════════════════════════════════════╗
║ 🧪 Koverai v1.0.0 ║
║ AI-Powered Zero-Config Test Coverage ║
╚═══════════════════════════════════════════╝
📋 Project Detection:
Language: typescript
Framework: react
Structure: component-based
Test runner: jest
Source files: 24
Source dirs: src, src/components
🧪 Generating Unit Tests...
████████████████████░░░░ 18/24
🔗 Generating Integration Tests...
████████████████████████ 6/6
────────────────────────────────────────────────────
📊 KOVERAI TEST COVERAGE REPORT
🧪 UNIT TEST COVERAGE
Files tested 18
Total tests 142
Total assertions 284
✔ Statements 82% (threshold: 80%)
✔ Branches 72% (threshold: 70%)
✔ Functions 87% (threshold: 80%)
✔ Lines 82% (threshold: 80%)
🔗 INTEGRATION TEST COVERAGE
Files tested 6
Total tests 38
Total assertions 76
✔ Endpoints 78% (threshold: 70%)
✔ Flows 73% (threshold: 60%)
✔ Scenarios 78% (threshold: 70%)
🏆 OVERALL SCORE
[████████████████████████████████░░░░░░░░] 80% A
✨ Excellent! Your project has great test coverage.🔧 Programmatic API
You can also use Koverai as a library:
const { koverai } = require('koverai');
const results = await koverai('/path/to/project', {
framework: 'react', // optional override
language: 'typescript',
});
console.log(results.report.overall); // 80
console.log(results.report.unit.score);
console.log(results.report.integration.score);📁 Generated Files
After running, Koverai creates:
.koverai/
├── unit/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Button.test.tsx
│ │ │ └── Header.test.tsx
│ │ ├── utils/
│ │ │ └── helpers.test.ts
│ │ └── services/
│ │ └── api.test.ts
├── integration/
│ ├── integration.src-components.test.tsx
│ └── integration.src-services.test.ts
└── coverage-report.json📝 License
MIT
