| title | Git2Doc |
|---|---|
| emoji | π’ |
| colorFrom | red |
| colorTo | purple |
| sdk | docker |
| pinned | false |
| license | apache-2.0 |
Transform any GitHub repository into comprehensive technical documentation with AI-powered workflow diagrams β automatically.
Git2Doc is an intelligent documentation generator that converts GitHub repositories into professional, structured technical documentation using AI-powered analysis. It automatically:
- Analyzes code using Google's Gemini 2.0 Flash model
- Generates workflow diagrams showing project architecture
- Creates comprehensive documentation with proper formatting
- Produces professional PDFs with embedded diagrams
- Applies smart formatting with headings, lists, and bold text
- Scans entire GitHub repositories using GithubTools
- Identifies files, modules, functions, classes, and dependencies
- Understands code structure and relationships
- Extracts key technical information
- Creates high-level architectural diagrams (5-10 nodes)
- Visualizes project workflow and data flow
- Renders professional diagrams at 300 DPI
- Embeds diagrams directly into documentation
- Generates Introduction and Conclusion sections
- Documents all functions, classes, and methods
- Explains dependencies, integrations, and workflows
- Uses bold formatting for important concepts
- Properly structures content with clear headings
- Creates publication-ready PDFs
- Embeds workflow diagrams at optimal locations
- Supports custom typography (19.5pt headings, 11.5pt body)
- Includes numbered lists and proper spacing
- Handles image embedding and captions
Git2Doc follows this automated workflow:
Process Flow:
- main.py β Entry point, handles user input
- Repository Analysis β Analyzes GitHub repository structure
- GitHub API β Fetches repository data
- Gemini AI Model β Interprets code and generates documentation
- Documentation Generator β Creates structured content
- Workflow Generator β Produces workflow diagram JSON
- PDF Export β Generates final PDF with embedded diagram
- Technical Documentation β Final output files
Git2Doc/
βββ main.py # Main orchestration script
βββ doc_creation.py # PDF generation with image embedding
βββ generate_project_workflow.py # Workflow diagram renderer
βββ requirements.txt # Python dependencies
βββ pyproject.toml # Project configuration
βββ .env # Environment variables (create this)
βββ assets/ # Static assets
β βββ workflow_diagram.png # Sample workflow diagram
β βββ code2doc_documentation_preview.png
βββ examples/ # Sample outputs
βββ technical_documentation.pdf # Example generated documentation
After running Git2Doc, you'll get:
| File | Description |
|---|---|
content.txt |
Markdown-formatted documentation with diagram references |
technical_documentation.pdf |
Professional PDF with embedded workflow diagram |
project_workflow.json |
Structured workflow data (nodes and edges) |
project_workflow_diagram.png |
High-resolution workflow diagram (300 DPI) |
View Sample Documentation PDF β
The generated documentation includes:
- Introduction β Project overview and context
- Workflow Diagram β Visual architecture (automatically inserted)
- Architecture β Component breakdown
- Implementation Details β Functions, classes, and methods
- Dependencies β External integrations
- Conclusion β Key features and takeaways
- Project Documentation β Auto-generate README and technical docs
- Code Understanding β Quickly understand unfamiliar codebases
- Onboarding β Help new team members learn project structure
- Code Review β Get AI-powered insights into functionality
- Legacy Code β Document undocumented systems
- Architecture Diagrams β Visualize system workflows automatically
| Package | Purpose |
|---|---|
| agno | AI agent framework for orchestration |
| google-genai | Google Gemini AI integration |
| python-dotenv | Environment variable management |
| PyMuPDF (fitz) | PDF generation and manipulation |
| Pillow | Image processing for PDF embedding |
| graphviz | Workflow diagram rendering |
Install all dependencies:
uv sync # or pip install -r requirements.txtThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- AI-powered repository analysis
- Automatic workflow diagram generation
- PDF generation with embedded diagrams
- Professional formatting and typography
- Multiple output formats (Markdown, HTML)
- Batch processing for multiple repositories
- Custom documentation templates
- Integration with documentation platforms (Read the Docs, GitBook)
- Interactive web UI
- Code quality metrics and analysis
- Automated documentation updates on commits
- Multi-language support (currently Python-focused)
Star this repository if you find it helpful!


