Quick Start Examples
Basic Documentation Generation
Generate documentation for the current directory:README.md in the current directory with complete documentation of your Python project.
Generate for Specific Directory
Analyze a specific source directory:Output Customization
Custom Output Filename
Model Selection
Using Different Gemini Models
Choose the appropriate model based on your needs:Model Recommendations:
- Use
gemini-3.1-flash-lite-previewfor quick iterations and large projects - Use
gemini-profor production documentation with good balance - Use
gemini-ultrafor critical, public-facing documentation where quality is paramount
Custom AI Instructions
Using the —prompt Option
Customize the AI’s focus with additional instructions:Configuration-Based Workflows
Using TOML Configuration Files
- Project Configuration
- Personal Defaults
- Custom Config File
Setup:Create Usage:Result:
.docugen.toml in your project root:- Uses
gemini-promodel - Outputs to
docs/README.md - Settings are committed with the project
Environment-Based Workflows
Managing API Keys
Real-World Use Cases
Use Case 1: Open Source Project
Scenario: Maintain up-to-date README for a public GitHub repository. Setup:Use Case 2: Multi-Module Project
Scenario: Generate separate documentation for different modules. Project structure:Use Case 3: CI/CD Integration
Scenario: Automatically update documentation on each commit. GitHub Actions (.github/workflows/docs.yml):Use Case 4: Documentation Profiles
Scenario: Generate different documentation styles for different audiences. Setup multiple config files:Performance Tips
Use Flash Model
For large projects, use
gemini-3.1-flash-lite-preview (default) for faster generation:Target Specific Directories
Instead of scanning everything, target specific source directories:
Use .gitignore
DocuGen respects
.gitignore patterns, so keep it updated to skip unnecessary files automatically.Cache Results
In CI/CD, cache generated docs and only regenerate when Python files change:
Common Patterns
Pattern 1: Quick Iteration
Pattern 2: Multi-Language Output
Pattern 3: Staged Documentation
Troubleshooting Common Issues
No Python files found
No Python files found
Error:
No Python files found to analyze.Solutions:-
Verify you’re pointing to the correct directory:
-
Check that Python files aren’t being excluded by
.gitignore -
Use absolute paths if relative paths aren’t working:
API key errors
API key errors
Output not in expected location
Output not in expected location
Issue: Generated file is not where you expected.Check:
-
Relative paths are relative to the project directory, not current directory:
-
Use absolute paths for precise control:
Generation is slow
Generation is slow
Issue: Documentation takes a long time to generate.Solutions:
-
Use the faster model:
-
Target only necessary directories:
- Check your internet connection (API calls require network)
Next Steps
CLI Reference
Complete reference of all CLI commands and options
Configuration
Detailed guide to configuration files and environment variables
API Reference
Dive into the Python API for programmatic usage
Core Concepts
Understand how DocuGen works under the hood
