Skip to content

magicpro97/testforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§ͺ TestForge

AI-powered test generation from your terminal

Scan untested code, generate unit & E2E tests, and visualize coverage β€” all from the CLI.

Features

  • πŸ” Scan β€” Detect untested files and functions across your codebase
  • πŸ€– Generate β€” AI-generate unit tests for any file (Jest, Vitest, pytest, Flutter)
  • 🎭 E2E β€” Generate Playwright/Detox/Maestro test flows from natural language
  • πŸ“Š Coverage β€” Terminal-friendly coverage visualization
  • πŸ’‘ Suggest β€” AI-prioritized test recommendations by risk/impact
  • ⚑ Multi-language β€” TypeScript, JavaScript, Python, Dart, Kotlin, Swift

Quick Start

# Install globally
npm install -g @magicpro97/testforge

# Configure AI provider
testforge config set openai.apiKey sk-your-key
testforge config set defaultProvider openai

# Scan for untested code
testforge scan ./src

# Generate tests for a file
testforge gen src/utils.ts

# Generate E2E test from description
testforge gen:e2e "user logs in, adds item to cart, checks out"

# View coverage
testforge coverage .

# Get AI suggestions on what to test first
testforge suggest ./src

Commands

testforge scan [dir]

Scan for untested code and show coverage gaps.

testforge scan ./src
testforge scan ./src --language ts
testforge scan . --json

testforge gen <file>

AI-generate unit tests for a specific file.

testforge gen src/utils.ts
testforge gen src/api.ts --framework vitest
testforge gen src/helpers.py --provider gemini
testforge gen src/utils.ts --dry-run    # Preview without writing
testforge gen src/utils.ts -o tests/utils.test.ts

testforge gen:e2e "description"

Generate E2E test flows from natural language descriptions.

testforge gen:e2e "user signs up with email and verifies account"
testforge gen:e2e "add product to cart and checkout" --framework detox
testforge gen:e2e "navigate to settings and change password" --framework maestro

testforge coverage [dir]

Show coverage summary in terminal. Parses Istanbul/lcov coverage reports.

testforge coverage .
testforge coverage . --json
testforge coverage . --min 80

testforge suggest [dir]

AI-powered suggestions for which tests to write first, prioritized by risk and impact.

testforge suggest ./src
testforge suggest . --limit 5
testforge suggest . --json

testforge config

Manage AI provider configuration.

testforge config set openai.apiKey sk-your-key
testforge config set openai.model gpt-4o
testforge config set gemini.apiKey AIza...
testforge config set defaultProvider openai
testforge config list

Supported Languages

Language Extensions Test Patterns
TypeScript .ts *.test.ts, *.spec.ts
JavaScript .js *.test.js, *.spec.js
Python .py test_*.py, *_test.py
Dart .dart *_test.dart
Kotlin .kt *Test.kt
Swift .swift *Tests.swift

AI Providers

  • OpenAI β€” GPT-4o-mini (default), GPT-4o, or any compatible model
  • Gemini β€” Gemini 2.0 Flash (default) or other Gemini models

Requirements

  • Node.js 20+
  • An OpenAI or Gemini API key

License

MIT Β© magicpro97

About

πŸ§ͺ AI Test Generator CLI β€” scan, generate, and manage tests from your terminal

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors