A tool to convert folder structures and file contents into markdown for LLMs
Project description
folder2md4llms
folder2md4llms is a powerful and flexible tool that converts a repository's contents into a single, LLM-friendly Markdown file. It's designed to be fast, configurable, and easy to use, with a focus on producing high-quality, structured output.
✨ Key Features
- Smart Condensing: Automatically condenses code to fit within a specified token or character limit without crude truncation.
- Document Conversion: Converts PDF, DOCX, XLSX, and other document formats into text.
- Binary File Analysis: Provides intelligent descriptions for images, archives, and other binary files.
- Highly Configurable: Use a
folder2md.yamlfile or command-line options to customize the output. - Fast and Efficient: Leverages multi-threading and efficient file processing to handle large repositories quickly.
- Advanced Filtering: Uses
.gitignore-style patterns to exclude files and directories.
🚀 Quick Start
Installation
Choose between binary (standalone) or Python package installation:
🚀 Binary Installation (Recommended)
No Python required - fastest startup, single executable
macOS (Homebrew):
# Binary version (cask) - recommended
brew install --cask henriqueslab/tap/folder2md4llms-binary
Windows (Scoop):
# Add the bucket
scoop bucket add henriqueslab https://github.com/HenriquesLab/scoop-folder2md4llms
# Binary version - recommended
scoop install folder2md4llms-binary
Manual Binary Installation:
- Download the appropriate binary from GitHub Releases:
- macOS:
folder2md-macos-x64(Intel) orfolder2md-macos-arm64(Apple Silicon) - Windows:
folder2md-windows-x64.exe - Linux:
folder2md-linux-x64
- macOS:
- Make executable (macOS/Linux):
chmod +x folder2md-* - Move to PATH:
sudo mv folder2md-* /usr/local/bin/folder2md
🐍 Python Package Installation
Requires Python 3.11+ - integrates with Python environment
# Using uv (recommended)
uv add folder2md4llms
# Using pip
pip install folder2md4llms
Binary vs Python Package
| Feature | Binary | Python Package |
|---|---|---|
| Python Required | ❌ No | ✅ Yes (3.11+) |
| Startup Time | ⚡ Fast | 🐌 Slower |
| File Size | 📦 ~50MB | 📦 ~10MB |
| Dependencies | ✅ Self-contained | ⚠️ May conflict |
| Updates | 🔄 Manual/Package Manager | 🔄 pip/uv |
| Use Case | General users, CI/CD | Python developers |
Basic Usage
# Process the current directory and save to output.md
folder2md .
# Process a specific directory and set a token limit
folder2md /path/to/repo --limit 80000t
# Copy the output to the clipboard
folder2md /path/to/repo --clipboard
# Generate a .folder2md_ignore file
folder2md --init-ignore
For a full list of commands and options, see the CLI Reference or run folder2md --help.
🔧 Configuration
You can configure folder2md4llms by creating a folder2md.yaml file in your repository's root directory. This allows you to set advanced options and define custom behavior.
For more details, see the Configuration Guide.
🛠️ Development
Interested in contributing? Get started with these simple steps:
# Clone the repository
git clone https://github.com/henriqueslab/folder2md4llms.git
cd folder2md4llms
# Set up the development environment
make setup
# See all available commands
make help
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For more information, see the Contributing Guidelines.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file folder2md4llms-0.4.40.tar.gz.
File metadata
- Download URL: folder2md4llms-0.4.40.tar.gz
- Upload date:
- Size: 262.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e53217b41068403aaf7d4709d0d8ca048def976c2053c0af4d6a88f7937253af
|
|
| MD5 |
23515181d8b8fc3d01cdb185030d216e
|
|
| BLAKE2b-256 |
305935c78d6cb1251228f39d76a00cd0655fdab3ad1fb1a2bfaa8cf6ea2ef7fc
|
File details
Details for the file folder2md4llms-0.4.40-py3-none-any.whl.
File metadata
- Download URL: folder2md4llms-0.4.40-py3-none-any.whl
- Upload date:
- Size: 110.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc1fc47e928123bb3518ed4217d8ca71bc6000e9680e90e85fd04a0a1316a42e
|
|
| MD5 |
25c1055b709869462395a158089e284a
|
|
| BLAKE2b-256 |
a7fc3fedd8bce2531c019b1468a0f80576351a268269c56a5b797dfc276fc547
|