simonw

files-to-prompt: Turn Files into LLM Prompts

A Python command-line tool that gathers file contents into a single prompt, with options for filtering and formatting the output. Useful for developers preparing code or documents as context for an LLM.

InactivePythonApache-2.0CLILLMPrompt Engineering
View on GitHub Compare
Stars
2.8k
Forks
183
Stars, last 30 days
+10
Last commit
1.6 years ago
Contributors
8

Our take

Inactiveno commits in over a year

Health score

24/100

How it is scored
Activity
19
Community
36
Issues
21
Pull requests
20

+10 stars in the last 30 days

This is a focused, practical prompt-preparation utility, but its inactive maintenance status and reliance on one main contributor warrant caution for long-term adoption.

Good fit if

  • You want a lightweight Python CLI to assemble local files into LLM-ready text.
  • Your workflow benefits from filtering paths or choosing XML, Markdown, or line-numbered output.
  • You can use it as-is and are comfortable with its Apache-2.0 license.

Look elsewhere if

  • Your workflow requires a project with recent maintenance or active issue handling.
  • You need a built-in LLM integration rather than a tool that produces text for another application.
  • You want a project whose development is not concentrated around one contributor.
All health signals
Last commit2025-02-19 (1.6 years ago)
Commits, last 90 days0
Releases, last 12 months0 (latest 0.6, 2025-02-19)
Contributors8 (top contributor: 79% of commits)
Issues closed, last 90 days0
Project age2 years

Checked on 2026-10-07 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

2,806

Forks

186

Change since Nov 17, 2026: 0 stars·0 forks

Overview

files-to-prompt collects files from paths you provide and combines their contents into one output, labeled with each file's path. It helps developers package local code or documents as context for an LLM without copying files individually.

It is a small command-line utility rather than an LLM client: you choose the files, then send the generated output to your preferred tool. Output options include Claude XML, Markdown code fences, and line numbers.

Key Features

  • Accepts files and directories as command-line arguments, as well as paths piped through standard input.
  • Filters files by extension and supports ignore patterns and hidden-file inclusion.
  • Respects .gitignore by default, with an option to include ignored files.
  • Formats output as plain text, Claude XML, or Markdown with language-tagged code fences.
  • Can add line numbers or write the result to an output file.
  • Supports NUL-separated paths from stdin for filenames containing spaces.

Use Cases

  • A developer can bundle selected source files to provide an LLM with context for a code question.
  • A team can collect documentation or configuration files for review without manually concatenating them.
  • A user can pipe a list of recently changed files into the tool to prepare a focused prompt.
  • Someone preparing content for Claude can use XML output to organize multiple documents.

What you need

Detected in the repository

  • Python >=3.8 (from pyproject.toml)
  • A test suite and automated checks on GitHub Actions

License in plain words

Apache-2.0permissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the license, the NOTICE file and a note of your changes
  • Share your changes: no
  • Includes an explicit patent grant from the contributors:

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

Install with pip and pass one or more paths:

pip install files-to-prompt
files-to-prompt path/to/directory

See the README for filtering and output options.

Considerations

The repository is marked inactive: it has had no commits or releases in over a year, and no issues were closed recently. Most contributions come from one person, so ongoing maintenance may depend heavily on that contributor. The tool requires Python 3.8 or newer; the supplied project details do not indicate a GPU, database, or container requirement. The README describes formatting and file-selection options, but not an integrated LLM workflow.

Found this useful?

Share it with someone who would like files-to-prompt.