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

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
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

5 days ago