Skip to main content

Overview

DocuGen AI provides a command-line interface for generating technical documentation from Python projects. The CLI is built with Typer and offers a simple yet powerful interface.

Installation

After installing the package, the docugen command is available globally:
pip install docugen-ai

Command Structure

docugen [COMMAND] [ARGUMENTS] [OPTIONS]

Commands

generate

Generates a technical README file from a Python project by analyzing its source code.
docugen generate PATH [OPTIONS]

Arguments

PATH
string
required
Path to the Python project directory to analyze. Can be absolute or relative.Examples:
  • . - Current directory
  • ./src - Source subdirectory
  • /home/user/project - Absolute path

Options

--output
string
default:"README.md"
Aliases: -oOutput Markdown file name. Can be a filename or a path.
  • If relative, the file is created inside the project directory
  • If absolute, the file is created at the specified location
  • Parent directories are created automatically if they don’t exist
Examples:
docugen generate . --output DOCUMENTATION.md
docugen generate . -o docs/README.md
docugen generate . -o /tmp/output.md
--model
string
default:"gemini-3.1-flash-lite-preview"
Gemini model name to use for content generation.Supported models:
  • gemini-3.1-flash-lite-preview (default, fastest)
  • gemini-pro (balanced performance)
  • gemini-ultra (highest quality)
Examples:
docugen generate . --model gemini-pro
docugen generate . --model gemini-ultra
--prompt
string
Aliases: -pOptional additional instruction to customize the AI’s documentation generation. Use this to emphasize specific aspects or request particular formatting.Examples:
docugen generate . --prompt "Focus on API security best practices"
docugen generate . -p "Include installation instructions for Windows"
docugen generate . -p "Emphasize performance optimizations"
--config
path
Path to a TOML configuration file. If not specified, DocuGen will search for configuration files in standard locations.Examples:
docugen generate . --config ./custom-config.toml
docugen generate . --config ~/.config/docugen/project.toml

Complete Examples

# Generate README.md in the current directory
docugen generate .

Exit Codes

DocuGen uses standard exit codes to indicate success or failure:
CodeMeaning
0Success - Documentation generated successfully
1Error - Invalid path, missing API key, no Python files found, or generation failed

Output Information

When generation completes successfully, DocuGen displays:
  • Location of the generated documentation file
  • Statistics about the analyzed project:
    • Number of files scanned
    • Number of classes found
    • Number of functions found
    • Number of methods found
Example output:
✓ Documentation generated at: /home/user/project/README.md
ℹ Scanned 15 files, 8 classes, 42 functions, 67 methods.

Help Command

Get help information directly from the CLI:
# Show general help
docugen --help

# Show help for the generate command
docugen generate --help

Build docs developers (and LLMs) love