what is this?
Script that grabs all text from files in a folder, wraps it up, and preps it for AI. No more copy-paste nightmares.
why care?
Need to feed text files to an external AI chatbot? This script does it in seconds. Helpful for iterative back-and-forth.
Save time, look cool.
The code is open sourced on github, so there is no weird stuff, no external services. And you can modify it to your liking, build automation, go wild.
usage
clone it:
git clone https://github.com/pa1ar/export4ai
alias it:
- Add to
~/.zshrcor~/.bashrc:1alias 4aiexport='python /path/to/4aiexport.py' - Reload:
source ~/.zshrcorsource ~/.bashrc.
then use it
Assuming you in the right folder (your project or whatever).
-
basic:
4aiexport .- Export all text files in the current dir.
-
exclude junk:
4aiexport . -x node_modules -x README.md- Skip these.
-
specific files:
4aiexport file1.txt file2.py- Just these.
tips
- if you want to copy the output to clipboard, add
| pbcopyat the end of the command - you can modify the wrapping of the script in the
4aiexport.pyfile to your liking
That is all.