What My Project Does
catdir is a Python CLI tool that recursively traverses a directory and outputs the concatenated content of all readable files, with file boundaries clearly annotated. It’s like a structured cat for entire folders and their subdirectories.
This makes it useful for:
generating full-text dumps of a project reviewing or archiving codebases piping as context into GPT for analysis or refactoring packaging training data (LLMs, search indexing, etc.)
Example usage:
catdir ./my_project –exclude .env –exclude-noise > dump.txt
Target Audience
Developers who need to review, archive, or process entire project trees GPT/LLM users looking to prepare structured context for prompts Data scientists or ML engineers working with textual datasets Open source contributors looking for a minimal CLI utility to build on
While currently suitable for light- to medium-sized projects and internal tooling, the codebase is clean, tested, and open for contributions — ideal for learning or experimenting.
Comparison
Unlike cat, which takes files one by one, or tools like find | xargs cat, catdir:
Handles errors gracefully with inline comments Supports excluding common dev clutter (.git, __pycache__, etc.) via –exclude-noise Adds readable file boundary markers using relative paths Offers a CLI interface via click Is designed to be pip-installable and cross-platform
It’s not a replacement for archiving tools (tar, zip), but a developer-friendly alternative when you want to see and reuse the full textual contents of a project.
submitted by /u/apaemMSK to r/Python
[link] [comments]
Laisser un commentaire