Skip to content

Feature Request: Add --include-from-file option #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jurnalanas opened this issue May 15, 2025 · 1 comment
Open

Feature Request: Add --include-from-file option #553

jurnalanas opened this issue May 15, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@jurnalanas
Copy link

Add support for reading include patterns from a file to improve usability when dealing with many specific files or complex patterns.

Problem

Currently, when using the --include option with many specific file paths, the command line becomes unwieldy and difficult to manage. For example:

repomix --include "file1.ts,file2.ts,file3.ts,file4.ts,file5.ts,..." # Very long command line

This becomes problematic when:

  • Including many specific files (10+ files)
  • Files have long paths
  • You want to reuse the same set of files across multiple runs
  • Working with version control where command history becomes messy
  • Command line length limits are reached

Proposed Solution

Add a new option --include-from-file (or --include-file) that reads include patterns from a file, one per line.

Usage Example

# Create a file with patterns/files to include
echo "src/components/**/*.tsx
src/hooks/*.ts
src/lib/utils/dateUtils.ts
src/pages/dashboard/**/store.ts" > include-patterns.txt

# Use the file with repomix
repomix --include-from-file include-patterns.txt

File Format

  • One pattern per line
  • Empty lines and lines starting with # are ignored (comments)
  • Both glob patterns and specific file paths are supported

Example include file:

# UI Components
src/components/molecules/**/*.tsx
src/components/ui/*.tsx

# Utility functions
src/lib/utils/common.ts
src/lib/utils/dateUtils.ts

# Dashboard hooks
src/lib/hooks/dashboard/*.ts

Benefits

  1. Cleaner command line: Avoid extremely long command lines
  2. Reusability: Save and reuse file lists across different runs
  3. Version control friendly: Include patterns can be committed to the repository
  4. Better organization: Group related files with comments
  5. Easier maintenance: Modify file lists without retyping entire commands

Would love to see this feature added to make repomix even more flexible for complex project structures!

@yamadashy
Copy link
Owner

Hi, @jurnalanas !
Thank you for the suggestion!
I agree that allowing a list of patterns to be passed in would greatly improve usability.

I’m still weighing the exact flag name, but the feature itself looks excellent.
While names like --include-list or --file-include could work, I currently feel that --include-from-file is the best fit.

@yamadashy yamadashy added the enhancement New feature or request label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants