A tool to convert folder structures and file contents into markdown for LLMs
Project description
folder2md4llms
folder2md4llms is a configurable tool that converts a repository's contents into a single, LLM-friendly Markdown file. It supports various file formats and provides options for content condensing and filtering.
✨ 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. - Parallel Processing: Uses multi-threading for processing multiple files concurrently.
- Advanced Filtering: Uses
.gitignore-style patterns to exclude files and directories.
🚀 Installation
⚠️ Requirements: Python 3.11 or higher is required.
Using Python 3.8-3.10? Install the legacy version:
pipx install folder2md4llms==0.2.0
# Check Python version first
python --version # Must be 3.11+
# Using pipx (recommended)
pipx install folder2md4llms
# Or using pip
pip install folder2md4llms
# Verify installation
folder2md --help
Note: Package name is
folder2md4llms, command isfolder2md
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.
🚨 Troubleshooting
Common Issues
"No matching distribution found for folder2md"
- Use the correct package name:
folder2md4llms(notfolder2md)
"Requires Python >=3.11" or incompatible Python version
- Check your Python version:
python --version - If you have Python 3.8-3.10, use the legacy version:
pipx install folder2md4llms==0.2.0 - To upgrade Python, see: https://www.python.org/downloads/
"Command 'folder2md' not found"
- Ensure pipx is installed:
pip install pipx - Try:
python -m folder2md4llms .
Platform-Specific Issues
Windows: Use WSL2 (Recommended)
For Windows users, we recommend using WSL2 (Windows Subsystem for Linux) for the best experience:
# Install WSL2 (run in PowerShell as Administrator)
wsl --install -d Ubuntu-22.04
# Then follow the Linux installation instructions in WSL2
This provides better compatibility and performance compared to native Windows installation.
Getting Help
- Command help:
folder2md --help - Version check:
folder2md --version - Alternative:
python -m folder2md4llms --help(works without installation) - Report issues: GitHub Issues
- Discussions: GitHub Discussions
🔧 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 CLI Reference.
🛠️ 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.
📖 Documentation
- CLI Reference - Complete command-line reference
- Contributing Guidelines - How to contribute to the project
- Changelog - Version history and changes
📦 Distribution Channels
- PyPI: folder2md4llms - Python package
📄 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.5.10.tar.gz.
File metadata
- Download URL: folder2md4llms-0.5.10.tar.gz
- Upload date:
- Size: 769.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
624a3bd62a4678f94dbec6a2d599c49f298ac76513c0b1e19a817eac5d083e79
|
|
| MD5 |
de56fbc4f1ebf84a42666484b288b0c5
|
|
| BLAKE2b-256 |
412f3e9cf25f8ff4913ef4310c08ff1d471c9e09c55b4fd138d8daf6e92d1329
|
Provenance
The following attestation bundles were made for folder2md4llms-0.5.10.tar.gz:
Publisher:
release.yml on HenriquesLab/folder2md4llms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
folder2md4llms-0.5.10.tar.gz -
Subject digest:
624a3bd62a4678f94dbec6a2d599c49f298ac76513c0b1e19a817eac5d083e79 - Sigstore transparency entry: 619605645
- Sigstore integration time:
-
Permalink:
HenriquesLab/folder2md4llms@df3a14ef529d6faefddfabe11cc577e42ecb8ed4 -
Branch / Tag:
refs/tags/v0.5.10 - Owner: https://github.com/HenriquesLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@df3a14ef529d6faefddfabe11cc577e42ecb8ed4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file folder2md4llms-0.5.10-py3-none-any.whl.
File metadata
- Download URL: folder2md4llms-0.5.10-py3-none-any.whl
- Upload date:
- Size: 126.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a96e7249f9674f53e7839827e748087855cbd3dc126eded8d5bfe669ea3d0b6
|
|
| MD5 |
9c1969ba95d1fec4a3592a77486ec34f
|
|
| BLAKE2b-256 |
a14368573748e71939564c805087b6e104026ec193e0740417156fd2c294c2da
|
Provenance
The following attestation bundles were made for folder2md4llms-0.5.10-py3-none-any.whl:
Publisher:
release.yml on HenriquesLab/folder2md4llms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
folder2md4llms-0.5.10-py3-none-any.whl -
Subject digest:
5a96e7249f9674f53e7839827e748087855cbd3dc126eded8d5bfe669ea3d0b6 - Sigstore transparency entry: 619605704
- Sigstore integration time:
-
Permalink:
HenriquesLab/folder2md4llms@df3a14ef529d6faefddfabe11cc577e42ecb8ed4 -
Branch / Tag:
refs/tags/v0.5.10 - Owner: https://github.com/HenriquesLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@df3a14ef529d6faefddfabe11cc577e42ecb8ed4 -
Trigger Event:
push
-
Statement type: