Getting Started

Quick Start

Get up and running with m1f in minutes

Get started with m1f in just a few minutes. This guide will walk you through the most common use cases.

Your First Bundle

1. Basic File Combination

# Combine all files in current directory
m1f -s . -o my-project.txt

# Combine specific directory
m1f -s ./src -o source-code.txt

# Force overwrite if file exists
m1f -s ./src -o source-code.txt -f

2. Filter by File Type

# Only Python files
m1f -s . -o python-code.txt --include-extensions .py

# Multiple file types
m1f -s . -o docs.txt --include-extensions .md .txt .rst

# Exclude certain types
m1f -s . -o output.txt --exclude-extensions .pyc .log .tmp

3. Exclude Directories

# Exclude common build directories
m1f -s . -o output.txt --excludes "node_modules/" "build/" "dist/"

# Use your .gitignore file
m1f -s . -o output.txt --exclude-paths-file .gitignore

Project Initialization

The fastest way to get started with any project:

# Initialize m1f in your project
cd /your/project
m1f-init

This creates several useful files:

  • m1f/<project>_complete.txt - Full project bundle
  • m1f/<project>_docs.txt - Documentation bundle
  • m1f/<project>_complete_filelist.txt - List of included files
  • .m1f.config.yml - Configuration file

Common Use Cases

Documentation Bundle

Perfect for feeding documentation to AI assistants:

m1f -s ./docs -o documentation.txt \
    --include-extensions .md .rst .txt \
    --separator-style Markdown

Source Code Bundle

Bundle your source code for code review or AI analysis:

m1f -s ./src -o source-code.txt \
    --include-extensions .py .js .ts .jsx .tsx \
    --excludes "*.test.*" "*.spec.*" \
    --max-file-size 500KB

WordPress Theme/Plugin

Bundle WordPress PHP files:

m1f -s ./wp-content/themes/mytheme -o theme.txt \
    --include-extensions .php .js .css \
    --excludes "node_modules/" "vendor/"

Clean Documentation Export

Remove metadata from scraped documentation:

m1f -s ./scraped_docs -o clean-docs.txt \
    --include-extensions .md \
    --remove-scraped-metadata \
    --separator-style Markdown

File Extraction

Extract files from a combined bundle:

# Basic extraction
m1f-s1f ./combined.txt ./extracted_files

# Force overwrite existing files
m1f-s1f ./combined.txt ./extracted_files -f

# List files without extracting
m1f-s1f --list ./combined.txt

Web Scraping Workflow

Download and process web documentation:

# 1. Download website
m1f-scrape https://docs.example.com -o ./html_files

# 2. Convert to Markdown
m1f-html2md convert ./html_files -o ./markdown \
    --content-selector "main.content"

# 3. Bundle for AI consumption
m1f -s ./markdown -o ./docs_bundle.txt \
    --remove-scraped-metadata

Security Scanning

Scan files for secrets before bundling:

# Stop if secrets found
m1f -s . -o output.txt --security-check abort

# Skip files with secrets
m1f -s . -o output.txt --security-check skip

# Include all files but show warning
m1f -s . -o output.txt --security-check warn

Output Formats

Markdown Format

Perfect for documentation:

m1f -s . -o output.md --separator-style Markdown

Machine Readable

For programmatic processing:

m1f -s . -o output.txt --separator-style MachineReadable

No Separators

Just concatenate files:

m1f -s . -o output.txt --separator-style None

Size Management

Handle large files and directories:

# Skip files over 100KB
m1f -s . -o output.txt --max-file-size 100KB

# Include only small text files
m1f -s . -o small.txt --max-file-size 50KB --include-extensions .txt .md

Backup and Archive

Create backups while bundling:

# Create zip backup
m1f -s . -o output.txt --create-archive

# Create tar.gz backup
m1f -s . -o output.txt --create-archive --archive-type tar.gz

Quick Reference

Most Common Commands

# Basic bundling
m1f -s . -o output.txt

# Documentation only
m1f -s . -o docs.txt --docs-only

# With exclusions
m1f -s . -o output.txt --exclude-paths-file .gitignore

# Multiple directories
m1f -s ./src -s ./docs -o combined.txt

# With timestamp
m1f -s . -o output.txt -t

Essential Options

OptionPurpose
-sSource directory
-oOutput file
-fForce overwrite
-tAdd timestamp
-vVerbose output
--docs-onlyDocumentation files only
--max-file-sizeSize limit
--excludesExclude paths

Next Steps

Now that you’ve got the basics down:

  1. Learn more about tools: Explore s1f, html2md, and scrape
  2. Advanced features: Check out presets and auto-bundling
  3. AI integration: See Claude integration for AI-powered workflows
  4. Security: Read security best practices

Getting Help

Happy bundling! 🎉