docgen is a fast and intelligent documentation generator that compiles your entire project structure and source code into a single text file. Ideal for sharing with AI tools, it offers features like visual directory trees, smart filtering, and automatic binary detection, making project documentation easy and efficient.
docgen
docgen is an efficient and sophisticated project documentation generator designed to compile an entire project's structure and source code into a single, accessible text file. This tool is particularly beneficial for sharing comprehensive project context with Language Learning Models (LLMs) — simply upload one file in an AI chat to facilitate discussions about the entire project.
.gitignore rules and allows for custom exclusions to maintain relevant content..docgen_ignore file.git check-ignore to implement accurate filtering based on repository settings.Run docgen from the root directory of your project to generate documentation:
# Generate documentation, creating project_doc.txt
docgen
# Preview files for inclusion
docgen --files-list
# Display directory tree structure
# With symbols
docgen --graphic-tree
# Plain text version
docgen --plain-tree
# Specify a custom output location
docgen --output docs/my_project.txt
A .docgen_ignore file can be added to your project root to precisely control which files are included or excluded. The file follows .gitignore syntax:
# Always include
!.gitignore
!some_important_non_binary_file.foo
# Exclude patterns
.git/
log/
scratch.txt
junk/
If no .docgen_ignore file is present, docgen applies default rules for inclusion and exclusion, ensuring a streamlined experience.
The generated project_doc.txt will contain a clear structure:
# DOCGEN-OUTPUT: This file is generated by docgen. Do not include in next generation.
>>>> PROJECT FILE TREE: >>>>>>>>>>>>>>>>>>>>>>>>>>
.
├── main.go
├── README.md
└── go.mod
<<<< END OF FILE TREE: <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>> FILE CONTENTS: main.go >>>>>>>>>>>>>>>>>>>>>>>
package main
...
<<<< END OF FILE: main.go <<<<<<<<<<<<<<<<<<<<<<<<
Committing the generated documentation to your version control system is advisable due to:
Contributors are welcomed. For suggestions, issues, or pull requests, feel free to engage with the project.
No comments yet.
Sign in to be the first to comment.