{"_id":"@dheerajsingh5832/smart-testgen","name":"@dheerajsingh5832/smart-testgen","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dheerajsingh5832/smart-testgen","version":"1.0.0","description":"Generate high-quality LLM prompts for test generation without calling any LLM API","main":"dist/index.js","types":"dist/index.d.ts","bin":{"smart-testgen":"dist/cli.js"},"scripts":{"build":"tsc","clean":"rimraf dist","prepublishOnly":"npm run clean && npm run build","prepare":"npm run build"},"keywords":["testing","test-generation","llm","copilot","cursor","jest","vitest","mocha","ai","prompt-engineering","cli","typescript","javascript","tdd"],"author":{"name":"dheeraj singh","email":"singhdevraj544@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dheerajsingh544/Smart_testgen.git"},"bugs":{"url":"https://github.com/dheerajsingh544/Smart_testgen/issues"},"homepage":"https://github.com/dheerajsingh544/Smart_testgen#readme","engines":{"node":">=16.0.0"},"devDependencies":{"@types/node":"^20.0.0","rimraf":"^6.1.2","typescript":"^5.3.0"},"dependencies":{"commander":"^11.0.0"},"_id":"@dheerajsingh5832/smart-testgen@1.0.0","gitHead":"95aa347b90c921f91a6079ef07287eb4af63abc9","_nodeVersion":"22.16.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-JYVsRV4ku+9uyNidep5Nk+hVnY0sINOm1fIvhvMN+kD/N6UTEz7u2Gagv1ndKxtiHIuzphNOKOsUcA1QFDfOfg==","shasum":"3ef9c8cb5367aeff9b6352c22e16b577a67c45c2","tarball":"https://registry.npmjs.org/@dheerajsingh5832/smart-testgen/-/smart-testgen-1.0.0.tgz","fileCount":23,"unpackedSize":32525,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICQNKhwqOM6IHcKgZifhMlByeKsQZzndNIi+O6A/+Ol/AiEA8/A/UDV9ESZr1wY+4whmSmaLH6IW9BUZDW09NpJzqNk="}]},"_npmUser":{"name":"dheerajsingh5832","email":"11dheeraj5832@gmail.com"},"directories":{},"maintainers":[{"name":"dheerajsingh5832","email":"11dheeraj5832@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/smart-testgen_1.0.0_1769016271784_0.9672323937831357"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-21T17:24:31.693Z","1.0.0":"2026-01-21T17:24:31.915Z","modified":"2026-01-21T17:24:32.104Z"},"maintainers":[{"name":"dheerajsingh5832","email":"11dheeraj5832@gmail.com"}],"description":"Generate high-quality LLM prompts for test generation without calling any LLM API","homepage":"https://github.com/dheerajsingh544/Smart_testgen#readme","keywords":["testing","test-generation","llm","copilot","cursor","jest","vitest","mocha","ai","prompt-engineering","cli","typescript","javascript","tdd"],"repository":{"type":"git","url":"git+https://github.com/dheerajsingh544/Smart_testgen.git"},"author":{"name":"dheeraj singh","email":"singhdevraj544@gmail.com"},"bugs":{"url":"https://github.com/dheerajsingh544/Smart_testgen/issues"},"license":"MIT","readme":"# smart-testgen\n\n> Generate high-quality LLM prompts for test generation **without calling any LLM API**\n\nPerfect for use with GitHub Copilot, Cursor, ChatGPT, Claude, or any AI assistant.\n\n## Features\n\n- ✅ **No LLM API calls** - generates prompts only, you control the AI\n- ✅ **IDE-agnostic** - works with any AI tool (Copilot, Cursor, ChatGPT, Claude)\n- ✅ **Multiple frameworks** - Jest, Vitest, Mocha\n- ✅ **Multiple test types** - Unit, Integration, E2E\n- ✅ **TypeScript support** - fully typed with strict mode\n- ✅ **CLI included** - easy to use from terminal\n- ✅ **No vendor lock-in** - use any LLM you prefer\n\n## Installation\n\n```bash\nnpm install -g smart-testgen\n```\n\n## Quick Start\n\n### 1. Generate a prompt\n\n```bash\nsmart-testgen generate --file src/calculator.ts --framework jest --type unit --ide\n```\n\n### 2. Copy the output\n\nThe tool outputs a formatted prompt:\n\n```\n========================================\nPASTE THIS INTO COPILOT OR CURSOR\n========================================\n\nYou are a senior QA automation engineer.\n\nGenerate jest unit tests for the following code.\n\nRules:\n- Cover happy path\n- Cover edge cases\n- Cover invalid inputs\n...\n========================================\n```\n\n### 3. Paste into your AI tool\n\n- GitHub Copilot Chat (`Cmd+Shift+I` in VS Code)\n- Cursor\n- ChatGPT\n- Claude\n- Any AI assistant\n\n### 4. Get complete test code\n\nThe AI generates comprehensive tests based on the prompt.\n\n## Usage\n\n### Command Syntax\n\n```bash\nsmart-testgen generate [options]\n```\n\n### Options\n\n| Option | Description | Required | Default |\n|--------|-------------|----------|---------|\n| `--file <path>` | Path to source file | Yes | - |\n| `--framework <name>` | Test framework (`jest`/`vitest`/`mocha`) | Yes | - |\n| `--type <type>` | Test type (`unit`/`integration`/`e2e`) | No | `unit` |\n| `--ide` | Generate prompt for IDE LLM | No | `true` |\n| `--output <path>` | Save prompt to file | No | - |\n\n### Examples\n\n#### Jest Unit Tests\n\n```bash\nsmart-testgen generate --file src/calculator.ts --framework jest --type unit --ide\n```\n\n#### Vitest Integration Tests\n\n```bash\nsmart-testgen generate --file src/api.ts --framework vitest --type integration --ide\n```\n\n#### Mocha E2E Tests\n\n```bash\nsmart-testgen generate --file src/app.ts --framework mocha --type e2e --ide\n```\n\n#### Save Prompt to File\n\n```bash\nsmart-testgen generate --file src/utils.ts --framework jest --type unit --ide --output prompt.txt\n```\n\n## Supported Frameworks\n\n| Framework | Command | Description |\n|-----------|---------|-------------|\n| **Jest** | `--framework jest` | Most popular for React/Node.js |\n| **Vitest** | `--framework vitest` | Fast, Vite-native testing |\n| **Mocha** | `--framework mocha` | Flexible testing framework |\n\n## Supported Test Types\n\n| Type | Command | Description |\n|------|---------|-------------|\n| **Unit** | `--type unit` | Test individual functions/components |\n| **Integration** | `--type integration` | Test module interactions |\n| **E2E** | `--type e2e` | Test complete user flows |\n\n## Programmatic Usage\n\n```typescript\nimport { TestGenerator } from 'smart-testgen';\n\nconst generator = new TestGenerator();\n\nconst result = await generator.generate({\n  filePath: 'src/utils.ts',\n  framework: 'jest',\n  testType: 'unit',\n  mode: 'ide'\n});\n\nconsole.log(result.prompt); // Copy this to your AI tool\n```\n\n## Why smart-testgen?\n\n### ✅ No API Costs\n\nNever calls OpenAI, Anthropic, or any LLM API. Use your existing Copilot/Cursor subscription or free AI tools.\n\n### ✅ Maximum Control\n\n- You decide which AI to use\n- You review prompts before sending\n- You control the output\n\n### ✅ Privacy First\n\n- No code sent to external APIs by this tool\n- You control what gets sent to AI\n- Works completely offline (until you paste to AI)\n\n### ✅ Framework Agnostic\n\n- Works with any AI tool\n- Not locked into one vendor\n- Future-proof\n\n## Workflow\n\n```\n┌─────────────────┐\n│  Your Code      │\n└────────┬────────┘\n         │\n         ▼\n┌─────────────────┐\n│  smart-testgen  │  ← Generates prompt\n└────────┬────────┘\n         │\n         ▼\n┌─────────────────┐\n│  Copy & Paste   │\n└────────┬────────┘\n         │\n         ▼\n┌─────────────────┐\n│  Your AI Tool   │  ← Copilot/Cursor/ChatGPT/Claude\n└────────┬────────┘\n         │\n         ▼\n┌─────────────────┐\n│  Test Code      │  ← Ready to use\n└─────────────────┘\n```\n\n## Help Commands\n\n```bash\n# Show version\nsmart-testgen --version\n\n# Show help\nsmart-testgen --help\n\n# Show framework information\nsmart-testgen help-frameworks\n```\n\n## Examples\n\n### Example 1: React Component\n\n```bash\nsmart-testgen generate --file src/components/Button.jsx --framework jest --type unit --ide\n```\n\n### Example 2: API Service\n\n```bash\nsmart-testgen generate --file src/services/userService.ts --framework vitest --type integration --ide\n```\n\n### Example 3: Utility Functions\n\n```bash\nsmart-testgen generate --file src/utils/validators.ts --framework mocha --type unit --ide\n```\n\n## Tips\n\n💡 **Start simple** - Try with a small file first to understand the prompt format\n\n💡 **Review prompts** - Check the generated prompt before pasting to AI\n\n💡 **Adjust as needed** - Modify prompts to match your project conventions\n\n💡 **Use --output** - Save prompts for reuse or documentation\n\n💡 **Try different types** - Experiment with unit, integration, and e2e tests\n\n## Requirements\n\n- Node.js 16.0.0 or higher\n- Any AI tool (Copilot, Cursor, ChatGPT, Claude, etc.)\n\n## Contributing\n\nContributions welcome! Please see the [GitHub repository](https://github.com/yourusername/smart-testgen).\n\n## License\n\nMIT © [Your Name]\n\n## Links\n\n- 🐛 [Report bugs](https://github.com/yourusername/smart-testgen/issues)\n- 💡 [Request features](https://github.com/yourusername/smart-testgen/issues)\n- 📖 [Documentation](https://github.com/yourusername/smart-testgen#readme)\n\n---\n\n**Made with ❤️ for developers who love AI-assisted testing**\n","readmeFilename":"README.md","_rev":"1-31cbd14029dbaa6023ef3f5d842cc661"}