Skip to content

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

@jurnalanas

Description

@jurnalanas

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!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions