codebase-doc
v1.0.1
Published
AI-powered codebase documentation generator. Analyzes your code and generates beautiful, comprehensive documentation.
Maintainers
Readme
CodebaseDoc 📚
AI-Powered Codebase Documentation Generator Automatically analyze your codebase and generate beautiful, comprehensive documentation.
✨ Features
- 🔍 Auto-scan - Recursively scan your codebase and extract all modules, functions, classes, and exports
- 📝 JSDoc Support - Parse JSDoc comments and generate rich documentation
- 📊 Code Analysis - Get complexity metrics, file statistics, and dependency overview
- 🌐 HTML Output - Generate beautiful, responsive HTML documentation with sidebar navigation
- 📄 Markdown Output - Generate Markdown docs compatible with GitBook, Docusaurus, etc.
- 🖥️ Built-in Server - Start a local documentation server with one command
- ⚡ Lightweight - No database, no external services, works entirely offline
🚀 Quick Start
# Install globally
npm install -g codebase-doc
# Initialize config in your project
codebase-doc init
# Generate documentation
codebase-doc scan
# Start documentation server
codebase-doc serve --port 3000📖 Usage
codebase-doc init
Initialize a configuration file in your project directory:
codebase-doc init
codebase-doc init ./my-projectThis creates a codebase-doc.config.json file with customizable scan settings.
codebase-doc scan
Scan your codebase and generate documentation:
# Generate Markdown docs (default)
codebase-doc scan
# Generate HTML docs
codebase-doc scan --format html
# Custom output directory
codebase-doc scan --output ./docs --format html
# Use custom config
codebase-doc scan --config ./my-config.jsoncodebase-doc serve
Start a local documentation server:
# Default port 3000
codebase-doc serve
# Custom port
codebase-doc serve --port 8080
# Custom docs directory
codebase-doc serve --docs-dir ./my-docscodebase-doc analyze
Quick codebase analysis without generating docs:
codebase-doc analyze⚙️ Configuration
Edit codebase-doc.config.json to customize:
{
"name": "my-project",
"version": "1.0.0",
"scan": {
"include": ["src/**/*.js", "src/**/*.ts"],
"exclude": ["node_modules/**", "dist/**", "test/**"]
},
"output": {
"directory": "./docs",
"format": "markdown",
"theme": "default"
}
}📦 Output
HTML Documentation
- Responsive design with sidebar navigation
- Dark code blocks with syntax highlighting
- Module index with statistics
- Individual module pages with full details
Markdown Documentation
index.md- Project overview with statisticsmodules/- Individual module documentationSUMMARY.md- GitBook-compatible table of contents
🏗️ Architecture
codebase-doc/
├── bin/
│ └── codebase-doc.js # CLI entry point
├── src/
│ └── index.js # Core logic
├── templates/ # Output templates
├── test/ # Test suite
└── docs/ # Generated documentation📊 Example Output
When run on a typical Node.js project, CodebaseDoc generates:
docs/
├── index.html # Project overview with stats
├── index.js.html # Module documentation
├── app.js.html # Module documentation
└── ... # One page per module🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
MIT License - see LICENSE for details.
💖 Support
If you find CodebaseDoc useful, consider supporting development:
| Method | Address |
|--------|---------|
| 🌐 GitHub Sponsors | Sponsor on GitHub |
| ₿ Bitcoin | 0xeE5c0Ff16704Ce7bD8e06F4823D0EbbC2b8ecadA |
| 💎 Ethereum | 0xeE5c0Ff16704Ce7bD8e06F4823D0EbbC2b8ecadA |
Your support helps maintain and improve this project!
🙏 Acknowledgments
- Built with Commander.js for CLI
- Uses Minimatch for glob matching
- Inspired by JSDoc, TypeDoc, and esdoc
