I extended my Repository Context Packager tool by adding a new feature:
File Filtering by Extension via the --include flag.
This feature allows users to specify which file types they want to include when generating repository summaries.
For example, users can now do the following:
repomaster . --include "*.js"
repomaster . --include "*.js,*.py,*.md"
Many users only want to extract meaningful source code or documentation. By allowing them to filter files by extension, the tool becomes more flexible and efficient when used to generate data for LLM input or AI code assistants. In this feature, the program first parses these patterns from the CLI, then uses the globby library to quickly find all matching files in the current directory. It supports advanced glob syntax, .gitignore, and cross-platform paths, and it handles most of the complexity automatically. Finally, the tool filters the collected file list so that only files whose absolute paths match the globbySync() results are included in the final output.
This feature was inspired by the open-source project Repomix, which also supports --include and --exclude options for pattern-based file selection.
Repomix uses the same globby library, so I followed its approach.
The main difference is that my implementation is intentionally simpler which I focused only on inclusion logic, leaving exclusion and .gitignore merging for future versions.
After completing this feature, I’ve opened two new issues to continue improving overall flexibility in the tool:
• issue-12
• issue-13
These two changes will reduce code complexity, improve performance, and make filtering behavior consistent with modern CLI tools.
Top comments (0)