Skip to main content

A tool to convert folder structures and file contents into markdown for LLMs

Project description

folder2md4llms

Tests Release Python 3.11+ License: MIT

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.yaml file 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:

  1. Download the appropriate binary from GitHub Releases:
    • macOS: folder2md-macos-x64 (Intel) or folder2md-macos-arm64 (Apple Silicon)
    • Windows: folder2md-windows-x64.exe
    • Linux: folder2md-linux-x64
  2. Make executable (macOS/Linux): chmod +x folder2md-*
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

folder2md4llms-0.4.39.tar.gz (246.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

folder2md4llms-0.4.39-py3-none-any.whl (110.1 kB view details)

Uploaded Python 3

File details

Details for the file folder2md4llms-0.4.39.tar.gz.

File metadata

  • Download URL: folder2md4llms-0.4.39.tar.gz
  • Upload date:
  • Size: 246.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for folder2md4llms-0.4.39.tar.gz
Algorithm Hash digest
SHA256 7bcd2865f09b241788ca1043e5eeaa4197a7489f0e8c071940758a51f68700b2
MD5 9033b34edb1b7522efd45e6066338f7b
BLAKE2b-256 5db51428d506777db76686e427169b22417a58cedd6f01a8fa1b9cfec8e45269

See more details on using hashes here.

File details

Details for the file folder2md4llms-0.4.39-py3-none-any.whl.

File metadata

File hashes

Hashes for folder2md4llms-0.4.39-py3-none-any.whl
Algorithm Hash digest
SHA256 683246df84777941f917350d160d174b49c30637b6b68a972964c69cb11e6e17
MD5 c95077ce4007e3f609e3a3fc6c3119ca
BLAKE2b-256 6df8d360882895c0c909c73d9bc376f6ce79e757f69609e817e5c7b03564bfd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page