create-endorphin-ai
v0.7.4
Published
Create a new Endorphin AI project with one command
Maintainers
Readme
create-endorphin-ai
Create a new Endorphin AI project with one command.
Usage
Interactive Mode
npx create-endorphin-aiDirect Project Creation
npx create-endorphin-ai my-ai-testsUsing npm init
npm init endorphin-ai@latest
npm init endorphin-ai@latest my-ai-testsWhat It Does
- Creates project directory with proper structure
- Installs Endorphin AI as a dev dependency
- Initializes the project with sample tests and configuration
- Sets up npm scripts for common tasks
Generated Project Structure
my-ai-tests/
├── .env # Environment variables (add your OpenAI API key)
├── package.json # Project configuration with helpful scripts
├── endorphin.config.ts # Endorphin AI configuration
├── .gitignore # Git ignore patterns
├── tests/ # Your test files
│ └── sample-test.ts # Example test (HEALTH-001)
├── test-results/ # Generated test reports
└── test-recorder/ # Test recording sessionsGenerated npm Scripts
The created project includes these helpful scripts:
{
"scripts": {
"test": "endorphin-ai run test all",
"test:smoke": "endorphin-ai run test --tag smoke",
"test:record": "endorphin-ai run test-recorder",
"test:single": "endorphin-ai run test",
"endorphin-ai:init": "./node_modules/.bin/endorphin init",
"endorphin-ai:version": "./node_modules/.bin/endorphin --version",
"endorphin-ai:help": "./node_modules/.bin/endorphin --help"
}
}Quick Start After Creation
cd my-ai-tests
# 1. Add your OpenAI API key to .env file
echo "OPENAI_API_KEY=your_api_key_here" > .env
# 2. Run the sample test
npx endorphin-ai run test HEALTH-001
# 3. Generate and view test report
npx endorphin-ai generate report
npx endorphin-ai open reportRequirements
- Node.js 18+
- OpenAI API key
- npm or yarn
Features
- 🎯 One-command setup - Get started instantly
- 🤖 AI-powered testing - Write tests in plain English
- 📊 Beautiful reports - Interactive HTML reports with screenshots
- 🔧 Zero configuration - Works out of the box
- 🎮 Interactive recorder - Create tests by clicking through your app
- 📚 TypeScript support - Full type definitions included
Troubleshooting
If npx endorphin-ai doesn't work after creation:
# Use npm scripts instead (always works)
npm run endorphin-ai:init
npm run test
# Or use direct path
./node_modules/.bin/endorphin --helpMore Information
Endorphin AI - E2E Testing Reinvented with AI 🎯
