Skip to main content
Get DocuGen AI up and running in minutes. This guide covers installation, prerequisites, and environment setup.

Prerequisites

Before installing DocuGen AI, ensure you have the following:

Python 3.11+

DocuGen AI requires Python version 3.11 or higher

Gemini API Key

A valid Google Gemini API key for AI-powered generation
You can check your Python version by running python --version or python3 --version in your terminal.

Install via pip

The easiest way to install DocuGen AI is using pip:
pip install docugen-ai
This will install DocuGen AI and all its dependencies:
  • typer>=0.12.0 - CLI framework
  • rich>=13.7.0 - Terminal formatting and output
  • jinja2>=3.1.0 - Template engine
  • google-genai>=1.0.0 - Google Gemini API client
It’s recommended to install DocuGen AI in a virtual environment to avoid dependency conflicts.

Installation with Virtual Environment

For a cleaner installation, use a Python virtual environment:
1

Create a virtual environment

python -m venv venv
2

Activate the virtual environment

source venv/bin/activate
3

Install DocuGen AI

pip install docugen-ai

Gemini API Key Setup

DocuGen AI requires a Google Gemini API key to function. You can obtain one from Google AI Studio.
Without a valid API key, DocuGen AI will not be able to generate documentation. The tool will exit with an error: Missing GEMINI_API_KEY (set it in environment or .env).

Option 1: Environment Variable

Set the API key as an environment variable:
export GEMINI_API_KEY="your-api-key-here"

Option 2: .env File

Create a .env file in your project root:
.env
GEMINI_API_KEY=your-api-key-here
DocuGen AI will automatically load the API key from the .env file when running.
Add .env to your .gitignore file to prevent accidentally committing your API key to version control.

Verify Installation

Verify that DocuGen AI is installed correctly:
docugen --help
You should see output similar to:
Usage: docugen [OPTIONS] COMMAND [ARGS]...

  Generate technical README files from Python projects.

Options:
  --help  Show this message and exit.

Commands:
  generate  Generate documentation for a Python project

Development Installation

If you want to contribute to DocuGen AI or install from source:
1

Clone the repository

git clone https://github.com/your-username/docugen-ai.git
cd docugen-ai
2

Create a virtual environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
3

Install in editable mode with dev dependencies

pip install -e ".[dev]"
This installs DocuGen AI along with development dependencies like pytest>=8.0.0.
4

Run tests to verify setup

pytest

Configuration Files (Optional)

DocuGen AI supports TOML configuration files for advanced customization. You can specify a config file using the --config flag:
docugen generate ./my-project --config config.toml
This allows you to pre-configure settings like model selection and output paths without specifying them on the command line each time.

Next Steps

Quick Start

Now that you have DocuGen AI installed, follow the Quick Start guide to generate your first documentation

Build docs developers (and LLMs) love