This document describes how Doc Gen can be configured.
DocGen works out of the box with sensible defaults and typically requires little or no configuration.
Configuration may be provided through:
- Command-line options
- Configuration files
By default, DocGen:
- Scans the current directory
- Generates
docs/project_structure.md - Uses the "default" profile
- Shows full directory tree
- Does not include hidden files
Example:
doc-gen structure generateMost configuration is provided through command-line options.
doc-gen structure generate --profile minimal
doc-gen structure generate --profile default
doc-gen structure generate --profile detaileddoc-gen structure generate --smartSmart mode automatically adjusts:
- Maximum depth based on project size
- File visibility based on project complexity
- Directory collapsing
doc-gen structure generate --max-depth 2
doc-gen structure generate --max-depth 5doc-gen structure generate --show-files
doc-gen structure generate --hide-filesdoc-gen init --dry-run
doc-gen structure generate --dry-runDry-run blocks initialization and generated Markdown writes while allowing read-only scanning and preview rendering.
Doc Gen looks for configuration in:
.config/doc_gen/config.toml
Priority:
CLI Options
↓
Project Configuration (`.config/doc_gen/config.toml`)
↓
Default Settings
Create .config/doc_gen/config.toml:
[tool.doc-gen.cli.execution]
dry_run = false
[tool.doc-gen.cli.structure]
# Profile: minimal, default, or detailed
profile = "default"
# Maximum directory depth
max_depth = 3
# Show individual files
show_files = true
# Enable smart mode
smart_mode = false
# Optional primary-type override. Leave unset for automatic detection.
# project_type = "laravel"Automatic detection combines safe repository markers from multiple ecosystems. For example, a Google Apps Script repository can contribute JavaScript, TypeScript, clasp, and Apps Script metadata at the same time. Supported primary overrides are:
generic, python, django, flask, fastapi,
nodejs, reactjs, nextjs, google-apps-script,
php, laravel, go, gin
Use an override from the CLI when automatic detection needs help:
doc-gen structure generate --project-type google-apps-scriptThe override selects the primary project label. Safe secondary signals may still extend the metadata and ignore rules. Doc Gen never reads local clasp credential configuration while detecting Google Apps Script projects.
When multiple configuration sources exist, the following priority should apply:
Command Line Arguments
↓
Project Configuration (`.config/doc_gen/config.toml`)
↓
Built-in Defaults
Store project configuration files in version control.
The canonical project configuration is .config/doc_gen/config.toml.
Only override settings when necessary.
The configured output remains fully project-controlled:
[tool.doc-gen.cli.structure.generate]
output_file = "docs/project_structure.md"Doc Gen writes the selected Markdown file with UTF-8 encoding, LF line endings,
no trailing spaces or tabs, no repeated blank lines, and exactly one final
newline. This keeps the generated artifact compatible with common
trailing-whitespace and end-of-file-fixer pre-commit hooks and minimizes
formatter-only changes.
Doc Gen does not execute project-owned formatters or hooks automatically. Projects with additional Markdown policies should still validate the generated file with their normal quality workflow.
Avoid machine-specific settings whenever possible.
- Installation Guide
- Usage Guide
- Project Structure Guide
- Developer Guide
- Dry-run Safety Guide
- Infrastructure Guide