Simon Willison’s Weblog

Subscribe

files-to-prompt 0.6. New release of my CLI tool for turning a whole directory of code into a single prompt ready to pipe or paste into an LLM.

Here are the full release notes:

  • New -m/--markdown option for outputting results as Markdown with each file in a fenced code block. #42
  • Support for reading a list of files from standard input. Thanks, Ankit Shankar. #44
    Here's how to process just files modified within the last day:

    find . -mtime -1 | files-to-prompt
    

    You can also use the -0/--null flag to accept lists of file paths separated by null delimiters, which is useful for handling file names with spaces in them:

    find . -name "*.txt" -print0 | files-to-prompt -0
    

I also have a potential fix for a reported bug concerning nested .gitignore files that's currently sitting in a PR. I'm waiting for someone else to confirm that it behaves as they would expect. I've left details in this issue comment, but the short version is that you can try out the version from the PR using this uvx incantation:

uvx --with git+https://github.com/simonw/files-to-prompt@nested-gitignore files-to-prompt