Github2file – Share your code with AI chatbots

Who has never said to themselves: ” Hey, it would be cool if you could give all my code to my chatbot so it can help me debug this mess.” . Well that’s exactly what …

Github2file – Share your code with AI chatbots


Who has never said to themselves: ” Hey, it would be cool if you could give all my code to my chatbot so it can help me debug this mess.” .

Well that’s exactly what github2file allow to do.

This little Python script will connect directly to your GitHub repository, suck up all your code in the blink of an eye and give you a nice clean text file, ready to be sent to your favorite AI. And the best part is that you can filter the files by language (Python or Go), remove comments and docstrings if you want, choose the branch or tag to download and even exclude certain directories or file types. In short, you’re the boss!

Here’s a quick example for the road. Let’s say you want to throw the code from Hugging Face’s popular Transformers repository at your chatbot.

Easy! Just type this into your terminal:

python github2file.py

And here you are with a file transformers_python.txt which contains all the Python code in the repository. If you’re more into Go, just replace the option --lang by "go" and that’s it. Easy!

And if your deposit is private, don’t panic, github2file has thought of everything! Throw him your username and a GitHub personal access token, and he’ll do it like a pro:

python github2file.py https://:@github.com/username/private-rep

And there you have it, no more headaches to share your code with chatbots! No more need to do long copy-pastes or upload 36 files by hand. To test, It’s here that it happens.

With this, you have all the cards in hand to become pros at sharing code with AI. So get to your keyboards and show us what you can do! 🙌



Source link

Leave a Comment