TestGen Documentation

Everything you need to know to start generating tests with AI

What is TestGen?

FREE BETA

TestGen is a command-line tool that uses artificial intelligence to automatically generate comprehensive unit tests for your code. It supports PHP, JavaScript, and TypeScript, and integrates seamlessly with popular testing frameworks like PHPUnit and Jest.

With TestGen, you can generate high-quality test suites in seconds, allowing you to focus on writing features instead of boilerplate test code. Currently in free beta—join early adopters in shaping the future of AI-powered testing.

Getting Started

1

Create Account

Sign up for a free TestGen account to get started:

• Visit testgen.dev/register

• Enter your name, email, and password

• Click “Create Account”

✓ You're ready to use TestGen!

2

Install the CLI

Install TestGen globally using npm:

npm install -g @testgen/cli

You can also use yarn or pnpm if you prefer

3

Login to TestGen

Authenticate the CLI with your email and password:

testgen login
Enter your email: you@example.com
Enter your password: ••••••••
✔ Login successful!

Your credentials will be securely stored locally

4

Generate Tests

Start generating tests for your code:

testgen generate src/UserService.php
⠋ Generating PHP tests...
✔ Test generated successfully!
✔ Test created → tests/UserServiceTest.php

CLI Commands

testgen login

Authenticate with your TestGen account using email and password.

testgen login

testgen generate <file> [options]

Generate unit tests for a specific file.

testgen generate src/UserService.php

testgen status

View your account information and usage statistics.

testgen status

Key Features

⚡ Lightning Fast

Generate comprehensive test suites in seconds using advanced AI models.

🎨 Beautiful CLI

Enjoy a delightful developer experience with spinners, colors, and diff previews.

🔧 Zero Config

Auto-detects your language and testing framework—works out of the box.

🔍 Smart Preview

Review generated tests before saving with the --preview flag.

Supported Languages

🐘 PHP

Full support for PHP with PHPUnit

testgen generate UserService.php

📜 JavaScript

Jest test generation for JavaScript

testgen generate utils.js

🔷 TypeScript

Full TypeScript support with Jest

testgen generate service.ts

Beta Access & Future Features

Free Beta (Current)

Unlimited test generations during beta period

No credit card required • Help us improve the product

Premium Features Coming Soon

Multi-file Analysis

Generate tests for entire modules

Smart Mocking

Auto-generate mocks and stubs

Dependency Graphs

Visualize test coverage

Team Collaboration

Share test templates

Need Help?

Having trouble getting started? Here are some quick tips:

  • Make sure you have Node.js 18+ installed
  • Use testgen status to check your remaining quota
  • Files must be under 500KB to be processed
  • Only .php, .js, and .ts files are currently supported