files-to-prompt is a Python command-line tool that takes one or more files or entire directories and concatenates their contents into a single, LLM-friendly prompt. It walks the directory tree, outputting each file preceded by its relative path and a separator, so a model can understand which content came from where. The tool is aimed at workflows where you want to ask an LLM questions about a whole codebase, documentation set, or notes folder without manually copying files together. It includes rich filtering controls, letting you limit by extension, include or skip hidden files, and ignore paths that match glob patterns or .gitignore rules. The output format is flexible: you can emit plain text, Markdown with fenced code blocks, or a Claude-XML style format designed for structured multi-file prompts. It can read file paths from stdin (including NUL-separated paths), which makes it easy to combine with find, rg, or other shell tools.

Features

  • Concatenates files or entire directories into a single, structured prompt for LLMs
  • Adds relative file paths and separators between files for clear context boundaries
  • Extension filters, include-hidden flag, ignore patterns and .gitignore integration for precise file selection
  • Multiple output formats, including plain text, Markdown with fenced code blocks, and Claude XML
  • Supports reading paths from stdin, with optional NUL-separated mode for filenames with spaces
  • Simple pip installation and a concise CLI interface built for shell pipelines

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow files-to-prompt

files-to-prompt Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of files-to-prompt!

Additional Project Details

Programming Language

Python

Related Categories

Python Large Language Models (LLM)

Registered

2025-11-27