Skip to content

Quick Reference

A handy reference for common Folder2MD4LLMs commands and patterns.

Basic Commands

# Convert current directory
folder2md .

# Convert specific directory
folder2md /path/to/project

# Specify output file
folder2md . --output summary.md

# With smart condensing
folder2md . --token-limit 80000 --smart-condensing

# Dry run (see what would be processed)
folder2md . --dry-run --verbose

File Filtering

Include Patterns

# Python files only
folder2md . --include-pattern "**/*.py"

# Multiple patterns
folder2md . --include-pattern "src/**/*.py" --include-pattern "*.md"

# Specific file types
folder2md . --include-pattern "**/*.{py,js,ts,md}"

Exclude Patterns

# Exclude tests
folder2md . --exclude-pattern "tests/**"

# Exclude multiple patterns
folder2md . --exclude-pattern "*.log" --exclude-pattern "tmp/**"

# Exclude build artifacts
folder2md . --exclude-pattern "**/build/**" --exclude-pattern "**/dist/**"

File Size Limits

# Set max file size (1MB = 1048576 bytes)
folder2md . --max-file-size 1048576

# Skip large files
folder2md . --max-file-size 512000

Smart Condensing

# Enable with token limit
folder2md . --smart-condensing --token-limit 80000

# Different strategies
folder2md . --smart-condensing --condense-strategy conservative
folder2md . --smart-condensing --condense-strategy balanced
folder2md . --smart-condensing --condense-strategy aggressive

# Preserve specific patterns
folder2md . --smart-condensing --preserve-pattern "**/main.py"

Output Options

# Custom output file
folder2md . --output project-summary.md

# Include statistics
folder2md . --stats

# Verbose output
folder2md . --verbose

# Quiet mode
folder2md . --quiet

Document Conversion

# Include document conversion
folder2md . --include-docs

# Specific document types
folder2md . --include-pattern "**/*.{pdf,docx,xlsx}"

Binary Analysis

# Enable binary file analysis
folder2md . --binary-analysis

# Include binary descriptions
folder2md . --binary-analysis --include-pattern "**/*.{png,jpg,zip}"

Configuration File

Create folder2md.yaml in your project root:

# Basic configuration
output: project-summary.md
token_limit: 80000
smart_condensing: true

# File patterns
include_patterns:
  - "src/**/*.py"
  - "**/*.md"
  - "requirements.txt"

exclude_patterns:
  - "tests/**"
  - "**/__pycache__/**"
  - "*.log"

# Processing options
max_file_size: 1048576
parallel: true
binary_analysis: true

Then run:

folder2md .

Common Use Cases

Code Review

folder2md . \
  --token-limit 100000 \
  --smart-condensing \
  --exclude-pattern "tests/**" \
  --exclude-pattern "docs/**" \
  --output code-review.md

Documentation

folder2md . \
  --include-docs \
  --include-pattern "**/*.{md,rst,py}" \
  --include-pattern "docs/**" \
  --output documentation.md

Project Analysis

folder2md . \
  --binary-analysis \
  --stats \
  --include-pattern "**" \
  --max-file-size 2097152 \
  --output analysis.md

LLM Context Preparation

folder2md . \
  --token-limit 80000 \
  --smart-condensing \
  --condense-strategy balanced \
  --include-pattern "src/**" \
  --include-pattern "*.md" \
  --output llm-context.md

Advanced Patterns

Large Codebase

# folder2md.yaml for large projects
token_limit: 150000
smart_condensing: true
condense_strategy: aggressive
parallel: true
max_file_size: 512000

include_patterns:
  - "src/**/*.{py,js,ts}"
  - "lib/**/*.{py,js,ts}"
  - "*.md"
  - "package.json"
  - "requirements.txt"

exclude_patterns:
  - "**/node_modules/**"
  - "**/__pycache__/**"
  - "**/dist/**"
  - "**/build/**"
  - "**/.git/**"
  - "tests/**"
  - "**/*.min.js"

Research Project

# folder2md.yaml for research
include_docs: true
binary_analysis: true
token_limit: 100000

include_patterns:
  - "**/*.{py,r,md,tex,pdf,docx}"
  - "data/**/*.csv"
  - "notebooks/**/*.ipynb"
  - "scripts/**"

exclude_patterns:
  - "**/.git/**"
  - "**/output/**"
  - "**/__pycache__/**"

Documentation Site

# folder2md.yaml for docs
include_docs: true
token_limit: 200000

include_patterns:
  - "docs/**/*.{md,rst}"
  - "*.md"
  - "**/*.{pdf,docx}"
  - "mkdocs.yml"
  - "conf.py"

exclude_patterns:
  - "docs/build/**"
  - "**/.git/**"

Environment Variables

# Set custom config file location
export FOLDER2MD_CONFIG=/path/to/custom/config.yaml

# Disable update checks
export FOLDER2MD_UPDATE_CHECK=false

# Set log level
export FOLDER2MD_LOG_LEVEL=DEBUG

Performance Tips

Large Projects

  • Use --parallel for multi-threading
  • Set appropriate --max-file-size limits
  • Use specific --include-pattern instead of processing everything
  • Enable --smart-condensing to manage output size

Memory Usage

  • Process large projects in smaller chunks
  • Use --exclude-pattern to skip unnecessary files
  • Set conservative file size limits

Speed Optimization

# Fast processing for large codebases
folder2md . \
  --parallel \
  --max-file-size 100000 \
  --exclude-pattern "**/*.{jpg,png,gif,pdf}" \
  --smart-condensing

Troubleshooting

Common Issues

# Check what files would be processed
folder2md . --dry-run --verbose

# Debug configuration
folder2md . --verbose --stats

# Test patterns
folder2md . --include-pattern "test/**" --dry-run

Memory Issues

# Reduce memory usage
folder2md . --max-file-size 50000 --exclude-pattern "**/*.{jpg,png,pdf}"

Token Limit Issues

# Check current token count
folder2md . --stats --dry-run

# Adjust condensing strategy
folder2md . --smart-condensing --condense-strategy aggressive

Getting Help

# General help
folder2md --help

# Version information
folder2md --version

# Configuration help
folder2md config --help

For more detailed information, check out: - Configuration Guide - Advanced Features - Community Support