simonw / files-to-prompt

Concatenate a directory full of files into a single prompt for use with LLMs
Apache License 2.0
244 stars 17 forks source link

Fix .gitignore for GitHub repos #19

Open joshvera opened 2 weeks ago

joshvera commented 2 weeks ago

The current main branch at 4810ef78809bf2dda6ae1bc4aea1614bb1f562e6 has issues with properly handling .gitignore rules in Git repositories. This affects the tool's behavior when used within Git projects.

I've forked this repo with the fix at https://github.com/joshvera/files-to-prompt for anyone interested. This fork addresses the .gitignore issue along with several other enhancements:

  1. Added 'ftp' alias for files-to-prompt (e.g., ftp .) based on PR #8.
  2. Fixed --ignore option to properly handle .gitignore rules based on PR #8.
  3. Implemented new --output option to save output to a file (default: ./output.txt) based on PR #8.
  4. Incorporated --xml branch from PR #16
  5. Added TypeScript/JavaScript file minification
  6. Reverted default behavior (without --output) to stream to stdout as in main which reverted in PR #8.

The fork resolves these issues while maintaining compatibility with the current main branch's behavior when no output file is specified.

I'm happy to contribute back any fixes if anyone would like!

P.S. This tool is a breeze. Thanks for all the fishes! If you come across it, I highly recommend it!