yamadashy / repopack

📦 Repopack is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, and Gemini.
MIT License
601 stars 27 forks source link

Feature request: Exclusion/Inclusion Tags #66

Open jtmuller5 opened 2 weeks ago

jtmuller5 commented 2 weeks ago

I've been using this tool for a few days and it's great. I've created a handful of config files for when I'm working on different parts of my app (UI, cloud functions, scripts, etc) and it works well but I've found myself wanting to only include specific parts of files in specific "packs".

For example, when working on an edge function feature, I want my AI to be aware of my button component so it can create a test page and I want to reference a few lines of a separate file that shows how the button is used (this is a very simple example but it gets the idea across).

My idea is to specify optional inclusion and Exclusion tags in the config file (ex. "// KEEP" and "// OMIT", respectively) and then when you run repopack, if it has those tags it will include code between the "KEEP" comments and exclude code between the "OMIT" comments. If a file has neither of the specific tags, all of it is included.

This would give users a lot of flexibility when creating repopacks that are specific to some domain within their apps:

The idea needs little bit of ironing out but it has the potential to save on token counts and help in situations where your files are huge.

This is an awesome tool, especially combined with Claude projects!

yamadashy commented 1 week ago

Hi @jtmuller5,

Thanks for sharing this interesting idea! I appreciate your feedback and the time you've taken to explain your needs.

Considering future maintenance, i believe implementing a slightly simpler version of this feature would be beneficial for the project's long-term sustainability. With this in mind, i'm considering an approach like this:

// Normal code (included in output)

// repopack-ignore-start
// This block will be excluded from the Repopack output
// repopack-ignore-end

// More normal code (included in output)

This approach would:

It could allow for focused "packs" as you described, while maintaining simplicity in the codebase and ensuring easier maintenance going forward.

What are your thoughts on this approach? Would it address your needs?

Thank you again for your valuable input in helping us improve Repopack!

jtmuller5 commented 1 week ago

Hi! I think this helps make packs smaller but it wouldn't let users create specific "packs" since the same code would be omitted for every pack.

Maybe that can be it's own issue (having some way to configure what code is omitted in a config file).

Thanks!

yamadashy commented 1 week ago

I apologize for misunderstanding your initial request. You're right - the ability to create context-specific "packs" is key.

I now understand you're looking for a way to dynamically include or exclude different parts of the code based on the specific context or task. Your idea about configuring this in a config file is interesting. Does this align with what you had in mind?

I agree there's a need for this in larger projects. I'll give this more thought and consider how to implement a solution for dynamic code selection.

Thank you for helping me understand better!