Configuration Overview
DocuGen AI supports multiple configuration methods with a clear precedence order. This allows you to set defaults globally while overriding them per-project or per-command.Configuration Precedence
Configuration values are resolved in the following order (highest to lowest priority):- CLI arguments - Direct command-line options
- TOML configuration files - Project or user config files
- Default values - Built-in defaults
Configuration Methods
- CLI Arguments
- TOML Files
- Environment Variables
- .env Files
Command-Line Options
The most direct way to configure DocuGen is via CLI arguments. These always take precedence over other configuration methods.--output,-o- Output file path--model- Gemini model name--prompt,-p- Additional AI instructions--config- Path to TOML config file
Configuration Parameters
API Key
Source:
GEMINI_API_KEY environment variable or .env fileYour Google Gemini API key. Obtain one from Google AI Studio.Resolution order:GEMINI_API_KEYenvironment variableGEMINI_API_KEYin.envfile (current directory)GEMINI_API_KEYin.envfile (DocuGen installation directory)
Model
Sources: CLI
--model, TOML model keyThe Gemini model to use for generating documentation.Popular options:gemini-3.1-flash-lite-preview- Fastest, recommended for most projectsgemini-pro- Balanced performance and qualitygemini-ultra- Highest quality, slower
--modelCLI argumentmodelin TOML config file- Default:
"gemini-3.1-flash-lite-preview"
Output Path
Sources: CLI
--output, TOML output keyPath where the generated documentation will be written.- Relative paths are resolved from the project directory
- Absolute paths are used as-is
- Parent directories are created automatically
--output(or-o) CLI argumentoutputin TOML config file- Default:
"README.md"
Custom Prompt
Source: CLI
--prompt onlyAdditional instructions for the AI to customize the generated documentation.This parameter is only available via CLI (not TOML) as it’s typically unique per-generation.Complete Configuration Examples
Example 1: Personal Development Setup
~/.config/docugen/config.toml:Example 2: Project-Specific Configuration
Project structure:Example 3: Team Shared Configuration
Committed to repository: .docugen.toml:Example 4: Override Everything via CLI
Troubleshooting
Missing GEMINI_API_KEY error
Missing GEMINI_API_KEY error
Error:
Missing GEMINI_API_KEY (set it in environment or .env).Solutions:-
Set the environment variable:
-
Create a
.envfile in your project directory: -
Verify the variable is set:
Configuration file not found
Configuration file not found
Issue: DocuGen isn’t using your TOML configuration.Check:
-
Verify the file exists in one of the search locations:
-
Check for TOML syntax errors:
-
Specify explicitly:
.env file not being loaded
.env file not being loaded
Issue: Environment variables from
.env aren’t being used.Solutions:-
Verify file location:
-
Check file format (no spaces around
=): -
Specify explicitly:
Best Practices
Use .env for Secrets
Store API keys in
.env files and add them to .gitignore. Never commit secrets to version control.Use TOML for Defaults
Set project or user defaults in TOML files. Commit project configs (without secrets) to share with team.
Use CLI for Overrides
Override defaults with CLI arguments for one-off customizations or testing.
Document for Teams
Include
.env.example and .docugen.toml in your repository to help team members get started quickly.