Everything you need to know to start generating tests with AI
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.
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!
Install TestGen globally using npm:
npm install -g @testgen/cliYou can also use yarn or pnpm if you prefer
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
Start generating tests for your code:
testgen generate src/UserService.php
⠋ Generating PHP tests...
✔ Test generated successfully!
✔ Test created → tests/UserServiceTest.phpAuthenticate with your TestGen account using email and password.
Generate unit tests for a specific file.
View your account information and usage statistics.
Generate comprehensive test suites in seconds using advanced AI models.
Enjoy a delightful developer experience with spinners, colors, and diff previews.
Auto-detects your language and testing framework—works out of the box.
Review generated tests before saving with the --preview flag.
Full support for PHP with PHPUnit
testgen generate UserService.phpJest test generation for JavaScript
testgen generate utils.jsFull TypeScript support with Jest
testgen generate service.tsUnlimited test generations during beta period
No credit card required • Help us improve the product
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
Having trouble getting started? Here are some quick tips:
testgen status to check your remaining quota