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
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
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

18 hours ago