A simple Python tool that recursively gathers all Markdown files in a directory and merges them into a single combined document with separators and size confirmation.
CombineMD is a lightweight Python utility that recursively scans a directory and merges all Markdown files into a single consolidated document, inserting separators between entries and confirming estimated size before generation.
- Recursively detects all
.mdfiles under the current directory - Generates a single
combined.mdfile in sorted order - Inserts a clear separator (
&& && && &&) between merged files - Estimates the final file size and prompts the user before writing
- Automatically ignores the output file if it already exists
- Requires no external dependencies
- Place the script (
combinemd.py) in the directory whose Markdown files you want to merge. - Run the script from the terminal:
python combinemd.py- Review the estimated combined size and confirm to proceed.
A new file named combined.md will be created in the same directory. It will contain all Markdown files in sorted order with separators for easy navigation.
CombineMD is ideal for consolidating prompt notes, agent definitions, writing archives, documentation fragments, or any multi-file Markdown knowledge base into a single file for backup or review.
- Python 3.7 or later
This project is licensed under the GNU Affero General Public License v3.0.
See the LICENSE file for full details.