docugen-ai
v2.0.0
Published
AI-powered documentation generator with web dashboard, watch mode, diagrams, and multi-AI support
Maintainers
Readme
🤖 DocuGen AI v2.0.0
Next-Generation AI-Powered Documentation Generator - Automatically scan your codebase, analyze with multiple AI providers, and generate beautiful, organized documentation with web dashboard, diagrams, and coverage reports.
🎉 What's New in v2.0.0
- ✨ Multiple AI Providers - Claude, GPT-4, Gemini, Hugging Face, OpenRouter
- 🌐 Web Dashboard - Beautiful, searchable documentation viewer
- 👀 Watch Mode - Real-time doc updates as you code
- 📊 Visual Diagrams - Auto-generated architecture, class, and API flow diagrams
- 📈 Coverage Reports - Track documentation completeness
- 🚀 OpenAPI/Swagger - Auto-generate API specifications
- ⚡ 40% Faster - Improved parsing and batch AI processing
- 🎯 Better AI Analysis - Enhanced prompts for more accurate docs
✨ Key Features
- 🔍 Smart Code Scanning - Recursively scans and extracts functions, classes, APIs
- 🤖 Multi-AI Support - Use Claude, GPT-4, Gemini, or free alternatives
- 📚 Organized Output - API reference, guides, architecture, diagrams
- 🌐 Multi-Language - JavaScript, TypeScript, Python, Go, Rust, Java, C++, C#, Ruby, PHP
- 📝 Comprehensive Docs - Purpose, parameters, examples, use cases, complexity
- 🎯 Zero Config - Works out of the box
- 🌐 Web Dashboard - Search, navigate, and explore docs in your browser
- 👀 Watch Mode - Auto-regenerate when code changes
- 📊 Visual Diagrams - Mermaid diagrams for architecture
- 📈 Coverage Tracking - See what's documented vs undocumented
- 🆓 Free Tier - Use free AI APIs
🚀 Quick Start
Installation
npm install -g docugen-aiBasic Usage
# Generate docs
docugen-ai
# With watch mode
docugen-ai --watch
# With web dashboard
docugen-ai --serve
# Watch + serve
docugen-ai --watch --serveUsing Different AI Providers
# Use Claude (best quality)
docugen-ai --ai-provider anthropic --api-key sk-ant-xxx
# Use GPT-4
docugen-ai --ai-provider openai --api-key sk-xxx
# Use Gemini
docugen-ai --ai-provider gemini --api-key your-key
# Use free Hugging Face (default)
docugen-ai --ai-provider huggingface📋 What Gets Generated
docs-generated/
├── index.md # Overview + stats
├── web/ # Interactive web dashboard
│ ├── index.html # Beautiful UI
│ ├── styles.css # Dark theme
│ └── app.js # Search functionality
├── api-reference/
│ ├── functions.md # All functions with AI analysis
│ ├── classes.md # All classes
│ └── apis.md # API endpoints (if detected)
├── guides/
│ └── getting-started.md # Quick start guide
├── architecture/
│ └── overview.md # Project structure
├── diagrams/
│ ├── architecture.md # System architecture
│ ├── classes.md # Class hierarchy
│ └── api-flow.md # API flow diagrams
├── api-docs/
│ └── openapi.json # OpenAPI/Swagger spec
├── coverage-report.md # Documentation coverage
└── CHANGELOG.md # Auto-generated changelog🎯 AI Providers Comparison
| Provider | Quality | Speed | Cost | API Key Required | |----------|---------|-------|------|------------------| | Anthropic (Claude) | ⭐⭐⭐⭐⭐ | Fast | Paid | ✅ Yes | | OpenAI (GPT-4) | ⭐⭐⭐⭐⭐ | Fast | Paid | ✅ Yes | | Google (Gemini) | ⭐⭐⭐⭐ | Fast | Paid | ✅ Yes | | OpenRouter | ⭐⭐⭐⭐ | Medium | Free tier | ⚠️ Optional | | Hugging Face | ⭐⭐⭐ | Slow | Free | ⚠️ Optional |
Get API Keys
- Claude: https://console.anthropic.com/
- OpenAI: https://platform.openai.com/api-keys
- Gemini: https://makersuite.google.com/app/apikey
- OpenRouter: https://openrouter.ai/
- Hugging Face: https://huggingface.co/settings/tokens
🌐 Web Dashboard
The web dashboard provides:
- 🔍 Real-time search across all documentation
- 📱 Responsive design - works on mobile
- 🌙 Dark mode - easy on the eyes
- 📊 Statistics dashboard - project metrics at a glance
- 🎨 Beautiful UI - modern, professional design
Access at: docs-generated/web/index.html
Or serve live:
docugen-ai --serve
# Opens at http://localhost:8080👀 Watch Mode
Perfect for development:
docugen-ai --watch- Monitors your codebase for changes
- Auto-regenerates docs when files change
- Live reload support
- Minimal CPU usage
📊 Visual Diagrams
Auto-generates Mermaid diagrams:
Architecture Diagram
Shows project structure and file organization
Class Hierarchy
Visualizes class relationships and inheritance
API Flow
Displays API endpoint request/response flow
View in: docs-generated/diagrams/
📈 Coverage Reports
Track documentation completeness:
- Overall coverage percentage
- List of undocumented functions/classes
- Visual progress bar
- Recommendations for improvement
View at: docs-generated/coverage-report.md
🛠️ Advanced Usage
Configuration File
Create .docugenrc.json:
{
"projectPath": "./src",
"outputPath": "./docs",
"aiProvider": "anthropic",
"apiKey": "sk-ant-xxx",
"watch": true,
"serve": true,
"diagrams": true,
"coverage": true
}Then run:
docugen-ai --config .docugenrc.jsonEnvironment Variables
export AI_PROVIDER=anthropic
export AI_API_KEY=sk-ant-xxx
docugen-aiProgrammatic Usage
const DocuGenAI = require('docugen-ai');
const docugen = new DocuGenAI({
projectPath: './my-project',
outputPath: './docs',
aiProvider: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY,
watch: true,
serve: true
});
await docugen.generate();🎨 Documentation Example
Function Documentation
## calculateTotal(numbers, taxRate)
**File**: `src/utils/math.js`
**Type**: function
**Documented**: ✅
### Purpose
Calculates the total sum of an array of numbers with optional tax rate applied.
### Parameters
- `numbers` - Array of numbers to sum
- `taxRate` - Optional tax rate (decimal, default: 0)
### Returns
Number - The calculated total with tax applied
### Complexity
O(n) where n is the array length
### Example Usage
```javascript
const items = [10, 20, 30];
const total = calculateTotal(items, 0.08);
console.log(total); // 64.8Common Use Cases
- Shopping cart total calculation
- Invoice generation with tax
- Financial reporting
## 📊 Comparison with Other Tools
| Feature | DocuGen AI v2 | JSDoc | Sphinx | TypeDoc |
|---------|--------------|-------|--------|---------|
| AI Analysis | ✅ | ❌ | ❌ | ❌ |
| Multi-Language | ✅ | ❌ | Python only | TS only |
| Web Dashboard | ✅ | ❌ | ✅ | ✅ |
| Watch Mode | ✅ | ❌ | ❌ | ✅ |
| Diagrams | ✅ | ❌ | ❌ | ❌ |
| Coverage Reports | ✅ | ❌ | ❌ | ❌ |
| Zero Config | ✅ | ❌ | ❌ | ❌ |
| OpenAPI Generation | ✅ | ❌ | ❌ | ❌ |
## 🎓 Supported Languages
- ✅ JavaScript (.js, .jsx)
- ✅ TypeScript (.ts, .tsx)
- ✅ Python (.py)
- ✅ Go (.go)
- ✅ Rust (.rs)
- ✅ Java (.java)
- ✅ C++ (.cpp, .hpp)
- ✅ C# (.cs)
- ✅ Ruby (.rb)
- ✅ PHP (.php)
## 💡 Tips & Best Practices
1. **Use Claude for Best Results**: Most accurate AI analysis
2. **Enable Watch Mode**: Real-time updates during development
3. **Serve the Dashboard**: Better experience than markdown viewers
4. **Start Small**: Test on a single directory first
5. **Review Coverage**: Aim for >80% documentation coverage
6. **Use Diagrams**: Great for README and presentations
7. **API Projects**: Auto-generated OpenAPI specs save hours
## 🆘 Troubleshooting
**Slow AI processing?**
- Use faster AI provider (Claude, GPT-4)
- Process smaller batches
- Consider caching AI responses
**Watch mode not working?**
- Check file permissions
- Verify chokidar is installed: `npm install chokidar`
**Diagrams not generating?**
- Ensure Mermaid syntax is supported
- Check browser/viewer compatibility
**Web dashboard not loading?**
- Try: `docugen-ai --serve`
- Check port 8080 is available
## 🚀 Roadmap
### v2.1.0 (Coming Soon)
- [ ] VS Code extension
- [ ] GitHub Actions integration
- [ ] PDF export
- [ ] Custom themes
- [ ] Multi-language docs (i18n)
### v2.2.0 (Future)
- [ ] Confluence/Notion export
- [ ] Video tutorial generation
- [ ] AI chat with your docs
- [ ] Browser extension
- [ ] Slack/Discord integration
## 🤝 Contributing
We welcome contributions!
1. Download the source
2. Make improvements
3. Test thoroughly
4. Share via npm or email
## 📄 License
MIT License - See LICENSE file
## 🙏 Credits
- Powered by Anthropic Claude, OpenAI GPT, Google Gemini
- Uses Hugging Face and OpenRouter for free tiers
- Built with Node.js, Express, Chokidar
- Diagrams with Mermaid
## 📞 Support
- 📧 **Email**: [email protected]
- 💬 **NPM**: Comment on package page
- 📖 **Docs**: See README and examples
---
**Made with ❤️ and AI**
*If this helped you, share it with others!* 🚀
## 🌟 Star History
If you find DocuGen AI useful, consider:
- ⭐ Starring on NPM
- 📢 Sharing with your team
- 💬 Leaving feedback
---
**v2.0.0 - The Future of Documentation is Here** 🎉